mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-11-22 00:48:09 +01:00
Backported from godot 4: Make SkeletonIk3D node usable
- warriormaster12
ddf93f3f59
This commit is contained in:
parent
506a0756c5
commit
a59cb3956b
@ -52,24 +52,18 @@ void SkeletonIKEditorPlugin::_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 SkeletonIKEditorPlugin::edit(Object *p_object) {
|
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);
|
SkeletonIK *s = Object::cast_to<SkeletonIK>(p_object);
|
||||||
if (!s) {
|
if (!s) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
skeleton_ik = s;
|
skeleton_ik = s;
|
||||||
|
|
||||||
|
play_btn->set_pressed(skeleton_ik->is_running());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SkeletonIKEditorPlugin::handles(Object *p_object) const {
|
bool SkeletonIKEditorPlugin::handles(Object *p_object) const {
|
||||||
|
@ -425,7 +425,7 @@ void SkeletonIK::_notification(int p_what) {
|
|||||||
|
|
||||||
} break;
|
} break;
|
||||||
case NOTIFICATION_EXIT_TREE: {
|
case NOTIFICATION_EXIT_TREE: {
|
||||||
reload_chain();
|
stop();
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user