-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Cannot override bone Transform in code when using AnimationTree, even Deterministic = false #87428
Comments
You should use |
I have changed the function from Do you mean currently I cannot change the bone rotation by code when using with animationTree? |
See above. Animation values are applied after gdscript process().
|
@nagasawamaki does it work if you do the override in
Edit: Oh, it also works without
|
Oh, indeed, the main problem is that the CallbackModeProcess of the AnimationMixer does not match the process of the script. However, even if they do match, it is not safe because the order in which the animation values are applied depends on the node order in SceneTree or process_priority as @KMouratidis said. |
That doesn't sound right to me. All internal code should be called before GDScript, as seen here: godot/scene/main/scene_tree.cpp Lines 934 to 948 in 70ca659
And if I'm not mistaken, the actual updates DO happen in process/physics process, as seen here: godot/scene/animation/animation_player.cpp Lines 242 to 260 in 70ca659
So maybe the reason why it works in
This explains why As for the reason this doesn't apply to
Which with
And maybe overrides just overshadow all the other modifications? |
set_bone_global_pose_override - bone_pose_override was implemented to ignore process order for BoneModifications that need to be applied after Animation like IK or PhysicsBone, as hack, but the problem here would be that even if it did, it would not ignore the order for rendering server with skinning (and also maybe multi-threading will mess them up). I'm writing a proposal now to deprecate bone_pose_override in the future and instead have a cleaner control over process order for Animation. |
@KMouratidis Thanks! It works when I put the code inside @TokageItLab Got it. Hope your proposal will be implemented soon. Thanks. |
Tested versions
v4.2.1.stable.official [b09f793]
System information
Godot v4.2.stable - Windows 10.0.19045 - Vulkan (Forward+)
Issue description
When using AnimationTree, I cannot override the bone transform in code.
Everytime it seems the AnimationTree will reset my overrided bone transform,
even I have checked Deterministic = false option, as stated in #87400 .
Steps to reproduce
Import a animated model and set up AnimationTree node and active it, also check Deterministic = false option .
write a script to override bone transform, like below:
No any effect.
Minimal reproduction project (MRP)
bone_transform_override.zip
The text was updated successfully, but these errors were encountered: