Skip to content

Commit bb8001c

Browse files
committed
Merge pull request godotengine#101450 from TokageItLab/reset-anim-skeleton
Change reset timing of the AnimationMixer and Skeleton on save
2 parents 23e05b7 + d5e91ea commit bb8001c

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
@@ -1910,11 +1910,12 @@ void EditorNode::_save_scene(String p_file, int idx) {
19101910
return;
19111911
}
19121912

1913+
List<Pair<AnimationMixer *, Ref<AnimatedValuesBackup>>> anim_backups;
1914+
_reset_animation_mixers(scene, &anim_backups);
1915+
19131916
scene->propagate_notification(NOTIFICATION_EDITOR_PRE_SAVE);
19141917

19151918
editor_data.apply_changes_in_editors();
1916-
List<Pair<AnimationMixer *, Ref<AnimatedValuesBackup>>> anim_backups;
1917-
_reset_animation_mixers(scene, &anim_backups);
19181919
save_default_environment();
19191920

19201921
_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
@@ -325,6 +325,12 @@ void Skeleton3D::_notification(int p_what) {
325325
update_flags = UPDATE_FLAG_POSE;
326326
_notification(NOTIFICATION_UPDATE_SKELETON);
327327
} break;
328+
#ifdef TOOLS_ENABLED
329+
case NOTIFICATION_EDITOR_PRE_SAVE: {
330+
force_update_all_dirty_bones();
331+
emit_signal(SceneStringName(skeleton_updated));
332+
} break;
333+
#endif // TOOLS_ENABLED
328334
case NOTIFICATION_UPDATE_SKELETON: {
329335
// Update bone transforms to apply unprocessed poses.
330336
force_update_all_dirty_bones();

0 commit comments

Comments
 (0)