Merge pull request #85154 from KoBeWi/yo_dawg_I_heard_you_like_saving_scen-JUST_STOP_IT

Avoid saving scene while already saving the scene
This commit is contained in:
Rémi Verschelde 2023-11-22 13:59:37 +01:00
commit 51bca1b586
No known key found for this signature in database
GPG key ID: C3336907360768E1
2 changed files with 7 additions and 0 deletions

View file

@ -1761,6 +1761,10 @@ static void _reset_animation_mixers(Node *p_node, List<Pair<AnimationMixer *, Re
}
void EditorNode::_save_scene(String p_file, int idx) {
if (!saving_scene.is_empty() && saving_scene == p_file) {
return;
}
Node *scene = editor_data.get_edited_scene_root(idx);
if (!scene) {
@ -1817,7 +1821,9 @@ void EditorNode::_save_scene(String p_file, int idx) {
emit_signal(SNAME("scene_saved"), p_file);
_save_external_resources();
saving_scene = p_file; // Some editors may save scenes of built-in resources as external data, so avoid saving this scene again.
editor_data.save_editor_external_data();
saving_scene = "";
for (Pair<AnimationMixer *, Ref<AnimatedValuesBackup>> &E : anim_backups) {
E.first->restore(E.second);

View file

@ -481,6 +481,7 @@ private:
String _tmp_import_path;
String external_file;
String open_navigate;
String saving_scene;
DynamicFontImportSettings *fontdata_import_settings = nullptr;
SceneImportSettings *scene_import_settings = nullptr;