From c6c1a49bea38f6de49d81532337a1bfc44b007b9 Mon Sep 17 00:00:00 2001 From: kobewi Date: Thu, 6 Mar 2025 15:04:00 +0100 Subject: [PATCH] Don't edit objects when loading folding --- core/object/object.cpp | 7 +++++-- core/object/object.h | 2 +- editor/editor_folding.cpp | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/core/object/object.cpp b/core/object/object.cpp index 8df107ec696..12d656f90eb 100644 --- a/core/object/object.cpp +++ b/core/object/object.cpp @@ -1654,8 +1654,11 @@ void Object::_clear_internal_resource_paths(const Variant &p_var) { } #ifdef TOOLS_ENABLED -void Object::editor_set_section_unfold(const String &p_section, bool p_unfolded) { - set_edited(true); +void Object::editor_set_section_unfold(const String &p_section, bool p_unfolded, bool p_initializing) { + if (!p_initializing) { + set_edited(true); + } + if (p_unfolded) { editor_section_folding.insert(p_section); } else { diff --git a/core/object/object.h b/core/object/object.h index 16d8e19eaa0..c66f24d05d1 100644 --- a/core/object/object.h +++ b/core/object/object.h @@ -974,7 +974,7 @@ public: #ifdef TOOLS_ENABLED virtual void get_argument_options(const StringName &p_function, int p_idx, List *r_options) const; - void editor_set_section_unfold(const String &p_section, bool p_unfolded); + void editor_set_section_unfold(const String &p_section, bool p_unfolded, bool p_initializing = false); bool editor_is_section_unfolded(const String &p_section); const HashSet &editor_get_section_folding() const { return editor_section_folding; } void editor_clear_section_folding() { editor_section_folding.clear(); } diff --git a/editor/editor_folding.cpp b/editor/editor_folding.cpp index 5cb38fa8751..62f8f53fab6 100644 --- a/editor/editor_folding.cpp +++ b/editor/editor_folding.cpp @@ -65,7 +65,7 @@ void EditorFolding::_set_unfolds(Object *p_object, const Vector &p_unfol const String *r = p_unfolds.ptr(); p_object->editor_clear_section_folding(); for (int i = 0; i < uc; i++) { - p_object->editor_set_section_unfold(r[i], true); + p_object->editor_set_section_unfold(r[i], true, true); } }