fix unintentional object rotation by animation tree
(cherry picked from commit ddac0e95dc
)
This commit is contained in:
parent
c318cf6ed2
commit
0454848f4d
1 changed files with 2 additions and 2 deletions
|
@ -599,9 +599,9 @@ bool AnimationTree::_update_caches(AnimationPlayer *player) {
|
||||||
|
|
||||||
if (path.get_subname_count() == 1 && Object::cast_to<Skeleton>(spatial)) {
|
if (path.get_subname_count() == 1 && Object::cast_to<Skeleton>(spatial)) {
|
||||||
Skeleton *sk = Object::cast_to<Skeleton>(spatial);
|
Skeleton *sk = Object::cast_to<Skeleton>(spatial);
|
||||||
|
track_xform->skeleton = sk;
|
||||||
int bone_idx = sk->find_bone(path.get_subname(0));
|
int bone_idx = sk->find_bone(path.get_subname(0));
|
||||||
if (bone_idx != -1) {
|
if (bone_idx != -1) {
|
||||||
track_xform->skeleton = sk;
|
|
||||||
track_xform->bone_idx = bone_idx;
|
track_xform->bone_idx = bone_idx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1207,7 +1207,7 @@ void AnimationTree::_process_graph(float p_delta) {
|
||||||
} else if (t->skeleton && t->bone_idx >= 0) {
|
} else if (t->skeleton && t->bone_idx >= 0) {
|
||||||
t->skeleton->set_bone_pose(t->bone_idx, xform);
|
t->skeleton->set_bone_pose(t->bone_idx, xform);
|
||||||
|
|
||||||
} else {
|
} else if (!t->skeleton) {
|
||||||
t->spatial->set_transform(xform);
|
t->spatial->set_transform(xform);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue