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

Add the option to just write texture filenames into texture>image>uri without copying #2172

Closed itsdanott closed 5 months ago

itsdanott commented 6 months ago

Is your feature request related to a problem? Please describe.

I am working on a 3d game and a custom engine. I using Blender for 3D modelling, I export via gltf into a "assets/models" folder. There is also a "models/textures" folder. Textures and materials are shared among many model files therefore I am attempting to treat them less-bound to the gltf file. With the way the Blender gltf export currently works my workflow looks like this:

As you can see this involves steps (like the deletion of textures) that could be improved.

Describe the solution you'd like

I would love to see a "Filename only" option in the dropdown Data>Material>Images so that the filename is used as the uri without any exture copying to the target directory.

Describe alternatives you've considered

An hacky workaround / alternative for me is to write the filename as texture name and completly ignore the uri-field when loading the gltf file. With this approach I could check the "Keep original" option - so at least no texture copying / deletion is involved.

This is quite a specific use case but it might be worth considering I guess. Thank you!

julienduroure commented 5 months ago

Hello,

I would love to see a "Filename only" option in the dropdown Data>Material>Images so that the filename is used as the uri without any exture copying to the target directory.

Using this feature without having the textures already named correctly and in the right directory will generate some non valid glTF Separated file. I don't think this is a good idea.

This is quite a specific use case

As you said, this is a really specific use case, and I am not sure we should add one more option in the UI, that have already lots of panels / options.

I am not sure to understand why "Keep original" option does not fit your workflow. Can you please try to explain it?

itsdanott commented 5 months ago

When loading gltf files into the engine I wanted to use the uri member of the cgltf_image struct to determine the file name of the texture as this would be the correct one to use but using the name member instead works perfectly fine as long as you keep the "TEXT_NAME.png" naming in Blender so I think it's not worth the afford.