-
-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[QUESTION] Any reason morph targets count is sometimes 0 on a mesh? #208
Comments
I'ts hard to tell without knowing more about what you're doing. could you provide a reproducible example? |
Looking at the raw model file it seems like at some meshes the delta on all vertexes is 0. I assume then the library just clears the morph targets list if none of them change anything in the mesh? |
Yes, that is the case, see SharpGLTF/src/SharpGLTF.Toolkit/Geometry/Packed/_PrimitiveHelpers.cs Lines 48 to 49 in 681b03b
Now, I am wondering whether this is right or not. From the data perspective, it's a waste of resources to add an effect-less morph target, but not adding it changes the morph targets sequence indexing so it can result in incorrect morph target assignment and animation... But it also depends on how are you using this... |
The model format of the game requires that all meshes have the same amount of morph targets. It's not too hard to work around it by just adding zeroed out morphs though |
Maybe it could potentially be an optional flag? As I said it's not too hard to work around if such behavior is expected but it's also not really mentioned anywhere that this would happen. Don't know how GLTF standard dictates this though |
Well, generally speaking, glTF specification does not like adding stuff that has "no effect" into the rendering... in fact, the gltf validator issues warnings if you do stuff like adding a mesh that is never used in the scene and so on |
Currently using the library to export meshes with morph targets and I gotta say I love the library and the API for being so intuitive to use. However, one current problem I have is when loading the scene back to import back into my own format the amount of morph targets on a random mesh can be 0. What could be the reason for this?
The text was updated successfully, but these errors were encountered: