Make SkeletonIk3D node usable

(cherry picked from commit ddf93f3f59)
This commit is contained in:
warriormaster12 2023-09-26 21:14:03 +03:00 committed by Yuri Sizov
parent 5abac84a9e
commit 9e315e7c79
2 changed files with 2 additions and 9 deletions

View File

@ -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<SkeletonIK3D>(p_object);
if (!s) {
return;
}
skeleton_ik = s;
play_btn->set_pressed(skeleton_ik->is_running());
}
bool SkeletonIK3DEditorPlugin::handles(Object *p_object) const {

View File

@ -414,7 +414,7 @@ void SkeletonIK3D::_notification(int p_what) {
} break;
case NOTIFICATION_EXIT_TREE: {
reload_chain();
stop();
} break;
}
}