From 9e315e7c796151e404172afe93ee34ae1ce0e0d4 Mon Sep 17 00:00:00 2001 From: warriormaster12 Date: Tue, 26 Sep 2023 21:14:03 +0300 Subject: [PATCH] Make SkeletonIk3D node usable (cherry picked from commit ddf93f3f59aa5b31908792821e3dfa11ab7b8673) --- editor/plugins/skeleton_ik_3d_editor_plugin.cpp | 9 +-------- scene/3d/skeleton_ik_3d.cpp | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/editor/plugins/skeleton_ik_3d_editor_plugin.cpp b/editor/plugins/skeleton_ik_3d_editor_plugin.cpp index 6331209281b..b1f1639f5be 100644 --- a/editor/plugins/skeleton_ik_3d_editor_plugin.cpp +++ b/editor/plugins/skeleton_ik_3d_editor_plugin.cpp @@ -47,24 +47,17 @@ void SkeletonIK3DEditorPlugin::_play() { skeleton_ik->start(); } else { skeleton_ik->stop(); - skeleton_ik->get_parent_skeleton()->clear_bones_global_pose_override(); } } void SkeletonIK3DEditorPlugin::edit(Object *p_object) { - if (p_object != skeleton_ik) { - if (skeleton_ik) { - play_btn->set_pressed(false); - _play(); - } - } - SkeletonIK3D *s = Object::cast_to(p_object); if (!s) { return; } skeleton_ik = s; + play_btn->set_pressed(skeleton_ik->is_running()); } bool SkeletonIK3DEditorPlugin::handles(Object *p_object) const { diff --git a/scene/3d/skeleton_ik_3d.cpp b/scene/3d/skeleton_ik_3d.cpp index c835b87b7fb..286268b4a20 100644 --- a/scene/3d/skeleton_ik_3d.cpp +++ b/scene/3d/skeleton_ik_3d.cpp @@ -414,7 +414,7 @@ void SkeletonIK3D::_notification(int p_what) { } break; case NOTIFICATION_EXIT_TREE: { - reload_chain(); + stop(); } break; } }