You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-13 13:31:48 +00:00
Avoid saving scene while already saving the scene
This commit is contained in:
@@ -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) {
|
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);
|
Node *scene = editor_data.get_edited_scene_root(idx);
|
||||||
|
|
||||||
if (!scene) {
|
if (!scene) {
|
||||||
@@ -1817,7 +1821,9 @@ void EditorNode::_save_scene(String p_file, int idx) {
|
|||||||
emit_signal(SNAME("scene_saved"), p_file);
|
emit_signal(SNAME("scene_saved"), p_file);
|
||||||
|
|
||||||
_save_external_resources();
|
_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();
|
editor_data.save_editor_external_data();
|
||||||
|
saving_scene = "";
|
||||||
|
|
||||||
for (Pair<AnimationMixer *, Ref<AnimatedValuesBackup>> &E : anim_backups) {
|
for (Pair<AnimationMixer *, Ref<AnimatedValuesBackup>> &E : anim_backups) {
|
||||||
E.first->restore(E.second);
|
E.first->restore(E.second);
|
||||||
|
|||||||
@@ -481,6 +481,7 @@ private:
|
|||||||
String _tmp_import_path;
|
String _tmp_import_path;
|
||||||
String external_file;
|
String external_file;
|
||||||
String open_navigate;
|
String open_navigate;
|
||||||
|
String saving_scene;
|
||||||
|
|
||||||
DynamicFontImportSettings *fontdata_import_settings = nullptr;
|
DynamicFontImportSettings *fontdata_import_settings = nullptr;
|
||||||
SceneImportSettings *scene_import_settings = nullptr;
|
SceneImportSettings *scene_import_settings = nullptr;
|
||||||
|
|||||||
Reference in New Issue
Block a user