-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
GLTFExporter: Add MAT3
accessor support.
#25426
Conversation
Would you be able to share an example? I'm not sure I've ever seen MAT3 accessors in glTF, are they used for vertex attributes, animation samplers, or something else? |
Can't give the actual gltf that made me notice the issue but here is a part of the original that will be invalid after export.
I can ask if our 3d artist knows what type of data causes it. Our model is quite complex skinned mesh with blend shapes but with no animation. I can also ask if he could replicate the MAT3 accessor with some smaller model that I can give to you. |
If you check glTF specs (https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#_accessor_type) you can see that it should be supported. You are also missing MAT2 but for that you would need to do a bit more magic because it has the same item count as VEC4. Luckily we don't need MAT2 support so I would be really happy if we could get just this oneliner in fast :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll assume it's a MAT3 vertex attribute, and not an animation channel or something else accessors could be used for... I've never seen these used in any glTF file, and in general it's hard to maintain or test code paths that we don't know how to reach, so any other information would be really helpful in ensuring this doesn't break in the future.
But it's a simple enough change for sure, and so no objection to the PR here!
Here is a simple test asset exported from Houdini that has MAT3. There is a way to remove it though but by default it is exported. |
Thanks @paugit! Seems to be the |
MAT3
accessor support.
MAT3
accessor support.MAT3
accessor support.
GLTFExporter generates invalid GLTFs if the source scene contains glTF models with MAT3 accessor type.
These type of accessors are generated by Houdini for example. GLTFImporter does know this type but the GLTFExporter does not and it will omit the accessor type from the generated glTF. The generated file will not open in any known 3d software like Blender, Houdini and so on.
This small PR will fix the issue.