-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Root motion works unexpectedly with some models #75228
Comments
The problem is that your root bone has a strange Rest axis. You need to use retargeting or something so that +Z is forward like the other gltf assets. |
I encountered this today when testing in Godot 4.0.2. If you've rigged and animated character in blender, then you're working in a space with the Z axis as the up and down axis. However, it appears that the 'root motion view' does not interpret the converted orientation of the imported character, which is why you get the purple root motion grid moving down the Y axis - its using the character's orientation as if it was still in blender and thinks that the Z axis is still up and down. This is definitely a bug with Godot 4.0 because this works perfectly in Godot 3.5 |
@QuiGonMaul See also #75843 (comment). Blender uses +Z up for object space, but the cameras and bones uses +Y up (for the Edit bone, it may be confusing since the Local transform always looks like +Z up, but if you set the gizmo option to Normal, you can visualize the bone axis), so this should not be a problem as long as the model has Root bones in Blender and bone animations are used. I think the problem is probably caused when the Root motion is created as an object animation or AutoRig in Blender. One currently available fix is to apply retargeting to Root bone with Overwrite Axis and Apply Node Transform. |
As far as I understand, everything else works perfectly as it also does in Godot 3.5, except the 'root motion view' purple grid. Without changing any settings on this imported character from blender (including suggested re-targeting fixes etc.), I'm still able to get a properly working animated character that uses root motion driven animation when running a build. |
Is the your Rest of Root Bone the initial Transform? (Is the Root Bone pointing up correctly in Blender?) In Godot 3.x, the motion result gets a relative value from the Rest, whereas in Godot 4.0, it gets an absolute value from the initial Transform: Animation data rework for 4.0. Therefore, Godot 4.0 should not include rotation in the Rest of the Root Bone. |
Yes, my root bone for the rig in blender is oriented correctly with the rest of the bones (+Z axis up, and facing forward in the -Y axis). I should also mention that when testing the character's root motion rotation in Godot using 'root motion view', it causes the purple grid to rotate along Godot's Z axis, giving the effect of the entire floor plane spinning on its side. |
As I said above, blender uses +Y up (+Y roll) for bones and the all bone axes are never changed by the +Y up option, so the root bone must be +Y up (Edit bone's Tail must be placed upward of the Head, and the roll is 0; which is the same as the bone that is added when the armature is added to scene) in blender, not +Z up as long as it is bone. Also you can check the bone axis (rest) with this add-on in blender. |
I'm having this problem as well. After checking @TokageItLab 's comment I have changed the orientation of root bone like below and the problem is solved but I think these shouldn't be related and this is a hacky solution, so I still hope this would be fixed in the future. |
Blender uses +Z-up for objects/world, but +Y-up for cameras, lights, and bones. The axis of the root bone is preferably "aligned with the world axis of the final environment to be used". Bone axes are not converted by glTF-IO, so if they are aligned to blender's world axis, they will not be aligned to godot's world axis. So this (using +Y-up on the root bone and other bones) is not a hack, but if I had to say that rather the role of the blender-glTF exporter to fix a strange condition where only the root bone uses a different coordinate system than the other bones (although I've never seen an official article recommending that blender point the root bone tail back and using +Z-up for the bone in the first place). |
Godot version
4.0.1rc
System information
Ubuntu 22.04, Intel Skylake GT2 [HD Graphics 520], Vulkan
Issue description
I'm not sure if this is an engine issue or not, but with one of my character models root motion isn't working as expected.
This is the original animation:
I set up the root motion and the character stays in place as expected, but the interpreted movement shows no forward movement:
I also notice that if I uncheck "Zero Y" in the
RootMotionView
the floor drops away:I can't figure out what the cause might be as the original animation looks correct.
Steps to reproduce
In the attached project the
person.tscn
demonstrates the case where root motion isn't working as expected. The other two (mixamo.tscn
andmixamo_rotated.tscn
) are examples where it's working fine.Minimal reproduction project
root_motion_issue.zip
The text was updated successfully, but these errors were encountered: