From bb0358dd8d3ed99c9fb3545efdf821d28e73b68b Mon Sep 17 00:00:00 2001 From: Eric Rybicki Date: Sat, 25 Jan 2020 10:06:14 +0100 Subject: Use a new approach to fix bone pose override not being reset when IK animation is stopped. This reverts PR #35460 & commit 551c37167b0428b1489a8a6f6233624c5f4aa628. --- editor/plugins/skeleton_ik_editor_plugin.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'editor/plugins/skeleton_ik_editor_plugin.cpp') 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); } } } -- cgit v1.2.3