1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Force update RetargetModifier3D's child skeletons on save

This commit is contained in:
Silc Lizard (Tokage) Renew
2025-01-12 07:22:51 +09:00
parent 21a6bd8dca
commit cb61c6e852
2 changed files with 20 additions and 0 deletions

View File

@@ -213,6 +213,19 @@ void RetargetModifier3D::_reset_child_skeletons() {
child_skeletons.clear();
}
#ifdef TOOLS_ENABLED
void RetargetModifier3D::_force_update_child_skeletons() {
for (const RetargetInfo &E : child_skeletons) {
Skeleton3D *c = Object::cast_to<Skeleton3D>(ObjectDB::get_instance(E.skeleton_id));
if (!c) {
continue;
}
c->force_update_all_dirty_bones();
c->emit_signal(SceneStringName(skeleton_updated));
}
}
#endif // TOOLS_ENABLED
/// General functions
void RetargetModifier3D::add_child_notify(Node *p_child) {
@@ -452,9 +465,12 @@ void RetargetModifier3D::_notification(int p_what) {
case NOTIFICATION_ENTER_TREE: {
_update_child_skeletons();
} break;
#ifdef TOOLS_ENABLED
case NOTIFICATION_EDITOR_PRE_SAVE: {
_reset_child_skeleton_poses();
_force_update_child_skeletons();
} break;
#endif // TOOLS_ENABLED
case NOTIFICATION_EXIT_TREE: {
_reset_child_skeletons();
} break;