diff options
author | Tokage <tokage.it.lab@gmail.com> | 2020-08-21 13:56:04 +0900 |
---|---|---|
committer | Tokage <tokage.it.lab@gmail.com> | 2020-11-17 13:18:53 +0900 |
commit | ddac0e95dc72ffe9472495d6b46743829c4dbea9 (patch) | |
tree | fb0d7457ecbfdce55d595ab1a54e45cd214ca0ef | |
parent | b0ca859501186b6fa088a3d3542f7dd4d72ae305 (diff) |
fix unintentional object rotation by animation tree
-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 466536db10..1e423b4d10 100644 --- a/scene/animation/animation_tree.cpp +++ b/scene/animation/animation_tree.cpp @@ -601,9 +601,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; } } @@ -1208,7 +1208,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); } |