Skip to content

Commit

Permalink
Make SkeletonIk3D node usable
Browse files Browse the repository at this point in the history
  • Loading branch information
warriormaster12 committed Sep 28, 2023
1 parent 59139df commit ddf93f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
9 changes: 1 addition & 8 deletions editor/plugins/skeleton_ik_3d_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,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 {
Expand Down
2 changes: 1 addition & 1 deletion scene/3d/skeleton_ik_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ void SkeletonIK3D::_notification(int p_what) {
} break;

case NOTIFICATION_EXIT_TREE: {
reload_chain();
stop();
} break;
}
}
Expand Down

0 comments on commit ddf93f3

Please sign in to comment.