summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--editor/editor_node.cpp6
-rw-r--r--editor/editor_node.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 6012ff1f70..b6c97f0c8f 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -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);
diff --git a/editor/editor_node.h b/editor/editor_node.h
index d4a8fc9aa8..956058ecfc 100644
--- a/editor/editor_node.h
+++ b/editor/editor_node.h
@@ -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;