prefrontalcortex / UnityGLTF

Runtime GLTF Loader for Unity3D
MIT License
163 stars 41 forks source link

Several fixes #106

Closed pfcDorn closed 1 year ago

pfcDorn commented 1 year ago

fixes while testing with gtlf test models

marwie commented 1 year ago

I'm not sure if we really want to do this, it kind of breaks roundtripping of files (suddenly they end up having names!).

How do we make sure we're then not exporting these new (wrong) names on export?

What if the the names start with \0 (null terminating) and then get the index name etc and on export IF the texture name starts with \0 the texture name is removed/empty again

pfcDorn commented 1 year ago

why would it be a bad thing if the texture have names on export? I would guess when you do an export of it, you made changes anyway.

marwie commented 1 year ago

Because the names they are given are arbitrary and not a deliberate user change. Texture names are optional in glTF and the order of textures can change during post-processing (compression etc) which would then result in mismatching names Texture_2 being now index 0 or so.

I think it is fine/makes sense to give them a readable name in Unity on import but would prefer if that name would not persist (after exporting again) if it was just a generated one and the user didnt rename the texture

pfcDorn commented 1 year ago

Some new changes: