Skip to content

Commit d5e91ea

Browse files
committed
Change reset timing of the AnimationMixer and Skeleton on save
1 parent 21a6bd8 commit d5e91ea

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

editor/editor_node.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1889,11 +1889,12 @@ void EditorNode::_save_scene(String p_file, int idx) {
18891889
return;
18901890
}
18911891

1892+
List<Pair<AnimationMixer *, Ref<AnimatedValuesBackup>>> anim_backups;
1893+
_reset_animation_mixers(scene, &anim_backups);
1894+
18921895
scene->propagate_notification(NOTIFICATION_EDITOR_PRE_SAVE);
18931896

18941897
editor_data.apply_changes_in_editors();
1895-
List<Pair<AnimationMixer *, Ref<AnimatedValuesBackup>>> anim_backups;
1896-
_reset_animation_mixers(scene, &anim_backups);
18971898
save_default_environment();
18981899

18991900
_save_editor_states(p_file, idx);

scene/3d/skeleton_3d.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,12 @@ void Skeleton3D::_notification(int p_what) {
327327
update_flags = UPDATE_FLAG_POSE;
328328
_notification(NOTIFICATION_UPDATE_SKELETON);
329329
} break;
330+
#ifdef TOOLS_ENABLED
331+
case NOTIFICATION_EDITOR_PRE_SAVE: {
332+
force_update_all_dirty_bones();
333+
emit_signal(SceneStringName(skeleton_updated));
334+
} break;
335+
#endif // TOOLS_ENABLED
330336
case NOTIFICATION_UPDATE_SKELETON: {
331337
// Update bone transforms to apply unprocessed poses.
332338
force_update_all_dirty_bones();

0 commit comments

Comments
 (0)