You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Merge pull request #41416 from TokageItLab/fix_animation_tree_cache
fix unintentional object rotation by anim tree
This commit is contained in:
@@ -597,9 +597,9 @@ bool AnimationTree::_update_caches(AnimationPlayer *player) {
|
|||||||
|
|
||||||
if (path.get_subname_count() == 1 && Object::cast_to<Skeleton3D>(spatial)) {
|
if (path.get_subname_count() == 1 && Object::cast_to<Skeleton3D>(spatial)) {
|
||||||
Skeleton3D *sk = 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));
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1205,7 +1205,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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user