diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-05-09 13:57:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-09 13:57:18 +0200 |
commit | a4e8da8d0b5f0c15f8bf142c58470db03836d23c (patch) | |
tree | e564a603066638627e3af1c95d94710a5d479728 /scene | |
parent | 5d116b5d736a0b20d6b203157fe653492b7951c7 (diff) | |
parent | ddac0e95dc72ffe9472495d6b46743829c4dbea9 (diff) |
Merge pull request #41416 from TokageItLab/fix_animation_tree_cache
fix unintentional object rotation by anim tree
Diffstat (limited to 'scene')
-rw-r--r-- | scene/animation/animation_tree.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/animation/animation_tree.cpp b/scene/animation/animation_tree.cpp index 44f2d38a84..2ad871ba61 100644 --- a/scene/animation/animation_tree.cpp +++ b/scene/animation/animation_tree.cpp @@ -597,9 +597,9 @@ bool AnimationTree::_update_caches(AnimationPlayer *player) { if (path.get_subname_count() == 1 && Object::cast_to<Skeleton3D>(spatial)) { Skeleton3D *sk = Object::cast_to<Skeleton3D>(spatial); + track_xform->skeleton = sk; int bone_idx = sk->find_bone(path.get_subname(0)); if (bone_idx != -1) { - track_xform->skeleton = sk; track_xform->bone_idx = bone_idx; } } @@ -1205,7 +1205,7 @@ void AnimationTree::_process_graph(float p_delta) { } else if (t->skeleton && t->bone_idx >= 0) { t->skeleton->set_bone_pose(t->bone_idx, xform); - } else { + } else if (!t->skeleton) { t->spatial->set_transform(xform); } |