Skip to content

Commit

Permalink
Merge pull request godotengine#41416 from TokageItLab/fix_animation_t…
Browse files Browse the repository at this point in the history
…ree_cache

fix unintentional object rotation by anim tree
  • Loading branch information
akien-mga authored May 9, 2021
2 parents 5d116b5 + ddac0e9 commit a4e8da8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scene/animation/animation_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit a4e8da8

Please sign in to comment.