diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-02-09 22:14:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-09 22:14:31 +0100 |
commit | 9f9d6c6cc183101cff07073857e7a223e0acbc6a (patch) | |
tree | 6fc4c91321788d43aafb7a4627e45e0de0939e00 /editor/plugins/skeleton_ik_editor_plugin.cpp | |
parent | d617df5f3460a2bb55ce41497fdc24a885bf746c (diff) | |
parent | bb0358dd8d3ed99c9fb3545efdf821d28e73b68b (diff) |
Merge pull request #35656 from ericrybick/35460-fix2
Use a new approach to fix bone pose override not being reset when IK animation is stopped.
Diffstat (limited to 'editor/plugins/skeleton_ik_editor_plugin.cpp')
-rw-r--r-- | editor/plugins/skeleton_ik_editor_plugin.cpp | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/editor/plugins/skeleton_ik_editor_plugin.cpp b/editor/plugins/skeleton_ik_editor_plugin.cpp index 43dc13b270..eb6ad9498d 100644 --- a/editor/plugins/skeleton_ik_editor_plugin.cpp +++ b/editor/plugins/skeleton_ik_editor_plugin.cpp @@ -41,21 +41,12 @@ void SkeletonIKEditorPlugin::_play() { return; if (play_btn->is_pressed()) { - - initial_bone_poses.resize(skeleton_ik->get_parent_skeleton()->get_bone_count()); - for (int i = 0; i < skeleton_ik->get_parent_skeleton()->get_bone_count(); ++i) { - initial_bone_poses.write[i] = skeleton_ik->get_parent_skeleton()->get_bone_pose(i); - } - skeleton_ik->start(); } else { skeleton_ik->stop(); - if (initial_bone_poses.size() != skeleton_ik->get_parent_skeleton()->get_bone_count()) - return; - for (int i = 0; i < skeleton_ik->get_parent_skeleton()->get_bone_count(); ++i) { - skeleton_ik->get_parent_skeleton()->set_bone_pose(i, initial_bone_poses[i]); + skeleton_ik->get_parent_skeleton()->set_bone_global_pose_override(i, Transform(), 0); } } } |