Skip to content

Commit

Permalink
Backported from godot 4: Make SkeletonIk3D node usable
Browse files Browse the repository at this point in the history
- warriormaster12

godotengine/godot@ddf93f3
  • Loading branch information
Relintai committed Sep 30, 2024
1 parent 506a075 commit a59cb39
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
10 changes: 2 additions & 8 deletions modules/skeleton_3d/editor/skeleton_ik_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,24 +52,18 @@ void SkeletonIKEditorPlugin::_play() {
skeleton_ik->start();
} else {
skeleton_ik->stop();
skeleton_ik->get_parent_skeleton()->clear_bones_global_pose_override();
}
}

void SkeletonIKEditorPlugin::edit(Object *p_object) {
if (p_object != skeleton_ik) {
if (skeleton_ik) {
play_btn->set_pressed(false);
_play();
}
}

SkeletonIK *s = Object::cast_to<SkeletonIK>(p_object);
if (!s) {
return;
}

skeleton_ik = s;

play_btn->set_pressed(skeleton_ik->is_running());
}

bool SkeletonIKEditorPlugin::handles(Object *p_object) const {
Expand Down
2 changes: 1 addition & 1 deletion modules/skeleton_3d/nodes/skeleton_ik.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ void SkeletonIK::_notification(int p_what) {

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

0 comments on commit a59cb39

Please sign in to comment.