-
Notifications
You must be signed in to change notification settings - Fork 317
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
Models deforming when converting from Blender to GLTF #2104
Comments
To help us narrow this down, do you see the same issue when running gltfjsx with a higher precision? The default is 3 decimals precision in node position/rotation/scale, which could be an issue. There's an option for this in the gltfjsx GUI, or the
I'm not sure I understood this part, do you mean you see the deformation in Blender after export, unrelated to gltfjsx? I'm testing in Blender 4.0 and not seeing the deformation there so far. |
Seems your rigs are using BBone, that can not be exported in glTF. Note that Blender now have the requested API to convert BBone to multiple bones. But the work still to be done to manage it correctly at export is huge, and not planned for now. |
Thought I had resolved it by updating my blender to 4.0, things were working yesterday and now this morning it broke once again. Yes, both the gltf file and Blender have deformed bones after the export occurs. This morning I had to make a quick adjustment to the scene, and when I exported it once more the bones deformed again |
|
@julienduroure Another question, if it is the bendy bones why are the two other rigged models in this file work/retain their structure, while the two quadrupeds lose it? |
If you want me to investigate more deeply, can you please create a new .blend file with only the dog and a single action for it, where we can see the deformation the best, and indicate what part is deformed. As far as I can see, there is not so much BBone deformation on owl and crab (even if there is some BBones). But there are for the dog (on the neck for example): |
@julienduroure In the main file, where I see the deformation occur is on the front two paws on the joint just above the foot, identified as the foot_front_heel, in the model you can see its near perpendicular to the xy axis, but when I export to gltf it becomes more parallel to the xy axis. This deformation occurs on the neutral pose of the models, so it affects every animation they use |
Sorry, but I am not able to understand clearly what your problem is. Is your blend file changed after export, or is the issue can be viewed in an external viewer? Is it some bone/joint rotation issue, or the problem come from geometry/mesh issue? Does your DogCustomRig shows the issue, or only the main file myProject ? |
@julienduroure my Blender file is changed after export AND the deformation is viewed in the final destination. When using a GLTF viewer (https://gltf.pmnd.rs/) the issue does not show itself. It seems to be a bone rotation issue, that after executing the export front_foot_heel)ik.R/L changes its orientation. Because the rig is parent to the model, the model deforms due to the front_foot_heel_ik.R/L changing orientation/rotation. CustomDogRig was showing no issues when I tried to export it. The issue is only in the main file (myProject) Below are photos of the model in three different environments In GLTF Viewer |
Seems I am not able to reproduce Before Export : After Export: |
@julienduroure This is correct, however noce you convert this to jsx and using gltfjsx, you will see that the animations are all deformed. the strangest part is that the neutral poses are correct, but once you apply the animation it does not work any more. Attached is the sandbox I have been using to test my animations in a React project |
@cgordon5025 is it possible to observe the deformation in any of these viewers? If not, I think it may be necessary to report an issue at https://github.com/pmndrs/gltfjsx/. This exporter aims to produce a valid and visually-correct glTF file. Generating a JSX template from that is an additional process with its own complexities. |
@donmccurdy Yes, in the first link provided, https://gltf-viewer.donmccurdy.com/ You can see that the dog, when in idle/rest position that the legs are proper and not deformed, but when activating the animation, the rig becomes deformed See attached video. DogRigDeformingWhileAnimating.mp4 |
@julienduroure In my blender file they are not like that, let me send another I have noticed that if it is not deformed before exporting, it will become deformed, but then you are able to undo w/ control-z |
I can reproduce with this new .blend file |
I opened a discussion here about the Blender API to reset bones to rest pose (that is root of the issue): |
Some bones are locked and have non default values (MCH-front_foot_parent.L for example). During switch between actions, to avoid unexpected issue when some channels are keyed on an action, but not in another, we reset bone matrices. This reset make all matrices Identity. But because of non default locked bone, this is not the behavior we get when using Clear Transforms (alt+G/R/S). You can workaround that (if all your channels are keyed) by disable this option: Reset Bones between actions |
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
When exporting my scene with animated models, I expect that the models retain their structure and integrity as I see it in the blender GUI.
Screenshots
Expected Behavior (screenshot taken in Blender):
Actual Behavior (screenshot taken in React Project):
myProject.zip
Version
Additional context
Add any other context about the problem here.
I am using the polmandres GLTF to JSX converter to render this, when using their provided GLTF viewer (https://gltf.pmnd.rs/) the models looks correct, yet in the project they are warped. Further when I export within Blender, I see immediately that the Fox and Dog models have the same deformation that appear in the gltf file. If I click undo, they are 'fixed', but the gltf remains warped.
The text was updated successfully, but these errors were encountered: