KhronosGroup / glTF-Blender-IO

Blender glTF 2.0 importer and exporter
https://docs.blender.org/manual/en/latest/addons/import_export/scene_gltf2.html
Apache License 2.0
1.48k stars 316 forks source link

Unable to export object with UDIM on 3.6, 4.1 and 4.2 #2281

Closed NyxXaos closed 1 month ago

NyxXaos commented 1 month ago

Describe the bug I tried to export my mesh object with a single material, with UDIM tiles, on Blender 3.6, to GLB as well as GLTF, I got a bunch of things I cannot understand in the console for my efforts and no exported file. After some web-browsing I learned that support for UDIM supposedly only came with 4.1 so I downloaded that one. Same issues with that one though. Then I also tried 4.2.0, same issues.

To Reproduce

  1. Create whatever mesh, with a udim:ed UV, I have 17 tiles in my example
  2. Set up node-tree (see screenshot)
  3. Select object, File > Export > gLTF....
  4. Leave things at default, or do whatever settings, but set materials to export as JPEG with full quality, and tick "selected objects" only.
  5. Hit Export and behold a bunch of gibberish, and no exported file.

Expected behavior I expected to end up with a GLB file (or one of the other export forms offered...), now I get nothing.

Screenshots Shader nodes: https://i.gyazo.com/4b2e6b58dd0319e21e0c0235e3dc5ad1.png Console output (also in the zip): https://pastebin.com/GT2xbv3S

.blend file/ .gltf (mandatory) The blend file is too big to upload (too many textures?), but is available at https://1drv.ms/u/s!ArHguuFtJthSg5ND1LGMUMJoEk3Ptg?e=Cmp7nB until last of August unless there is a resolution earlier than that. The zip contains the blend file (saved in Blender 4.2.0), and a .txt file with the console output.

Version

Additional context I don't really know what more to say, I'm no Blender expert and certainly not a Blender developer or tester. Very willing to help in troubleshooting though, if I can!

julienduroure commented 1 month ago

Confirmed. Seems the UDIM texture are packed, and this is something we don't manage (for now). See https://github.com/KhronosGroup/glTF-Blender-IO/blob/6b6f59c312193e91db76030cbdb0b9e6b7570fb3/addons/io_scene_gltf2/blender/exp/material/extensions/gltf2_blender_image.py#L414

NyxXaos commented 1 month ago

They are packed in the example file, but I see the same issue when they are not. Do you see the issue if you unpack them? I took the blend file into 4.1.1 just now, and

  1. Unpacked the textures
  2. Deleted the Material
  3. Created a new Material with Node Wrangler (Ctrl + Shift + T), selecting all the image files
  4. Set all the texture nodes appropriately (set them to UDIM, checked their Color-settings)
  5. Added the gLTF Output node, connected the AO Texture Node to it
  6. Tried to export as gLTF, same issues (didn't compare the gibberish console output though)

I also applied all the modifiers to the mesh, and tried to export again, with the same result.

NyxXaos commented 1 month ago

@julienduroure

A zip file with the .blend and unpacked textures. This is a new blend file with the node-setup done in the same way as I described above. Two of the mods are left in place, I removed the Multires mod. I also changed the name of the image files just in case that would make a difference. I notice that the console output is somewhat different now, but it's still gibberish to me. However, still no joy on export. Let me know if you want the console output, but I would suspect you'll have the same if you try it.

Thank you for any help in resolving this!

https://1drv.ms/u/s!ArHguuFtJthSg5Qgyzr_8cSqMlfq9g?e=GSLo8j

julienduroure commented 1 month ago

Root cause: We assumed that tiles are set on a rectangle, that is not always the case (as in your example). Investigation on a fix in progress

NyxXaos commented 1 month ago

Thank you very much =) Is it perhaps then a workaround to add more tiles? I will test.