From 3772e7690dbc8805ce7f4278093b00927f740925 Mon Sep 17 00:00:00 2001 From: Ozelot Vanilla Date: Mon, 2 Jun 2025 22:21:14 +0900 Subject: [PATCH] Fix `ResourceSaver` saving default value --- scene/resources/resource_format_text.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scene/resources/resource_format_text.cpp b/scene/resources/resource_format_text.cpp index 938321449a3..f7754e81d54 100644 --- a/scene/resources/resource_format_text.cpp +++ b/scene/resources/resource_format_text.cpp @@ -34,6 +34,7 @@ #include "core/io/dir_access.h" #include "core/io/missing_resource.h" #include "core/object/script_language.h" +#include "scene/property_utils.h" void ResourceLoaderText::_printerr() { ERR_PRINT(vformat("%s:%d - Parse Error: %s.", res_path, lines, error_text)); @@ -1935,7 +1936,7 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path, const Refget_class(), name); + Variant default_value = PropertyUtils::get_property_default_value(res.ptr(), name); if (default_value.get_type() != Variant::NIL && bool(Variant::evaluate(Variant::OP_EQUAL, value, default_value))) { continue;