From d5e91eaa42b46494a51488bc19af3aca5abd6979 Mon Sep 17 00:00:00 2001 From: "Silc Lizard (Tokage) Renew" <61938263+TokageItLab@users.noreply.github.com> Date: Sun, 12 Jan 2025 07:04:55 +0900 Subject: [PATCH] Change reset timing of the AnimationMixer and Skeleton on save --- editor/editor_node.cpp | 5 +++-- scene/3d/skeleton_3d.cpp | 6 ++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 3d901ba7c06..ee9a60ada3c 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -1889,11 +1889,12 @@ void EditorNode::_save_scene(String p_file, int idx) { return; } + List>> anim_backups; + _reset_animation_mixers(scene, &anim_backups); + scene->propagate_notification(NOTIFICATION_EDITOR_PRE_SAVE); editor_data.apply_changes_in_editors(); - List>> anim_backups; - _reset_animation_mixers(scene, &anim_backups); save_default_environment(); _save_editor_states(p_file, idx); diff --git a/scene/3d/skeleton_3d.cpp b/scene/3d/skeleton_3d.cpp index 8c31878c241..57d2d579214 100644 --- a/scene/3d/skeleton_3d.cpp +++ b/scene/3d/skeleton_3d.cpp @@ -327,6 +327,12 @@ void Skeleton3D::_notification(int p_what) { update_flags = UPDATE_FLAG_POSE; _notification(NOTIFICATION_UPDATE_SKELETON); } break; +#ifdef TOOLS_ENABLED + case NOTIFICATION_EDITOR_PRE_SAVE: { + force_update_all_dirty_bones(); + emit_signal(SceneStringName(skeleton_updated)); + } break; +#endif // TOOLS_ENABLED case NOTIFICATION_UPDATE_SKELETON: { // Update bone transforms to apply unprocessed poses. force_update_all_dirty_bones();