You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-22 15:06:45 +00:00
Make SkeletonIk3D node usable
This commit is contained in:
@@ -48,24 +48,17 @@ void SkeletonIK3DEditorPlugin::_play() {
|
|||||||
skeleton_ik->start();
|
skeleton_ik->start();
|
||||||
} else {
|
} else {
|
||||||
skeleton_ik->stop();
|
skeleton_ik->stop();
|
||||||
skeleton_ik->get_parent_skeleton()->clear_bones_global_pose_override();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SkeletonIK3DEditorPlugin::edit(Object *p_object) {
|
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);
|
SkeletonIK3D *s = Object::cast_to<SkeletonIK3D>(p_object);
|
||||||
if (!s) {
|
if (!s) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
skeleton_ik = s;
|
skeleton_ik = s;
|
||||||
|
play_btn->set_pressed(skeleton_ik->is_running());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SkeletonIK3DEditorPlugin::handles(Object *p_object) const {
|
bool SkeletonIK3DEditorPlugin::handles(Object *p_object) const {
|
||||||
|
|||||||
@@ -414,7 +414,7 @@ void SkeletonIK3D::_notification(int p_what) {
|
|||||||
} break;
|
} break;
|
||||||
|
|
||||||
case NOTIFICATION_EXIT_TREE: {
|
case NOTIFICATION_EXIT_TREE: {
|
||||||
reload_chain();
|
stop();
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user