diff options
Diffstat (limited to 'modules')
59 files changed, 480 insertions, 455 deletions
diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp index 7c93fbf081..8d2847ab1a 100644 --- a/modules/csg/csg_shape.cpp +++ b/modules/csg/csg_shape.cpp @@ -1824,13 +1824,13 @@ CSGBrush *CSGPolygon3D::_build_brush() { Path3D *current_path = Object::cast_to<Path3D>(get_node_or_null(path_node)); if (path != current_path) { if (path) { - path->disconnect("tree_exited", callable_mp(this, &CSGPolygon3D::_path_exited)); + path->disconnect(SceneStringName(tree_exited), callable_mp(this, &CSGPolygon3D::_path_exited)); path->disconnect("curve_changed", callable_mp(this, &CSGPolygon3D::_path_changed)); path->set_update_callback(Callable()); } path = current_path; if (path) { - path->connect("tree_exited", callable_mp(this, &CSGPolygon3D::_path_exited)); + path->connect(SceneStringName(tree_exited), callable_mp(this, &CSGPolygon3D::_path_exited)); path->connect("curve_changed", callable_mp(this, &CSGPolygon3D::_path_changed)); path->set_update_callback(callable_mp(this, &CSGPolygon3D::_path_changed)); } @@ -2140,7 +2140,7 @@ CSGBrush *CSGPolygon3D::_build_brush() { void CSGPolygon3D::_notification(int p_what) { if (p_what == NOTIFICATION_EXIT_TREE) { if (path) { - path->disconnect("tree_exited", callable_mp(this, &CSGPolygon3D::_path_exited)); + path->disconnect(SceneStringName(tree_exited), callable_mp(this, &CSGPolygon3D::_path_exited)); path->disconnect("curve_changed", callable_mp(this, &CSGPolygon3D::_path_changed)); path = nullptr; } diff --git a/modules/gdscript/editor/gdscript_translation_parser_plugin.cpp b/modules/gdscript/editor/gdscript_translation_parser_plugin.cpp index 316281209a..d74d316704 100644 --- a/modules/gdscript/editor/gdscript_translation_parser_plugin.cpp +++ b/modules/gdscript/editor/gdscript_translation_parser_plugin.cpp @@ -276,8 +276,8 @@ void GDScriptEditorTranslationParserPlugin::_assess_call(const GDScriptParser::C id_ctx_plural.resize(3); bool extract_id_ctx_plural = true; - if (function_name == tr_func) { - // Extract from tr(id, ctx). + if (function_name == tr_func || function_name == atr_func) { + // Extract from `tr(id, ctx)` or `atr(id, ctx)`. for (int i = 0; i < p_call->arguments.size(); i++) { if (_is_constant_string(p_call->arguments[i])) { id_ctx_plural.write[i] = p_call->arguments[i]->reduced_value; @@ -289,8 +289,8 @@ void GDScriptEditorTranslationParserPlugin::_assess_call(const GDScriptParser::C if (extract_id_ctx_plural) { ids_ctx_plural->push_back(id_ctx_plural); } - } else if (function_name == trn_func) { - // Extract from tr_n(id, plural, n, ctx). + } else if (function_name == trn_func || function_name == atrn_func) { + // Extract from `tr_n(id, plural, n, ctx)` or `atr_n(id, plural, n, ctx)`. Vector<int> indices; indices.push_back(0); indices.push_back(3); diff --git a/modules/gdscript/editor/gdscript_translation_parser_plugin.h b/modules/gdscript/editor/gdscript_translation_parser_plugin.h index fe876134c2..61ff81ed66 100644 --- a/modules/gdscript/editor/gdscript_translation_parser_plugin.h +++ b/modules/gdscript/editor/gdscript_translation_parser_plugin.h @@ -45,6 +45,8 @@ class GDScriptEditorTranslationParserPlugin : public EditorTranslationParserPlug // List of patterns used for extracting translation strings. StringName tr_func = "tr"; StringName trn_func = "tr_n"; + StringName atr_func = "atr"; + StringName atrn_func = "atr_n"; HashSet<StringName> assignment_patterns; HashSet<StringName> first_arg_patterns; HashSet<StringName> second_arg_patterns; diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index 19b264d764..de56dd5ece 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -49,11 +49,12 @@ #include "core/config/engine.h" #include "core/config/project_settings.h" #include "core/core_constants.h" -#include "core/core_string_names.h" #include "core/io/file_access.h" #include "core/io/file_access_encrypted.h" #include "core/os/os.h" +#include "scene/scene_string_names.h" + #ifdef TOOLS_ENABLED #include "editor/editor_paths.h" #endif @@ -1995,7 +1996,7 @@ void GDScriptInstance::_call_implicit_ready_recursively(GDScript *p_script) { Variant GDScriptInstance::callp(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) { GDScript *sptr = script.ptr(); - if (unlikely(p_method == SNAME("_ready"))) { + if (unlikely(p_method == SceneStringName(_ready))) { // Call implicit ready first, including for the super classes recursively. _call_implicit_ready_recursively(sptr); } @@ -2038,15 +2039,15 @@ void GDScriptInstance::notification(int p_notification, bool p_reversed) { } String GDScriptInstance::to_string(bool *r_valid) { - if (has_method(CoreStringNames::get_singleton()->_to_string)) { + if (has_method(CoreStringName(_to_string))) { Callable::CallError ce; - Variant ret = callp(CoreStringNames::get_singleton()->_to_string, nullptr, 0, ce); + Variant ret = callp(CoreStringName(_to_string), nullptr, 0, ce); if (ce.error == Callable::CallError::CALL_OK) { if (ret.get_type() != Variant::STRING) { if (r_valid) { *r_valid = false; } - ERR_FAIL_V_MSG(String(), "Wrong type for " + CoreStringNames::get_singleton()->_to_string + ", must be a String."); + ERR_FAIL_V_MSG(String(), "Wrong type for " + CoreStringName(_to_string) + ", must be a String."); } if (r_valid) { *r_valid = true; @@ -2919,7 +2920,7 @@ String ResourceFormatLoaderGDScript::get_resource_type(const String &p_path) con return ""; } -void ResourceFormatLoaderGDScript::get_dependencies(const String &p_path, List<String> *r_dependencies, bool p_add_types) { +void ResourceFormatLoaderGDScript::get_dependencies(const String &p_path, List<String> *p_dependencies, bool p_add_types) { Ref<FileAccess> file = FileAccess::open(p_path, FileAccess::READ); ERR_FAIL_COND_MSG(file.is_null(), "Cannot open file '" + p_path + "'."); @@ -2933,13 +2934,8 @@ void ResourceFormatLoaderGDScript::get_dependencies(const String &p_path, List<S return; } - GDScriptAnalyzer analyzer(&parser); - if (OK != analyzer.analyze()) { - return; - } - for (const String &E : parser.get_dependencies()) { - r_dependencies->push_back(E); + p_dependencies->push_back(E); } } diff --git a/modules/gdscript/gdscript.h b/modules/gdscript/gdscript.h index f63b0da745..728459de44 100644 --- a/modules/gdscript/gdscript.h +++ b/modules/gdscript/gdscript.h @@ -638,7 +638,7 @@ public: virtual void get_recognized_extensions(List<String> *p_extensions) const override; virtual bool handles_type(const String &p_type) const override; virtual String get_resource_type(const String &p_path) const override; - virtual void get_dependencies(const String &p_path, List<String> *r_dependencies, bool p_add_types = false) override; + virtual void get_dependencies(const String &p_path, List<String> *p_dependencies, bool p_add_types = false) override; }; class ResourceFormatSaverGDScript : public ResourceFormatSaver { diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp index 4b6cc47218..a2680c932f 100644 --- a/modules/gdscript/gdscript_analyzer.cpp +++ b/modules/gdscript/gdscript_analyzer.cpp @@ -37,7 +37,6 @@ #include "core/config/engine.h" #include "core/config/project_settings.h" #include "core/core_constants.h" -#include "core/core_string_names.h" #include "core/io/file_access.h" #include "core/io/resource_loader.h" #include "core/object/class_db.h" @@ -231,7 +230,7 @@ bool GDScriptAnalyzer::has_member_name_conflict_in_native_type(const StringName if (ClassDB::has_integer_constant(p_native_type_string, p_member_name)) { return true; } - if (p_member_name == CoreStringNames::get_singleton()->_script) { + if (p_member_name == CoreStringName(script)) { return true; } @@ -562,11 +561,6 @@ Error GDScriptAnalyzer::resolve_class_inheritance(GDScriptParser::ClassNode *p_c class_type.native_type = result.native_type; p_class->set_datatype(class_type); - // Add base class to the list of dependencies. - if (result.kind == GDScriptParser::DataType::CLASS) { - parser->add_dependency(result.script_path); - } - // Apply annotations. for (GDScriptParser::AnnotationNode *&E : p_class->annotations) { resolve_annotation(E); @@ -873,11 +867,6 @@ GDScriptParser::DataType GDScriptAnalyzer::resolve_datatype(GDScriptParser::Type } p_type->set_datatype(result); - - if (result.kind == GDScriptParser::DataType::CLASS || result.kind == GDScriptParser::DataType::SCRIPT) { - parser->add_dependency(result.script_path); - } - return result; } @@ -2172,7 +2161,7 @@ void GDScriptAnalyzer::resolve_for(GDScriptParser::ForNode *p_for) { List<GDScriptParser::DataType> par_types; int default_arg_count = 0; BitField<MethodFlags> method_flags; - if (get_function_signature(p_for->list, false, list_type, CoreStringNames::get_singleton()->_iter_get, return_type, par_types, default_arg_count, method_flags)) { + if (get_function_signature(p_for->list, false, list_type, CoreStringName(_iter_get), return_type, par_types, default_arg_count, method_flags)) { variable_type = return_type; variable_type.type_source = list_type.type_source; } else if (!list_type.is_hard_type()) { @@ -3405,6 +3394,7 @@ void GDScriptAnalyzer::reduce_call(GDScriptParser::CallNode *p_call, bool p_is_a } #ifdef DEBUG_ENABLED + // FIXME: No warning for built-in constructors and utilities due to early return. if (p_is_root && return_type.kind != GDScriptParser::DataType::UNRESOLVED && return_type.builtin_type != Variant::NIL && !(p_call->is_super && p_call->function_name == GDScriptLanguage::get_singleton()->strings._init)) { parser->push_warning(p_call, GDScriptWarning::RETURN_VALUE_DISCARDED, p_call->function_name); @@ -4112,7 +4102,6 @@ void GDScriptAnalyzer::reduce_identifier(GDScriptParser::IdentifierNode *p_ident if (ScriptServer::is_global_class(name)) { p_identifier->set_datatype(make_global_class_meta_type(name, p_identifier)); - parser->add_dependency(p_identifier->get_datatype().script_path); return; } @@ -4155,7 +4144,6 @@ void GDScriptAnalyzer::reduce_identifier(GDScriptParser::IdentifierNode *p_ident } result.is_constant = true; p_identifier->set_datatype(result); - parser->add_dependency(autoload.path); return; } } @@ -4275,6 +4263,7 @@ void GDScriptAnalyzer::reduce_preload(GDScriptParser::PreloadNode *p_preload) { push_error("Preloaded path must be a constant string.", p_preload->path); } else { p_preload->resolved_path = p_preload->path->reduced_value; + // TODO: Save this as script dependency. if (p_preload->resolved_path.is_relative_path()) { p_preload->resolved_path = parser->script_path.get_base_dir().path_join(p_preload->resolved_path); } @@ -4305,8 +4294,6 @@ void GDScriptAnalyzer::reduce_preload(GDScriptParser::PreloadNode *p_preload) { push_error(vformat(R"(Could not preload resource file "%s".)", p_preload->resolved_path), p_preload->path); } } - - parser->add_dependency(p_preload->resolved_path); } } diff --git a/modules/gdscript/gdscript_compiler.cpp b/modules/gdscript/gdscript_compiler.cpp index 01e5751dc8..e62972b949 100644 --- a/modules/gdscript/gdscript_compiler.cpp +++ b/modules/gdscript/gdscript_compiler.cpp @@ -37,7 +37,8 @@ #include "core/config/engine.h" #include "core/config/project_settings.h" -#include "core/core_string_names.h" + +#include "scene/scene_string_names.h" bool GDScriptCompiler::_is_class_member_property(CodeGen &codegen, const StringName &p_name) { if (codegen.function_node && codegen.function_node->is_static) { @@ -346,7 +347,7 @@ GDScriptCodeGenerator::Address GDScriptCompiler::_parse_expression(CodeGen &code scr = scr->_base; } - if (nc && (identifier == CoreStringNames::get_singleton()->_free || ClassDB::has_signal(nc->get_name(), identifier) || ClassDB::has_method(nc->get_name(), identifier))) { + if (nc && (identifier == CoreStringName(free_) || ClassDB::has_signal(nc->get_name(), identifier) || ClassDB::has_method(nc->get_name(), identifier))) { // Get like it was a property. GDScriptCodeGenerator::Address temp = codegen.add_temporary(); // TODO: Get type here. GDScriptCodeGenerator::Address self(GDScriptCodeGenerator::Address::SELF); @@ -2235,7 +2236,7 @@ GDScriptFunction *GDScriptCompiler::_parse_function(Error &r_error, GDScript *p_ return_type = _gdtype_from_datatype(p_func->get_datatype(), p_script); } else { if (p_for_ready) { - func_name = "_ready"; + func_name = SceneStringName(_ready); } else { func_name = "@implicit_new"; } diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index e4640d24a3..9a4c92f601 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -1877,6 +1877,10 @@ GDScriptParser::Node *GDScriptParser::parse_statement() { case Node::CALL: // Fine. break; + case Node::PRELOAD: + // `preload` is a function-like keyword. + push_warning(expression, GDScriptWarning::RETURN_VALUE_DISCARDED, "preload"); + break; case Node::LAMBDA: // Standalone lambdas can't be used, so make this an error. push_error("Standalone lambdas cannot be accessed. Consider assigning it to a variable.", expression); diff --git a/modules/gdscript/gdscript_parser.h b/modules/gdscript/gdscript_parser.h index f2e5007755..96358165c0 100644 --- a/modules/gdscript/gdscript_parser.h +++ b/modules/gdscript/gdscript_parser.h @@ -1432,8 +1432,6 @@ private: void reset_extents(Node *p_node, GDScriptTokenizer::Token p_token); void reset_extents(Node *p_node, Node *p_from); - HashSet<String> dependencies; - template <typename T> T *alloc_node() { T *node = memnew(T); @@ -1578,11 +1576,9 @@ public: bool annotation_exists(const String &p_annotation_name) const; const List<ParserError> &get_errors() const { return errors; } - const HashSet<String> &get_dependencies() const { - return dependencies; - } - void add_dependency(const String &p_dependency) { - dependencies.insert(p_dependency); + const List<String> get_dependencies() const { + // TODO: Keep track of deps. + return List<String>(); } #ifdef DEBUG_ENABLED const List<GDScriptWarning> &get_warnings() const { return warnings; } diff --git a/modules/gdscript/gdscript_vm.cpp b/modules/gdscript/gdscript_vm.cpp index 11bd1d224a..5d1805696d 100644 --- a/modules/gdscript/gdscript_vm.cpp +++ b/modules/gdscript/gdscript_vm.cpp @@ -32,7 +32,6 @@ #include "gdscript_function.h" #include "gdscript_lambda_callable.h" -#include "core/core_string_names.h" #include "core/os/os.h" #ifdef DEBUG_ENABLED @@ -1741,7 +1740,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a if (base_type == Variant::OBJECT) { if (base_obj) { MethodBind *method = ClassDB::get_method(base_class, *methodname); - if (*methodname == CoreStringNames::get_singleton()->_free || (method && !method->has_return())) { + if (*methodname == CoreStringName(free_) || (method && !method->has_return())) { err_text = R"(Trying to get a return value of a method that returns "void")"; OPCODE_BREAK; } @@ -3097,7 +3096,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a const Variant *args[] = { &vref }; Callable::CallError ce; - Variant has_next = obj->callp(CoreStringNames::get_singleton()->_iter_init, args, 1, ce); + Variant has_next = obj->callp(CoreStringName(_iter_init), args, 1, ce); #ifdef DEBUG_ENABLED if (ref.size() != 1 || ce.error != Callable::CallError::CALL_OK) { @@ -3113,7 +3112,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a *counter = ref[0]; GET_VARIANT_PTR(iterator, 2); - *iterator = obj->callp(CoreStringNames::get_singleton()->_iter_get, (const Variant **)&counter, 1, ce); + *iterator = obj->callp(CoreStringName(_iter_get), (const Variant **)&counter, 1, ce); #ifdef DEBUG_ENABLED if (ce.error != Callable::CallError::CALL_OK) { err_text = vformat(R"(There was an error calling "_iter_get" on iterator object of type %s.)", *container); @@ -3431,7 +3430,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a const Variant *args[] = { &vref }; Callable::CallError ce; - Variant has_next = obj->callp(CoreStringNames::get_singleton()->_iter_next, args, 1, ce); + Variant has_next = obj->callp(CoreStringName(_iter_next), args, 1, ce); #ifdef DEBUG_ENABLED if (ref.size() != 1 || ce.error != Callable::CallError::CALL_OK) { @@ -3447,7 +3446,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a *counter = ref[0]; GET_VARIANT_PTR(iterator, 2); - *iterator = obj->callp(CoreStringNames::get_singleton()->_iter_get, (const Variant **)&counter, 1, ce); + *iterator = obj->callp(CoreStringName(_iter_get), (const Variant **)&counter, 1, ce); #ifdef DEBUG_ENABLED if (ce.error != Callable::CallError::CALL_OK) { err_text = vformat(R"(There was an error calling "_iter_get" on iterator object of type %s.)", *container); diff --git a/modules/gdscript/gdscript_warning.cpp b/modules/gdscript/gdscript_warning.cpp index 48a0abe617..611a9ad2d9 100644 --- a/modules/gdscript/gdscript_warning.cpp +++ b/modules/gdscript/gdscript_warning.cpp @@ -74,7 +74,7 @@ String GDScriptWarning::get_message() const { case UNREACHABLE_PATTERN: return "Unreachable pattern (pattern after wildcard or bind)."; case STANDALONE_EXPRESSION: - return "Standalone expression (the line has no effect)."; + return "Standalone expression (the line may have no effect)."; case STANDALONE_TERNARY: return "Standalone ternary operator: the return value is being discarded."; case INCOMPATIBLE_TERNARY: diff --git a/modules/gdscript/tests/gdscript_test_runner.cpp b/modules/gdscript/tests/gdscript_test_runner.cpp index a949c44d78..fbfa4a0a79 100644 --- a/modules/gdscript/tests/gdscript_test_runner.cpp +++ b/modules/gdscript/tests/gdscript_test_runner.cpp @@ -38,7 +38,6 @@ #include "core/config/project_settings.h" #include "core/core_globals.h" -#include "core/core_string_names.h" #include "core/io/dir_access.h" #include "core/io/file_access_pack.h" #include "core/os/os.h" diff --git a/modules/gdscript/tests/scripts/parser/warnings/return_value_discarded.gd b/modules/gdscript/tests/scripts/parser/warnings/return_value_discarded.gd index 00598e4d50..f8f70b8cc3 100644 --- a/modules/gdscript/tests/scripts/parser/warnings/return_value_discarded.gd +++ b/modules/gdscript/tests/scripts/parser/warnings/return_value_discarded.gd @@ -4,3 +4,4 @@ func i_return_int() -> int: func test(): i_return_int() + preload("../../utils.notest.gd") # `preload` is a function-like keyword. diff --git a/modules/gdscript/tests/scripts/parser/warnings/return_value_discarded.out b/modules/gdscript/tests/scripts/parser/warnings/return_value_discarded.out index f2db4e9307..107051df6c 100644 --- a/modules/gdscript/tests/scripts/parser/warnings/return_value_discarded.out +++ b/modules/gdscript/tests/scripts/parser/warnings/return_value_discarded.out @@ -3,3 +3,7 @@ GDTEST_OK >> Line: 6 >> RETURN_VALUE_DISCARDED >> The function "i_return_int()" returns a value that will be discarded if not used. +>> WARNING +>> Line: 7 +>> RETURN_VALUE_DISCARDED +>> The function "preload()" returns a value that will be discarded if not used. diff --git a/modules/gdscript/tests/scripts/parser/warnings/standalone_expression.gd b/modules/gdscript/tests/scripts/parser/warnings/standalone_expression.gd index dc4223ec2d..74f42b012b 100644 --- a/modules/gdscript/tests/scripts/parser/warnings/standalone_expression.gd +++ b/modules/gdscript/tests/scripts/parser/warnings/standalone_expression.gd @@ -6,3 +6,16 @@ func test(): Vector3.ZERO [true, false] float(125) + # The following statements should not produce `STANDALONE_EXPRESSION`: + var _a = 1 + _a = 2 # Assignment is a local (or global) side effect. + @warning_ignore("redundant_await") + await 3 # The `await` operand is usually a coroutine or a signal. + absi(4) # A call (in general) can have side effects. + @warning_ignore("return_value_discarded") + preload("../../utils.notest.gd") # A static initializer may have side effects. + """ + Python-like "comment". + """ + @warning_ignore("standalone_ternary") + 1 if 2 else 3 # Produces `STANDALONE_TERNARY` instead. diff --git a/modules/gdscript/tests/scripts/parser/warnings/standalone_expression.out b/modules/gdscript/tests/scripts/parser/warnings/standalone_expression.out index a2c67a6e51..72c659c952 100644 --- a/modules/gdscript/tests/scripts/parser/warnings/standalone_expression.out +++ b/modules/gdscript/tests/scripts/parser/warnings/standalone_expression.out @@ -2,16 +2,16 @@ GDTEST_OK >> WARNING >> Line: 3 >> STANDALONE_EXPRESSION ->> Standalone expression (the line has no effect). +>> Standalone expression (the line may have no effect). >> WARNING >> Line: 4 >> STANDALONE_EXPRESSION ->> Standalone expression (the line has no effect). +>> Standalone expression (the line may have no effect). >> WARNING >> Line: 6 >> STANDALONE_EXPRESSION ->> Standalone expression (the line has no effect). +>> Standalone expression (the line may have no effect). >> WARNING >> Line: 7 >> STANDALONE_EXPRESSION ->> Standalone expression (the line has no effect). +>> Standalone expression (the line may have no effect). diff --git a/modules/gltf/editor/editor_scene_exporter_gltf_settings.cpp b/modules/gltf/editor/editor_scene_exporter_gltf_settings.cpp index fc184c9342..16f32af903 100644 --- a/modules/gltf/editor/editor_scene_exporter_gltf_settings.cpp +++ b/modules/gltf/editor/editor_scene_exporter_gltf_settings.cpp @@ -39,7 +39,7 @@ bool EditorSceneExporterGLTFSettings::_set(const StringName &p_name, const Varia } if (p_name == StringName("image_format")) { _document->set_image_format(p_value); - emit_signal("property_list_changed"); + emit_signal(CoreStringName(property_list_changed)); return true; } if (p_name == StringName("lossy_quality")) { @@ -86,7 +86,7 @@ void EditorSceneExporterGLTFSettings::_get_property_list(List<PropertyInfo> *p_l void EditorSceneExporterGLTFSettings::_on_extension_property_list_changed() { generate_property_list(_document); - emit_signal("property_list_changed"); + emit_signal(CoreStringName(property_list_changed)); } bool EditorSceneExporterGLTFSettings::_set_extension_setting(const String &p_name_str, const Variant &p_value) { @@ -136,8 +136,8 @@ void EditorSceneExporterGLTFSettings::generate_property_list(Ref<GLTFDocument> p // Add properties from all document extensions. for (Ref<GLTFDocumentExtension> &extension : GLTFDocument::get_all_gltf_document_extensions()) { const Callable on_prop_changed = callable_mp(this, &EditorSceneExporterGLTFSettings::_on_extension_property_list_changed); - if (!extension->is_connected("property_list_changed", on_prop_changed)) { - extension->connect("property_list_changed", on_prop_changed); + if (!extension->is_connected(CoreStringName(property_list_changed), on_prop_changed)) { + extension->connect(CoreStringName(property_list_changed), on_prop_changed); } const String config_prefix = get_friendly_config_prefix(extension); _config_name_to_extension_map[config_prefix] = extension; diff --git a/modules/gltf/editor/editor_scene_importer_blend.cpp b/modules/gltf/editor/editor_scene_importer_blend.cpp index 42c3ecc7cb..ccf347e03e 100644 --- a/modules/gltf/editor/editor_scene_importer_blend.cpp +++ b/modules/gltf/editor/editor_scene_importer_blend.cpp @@ -493,7 +493,7 @@ bool EditorFileSystemImportFormatSupportQueryBlend::query() { blender_path_browse = memnew(Button); blender_path_browse->set_text(TTR("Browse")); - blender_path_browse->connect("pressed", callable_mp(this, &EditorFileSystemImportFormatSupportQueryBlend::_browse_install)); + blender_path_browse->connect(SceneStringName(pressed), callable_mp(this, &EditorFileSystemImportFormatSupportQueryBlend::_browse_install)); hb->add_child(blender_path_browse); hb->set_h_size_flags(Control::SIZE_EXPAND_FILL); diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp index 575702bc54..b92176a63a 100644 --- a/modules/gltf/gltf_document.cpp +++ b/modules/gltf/gltf_document.cpp @@ -105,10 +105,6 @@ static Ref<ImporterMesh> _mesh_to_importer_mesh(Ref<Mesh> p_mesh) { } Error GLTFDocument::_serialize(Ref<GLTFState> p_state) { - if (!p_state->buffers.size()) { - p_state->buffers.push_back(Vector<uint8_t>()); - } - for (Ref<GLTFDocumentExtension> ext : document_extensions) { ERR_CONTINUE(ext.is_null()); Error err = ext->export_preserialize(p_state); @@ -243,7 +239,6 @@ Error GLTFDocument::_serialize_gltf_extensions(Ref<GLTFState> p_state) const { } Error GLTFDocument::_serialize_scenes(Ref<GLTFState> p_state) { - ERR_FAIL_COND_V_MSG(p_state->root_nodes.is_empty(), ERR_INVALID_DATA, "GLTF export: The scene must have at least one root node."); // Godot only supports one scene per glTF file. Array scenes; Dictionary scene_dict; @@ -251,7 +246,9 @@ Error GLTFDocument::_serialize_scenes(Ref<GLTFState> p_state) { p_state->json["scenes"] = scenes; p_state->json["scene"] = 0; // Add nodes to the scene dict. - scene_dict["nodes"] = p_state->root_nodes; + if (!p_state->root_nodes.is_empty()) { + scene_dict["nodes"] = p_state->root_nodes; + } if (!p_state->scene_name.is_empty()) { scene_dict["name"] = p_state->scene_name; } @@ -458,9 +455,15 @@ Error GLTFDocument::_serialize_nodes(Ref<GLTFState> p_state) { ERR_CONTINUE(err != OK); } + if (extensions.is_empty()) { + node.erase("extensions"); + } + nodes.push_back(node); } - p_state->json["nodes"] = nodes; + if (!nodes.is_empty()) { + p_state->json["nodes"] = nodes; + } return OK; } @@ -691,11 +694,11 @@ static Vector<uint8_t> _parse_base64_uri(const String &p_uri) { Error GLTFDocument::_encode_buffer_glb(Ref<GLTFState> p_state, const String &p_path) { print_verbose("glTF: Total buffers: " + itos(p_state->buffers.size())); - if (!p_state->buffers.size()) { + if (p_state->buffers.is_empty()) { return OK; } Array buffers; - if (p_state->buffers.size()) { + if (!p_state->buffers.is_empty()) { Vector<uint8_t> buffer_data = p_state->buffers[0]; Dictionary gltf_buffer; @@ -730,7 +733,7 @@ Error GLTFDocument::_encode_buffer_glb(Ref<GLTFState> p_state, const String &p_p Error GLTFDocument::_encode_buffer_bins(Ref<GLTFState> p_state, const String &p_path) { print_verbose("glTF: Total buffers: " + itos(p_state->buffers.size())); - if (!p_state->buffers.size()) { + if (p_state->buffers.is_empty()) { return OK; } Array buffers; @@ -1543,6 +1546,9 @@ GLTFAccessorIndex GLTFDocument::_encode_accessor_as_ints(Ref<GLTFState> p_state, Ref<GLTFAccessor> accessor; accessor.instantiate(); GLTFBufferIndex buffer_view_i; + if (p_state->buffers.is_empty()) { + p_state->buffers.push_back(Vector<uint8_t>()); + } int64_t size = p_state->buffers[0].size(); const GLTFType type = GLTFType::TYPE_SCALAR; int component_type; @@ -1654,6 +1660,9 @@ GLTFAccessorIndex GLTFDocument::_encode_accessor_as_vec2(Ref<GLTFState> p_state, Ref<GLTFAccessor> accessor; accessor.instantiate(); GLTFBufferIndex buffer_view_i; + if (p_state->buffers.is_empty()) { + p_state->buffers.push_back(Vector<uint8_t>()); + } int64_t size = p_state->buffers[0].size(); const GLTFType type = GLTFType::TYPE_VEC2; const int component_type = GLTFDocument::COMPONENT_TYPE_FLOAT; @@ -1704,6 +1713,9 @@ GLTFAccessorIndex GLTFDocument::_encode_accessor_as_color(Ref<GLTFState> p_state Ref<GLTFAccessor> accessor; accessor.instantiate(); GLTFBufferIndex buffer_view_i; + if (p_state->buffers.is_empty()) { + p_state->buffers.push_back(Vector<uint8_t>()); + } int64_t size = p_state->buffers[0].size(); const GLTFType type = GLTFType::TYPE_VEC4; const int component_type = GLTFDocument::COMPONENT_TYPE_FLOAT; @@ -1768,6 +1780,9 @@ GLTFAccessorIndex GLTFDocument::_encode_accessor_as_weights(Ref<GLTFState> p_sta Ref<GLTFAccessor> accessor; accessor.instantiate(); GLTFBufferIndex buffer_view_i; + if (p_state->buffers.is_empty()) { + p_state->buffers.push_back(Vector<uint8_t>()); + } int64_t size = p_state->buffers[0].size(); const GLTFType type = GLTFType::TYPE_VEC4; const int component_type = GLTFDocument::COMPONENT_TYPE_FLOAT; @@ -1816,6 +1831,9 @@ GLTFAccessorIndex GLTFDocument::_encode_accessor_as_joints(Ref<GLTFState> p_stat Ref<GLTFAccessor> accessor; accessor.instantiate(); GLTFBufferIndex buffer_view_i; + if (p_state->buffers.is_empty()) { + p_state->buffers.push_back(Vector<uint8_t>()); + } int64_t size = p_state->buffers[0].size(); const GLTFType type = GLTFType::TYPE_VEC4; const int component_type = GLTFDocument::COMPONENT_TYPE_UNSIGNED_SHORT; @@ -1866,6 +1884,9 @@ GLTFAccessorIndex GLTFDocument::_encode_accessor_as_quaternions(Ref<GLTFState> p Ref<GLTFAccessor> accessor; accessor.instantiate(); GLTFBufferIndex buffer_view_i; + if (p_state->buffers.is_empty()) { + p_state->buffers.push_back(Vector<uint8_t>()); + } int64_t size = p_state->buffers[0].size(); const GLTFType type = GLTFType::TYPE_VEC4; const int component_type = GLTFDocument::COMPONENT_TYPE_FLOAT; @@ -1938,6 +1959,9 @@ GLTFAccessorIndex GLTFDocument::_encode_accessor_as_floats(Ref<GLTFState> p_stat Ref<GLTFAccessor> accessor; accessor.instantiate(); GLTFBufferIndex buffer_view_i; + if (p_state->buffers.is_empty()) { + p_state->buffers.push_back(Vector<uint8_t>()); + } int64_t size = p_state->buffers[0].size(); const GLTFType type = GLTFType::TYPE_SCALAR; const int component_type = GLTFDocument::COMPONENT_TYPE_FLOAT; @@ -1985,6 +2009,9 @@ GLTFAccessorIndex GLTFDocument::_encode_accessor_as_vec3(Ref<GLTFState> p_state, Ref<GLTFAccessor> accessor; accessor.instantiate(); GLTFBufferIndex buffer_view_i; + if (p_state->buffers.is_empty()) { + p_state->buffers.push_back(Vector<uint8_t>()); + } int64_t size = p_state->buffers[0].size(); const GLTFType type = GLTFType::TYPE_VEC3; const int component_type = GLTFDocument::COMPONENT_TYPE_FLOAT; @@ -2058,6 +2085,9 @@ GLTFAccessorIndex GLTFDocument::_encode_sparse_accessor_as_vec3(Ref<GLTFState> p Ref<GLTFAccessor> sparse_accessor; sparse_accessor.instantiate(); + if (p_state->buffers.is_empty()) { + p_state->buffers.push_back(Vector<uint8_t>()); + } int64_t size = p_state->buffers[0].size(); const GLTFType type = GLTFType::TYPE_VEC3; const int component_type = GLTFDocument::COMPONENT_TYPE_FLOAT; @@ -2160,6 +2190,9 @@ GLTFAccessorIndex GLTFDocument::_encode_accessor_as_xform(Ref<GLTFState> p_state Ref<GLTFAccessor> accessor; accessor.instantiate(); GLTFBufferIndex buffer_view_i; + if (p_state->buffers.is_empty()) { + p_state->buffers.push_back(Vector<uint8_t>()); + } int64_t size = p_state->buffers[0].size(); const GLTFType type = GLTFType::TYPE_MAT4; const int component_type = GLTFDocument::COMPONENT_TYPE_FLOAT; @@ -6944,7 +6977,7 @@ Error GLTFDocument::_serialize_file(Ref<GLTFState> p_state, const String p_path) const uint32_t text_chunk_type = 0x4E4F534A; //JSON uint32_t binary_data_length = 0; - if (p_state->buffers.size()) { + if (p_state->buffers.size() > 0) { binary_data_length = p_state->buffers[0].size(); } const uint32_t binary_chunk_length = ((binary_data_length + 3) & (~3)); @@ -6953,20 +6986,28 @@ Error GLTFDocument::_serialize_file(Ref<GLTFState> p_state, const String p_path) file->create(FileAccess::ACCESS_RESOURCES); file->store_32(magic); file->store_32(p_state->major_version); // version - file->store_32(header_size + chunk_header_size + text_chunk_length + chunk_header_size + binary_chunk_length); // length + uint32_t total_length = header_size + chunk_header_size + text_chunk_length; + if (binary_chunk_length) { + total_length += chunk_header_size + binary_chunk_length; + } + file->store_32(total_length); + + // Write the JSON text chunk. file->store_32(text_chunk_length); file->store_32(text_chunk_type); file->store_buffer((uint8_t *)&cs[0], cs.length()); for (uint32_t pad_i = text_data_length; pad_i < text_chunk_length; pad_i++) { file->store_8(' '); } + + // Write a single binary chunk. if (binary_chunk_length) { file->store_32(binary_chunk_length); file->store_32(binary_chunk_type); file->store_buffer(p_state->buffers[0].ptr(), binary_data_length); - } - for (uint32_t pad_i = binary_data_length; pad_i < binary_chunk_length; pad_i++) { - file->store_8(0); + for (uint32_t pad_i = binary_data_length; pad_i < binary_chunk_length; pad_i++) { + file->store_8(0); + } } } else { err = _encode_buffer_bins(p_state, p_path); @@ -7073,7 +7114,7 @@ PackedByteArray GLTFDocument::_serialize_glb_buffer(Ref<GLTFState> p_state, Erro const uint32_t text_chunk_type = 0x4E4F534A; //JSON int32_t binary_data_length = 0; - if (p_state->buffers.size()) { + if (p_state->buffers.size() > 0) { binary_data_length = p_state->buffers[0].size(); } const int32_t binary_chunk_length = binary_data_length; diff --git a/modules/gridmap/doc_classes/GridMap.xml b/modules/gridmap/doc_classes/GridMap.xml index ef7276f493..cf13068efa 100644 --- a/modules/gridmap/doc_classes/GridMap.xml +++ b/modules/gridmap/doc_classes/GridMap.xml @@ -135,7 +135,7 @@ <return type="Vector3" /> <param index="0" name="map_position" type="Vector3i" /> <description> - Returns the position of a grid cell in the GridMap's local coordinate space. To convert the returned value into global coordinates, use [method Node3D.to_global]. See also [method map_to_local]. + Returns the position of a grid cell in the GridMap's local coordinate space. To convert the returned value into global coordinates, use [method Node3D.to_global]. See also [method local_to_map]. </description> </method> <method name="resource_changed" deprecated="Use [signal Resource.changed] instead."> diff --git a/modules/gridmap/editor/grid_map_editor_plugin.cpp b/modules/gridmap/editor/grid_map_editor_plugin.cpp index d53bf7f7ec..27c74421db 100644 --- a/modules/gridmap/editor/grid_map_editor_plugin.cpp +++ b/modules/gridmap/editor/grid_map_editor_plugin.cpp @@ -32,7 +32,6 @@ #ifdef TOOLS_ENABLED -#include "core/core_string_names.h" #include "core/input/input.h" #include "core/os/keyboard.h" #include "editor/editor_node.h" @@ -949,7 +948,7 @@ void GridMapEditor::_update_mesh_library() { void GridMapEditor::edit(GridMap *p_gridmap) { if (node) { node->disconnect(SNAME("cell_size_changed"), callable_mp(this, &GridMapEditor::_draw_grids)); - node->disconnect(CoreStringNames::get_singleton()->changed, callable_mp(this, &GridMapEditor::_update_mesh_library)); + node->disconnect(CoreStringName(changed), callable_mp(this, &GridMapEditor::_update_mesh_library)); if (mesh_library.is_valid()) { mesh_library->disconnect_changed(callable_mp(this, &GridMapEditor::update_palette)); mesh_library = Ref<MeshLibrary>(); @@ -987,7 +986,7 @@ void GridMapEditor::edit(GridMap *p_gridmap) { update_grid(); node->connect(SNAME("cell_size_changed"), callable_mp(this, &GridMapEditor::_draw_grids)); - node->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &GridMapEditor::_update_mesh_library)); + node->connect(CoreStringName(changed), callable_mp(this, &GridMapEditor::_update_mesh_library)); _update_mesh_library(); } @@ -1225,8 +1224,8 @@ GridMapEditor::GridMapEditor() { spatial_editor_hb->add_child(floor); floor->connect("value_changed", callable_mp(this, &GridMapEditor::_floor_changed)); - floor->connect("mouse_exited", callable_mp(this, &GridMapEditor::_floor_mouse_exited)); - floor->get_line_edit()->connect("mouse_exited", callable_mp(this, &GridMapEditor::_floor_mouse_exited)); + floor->connect(SceneStringName(mouse_exited), callable_mp(this, &GridMapEditor::_floor_mouse_exited)); + floor->get_line_edit()->connect(SceneStringName(mouse_exited), callable_mp(this, &GridMapEditor::_floor_mouse_exited)); spatial_editor_hb->add_child(memnew(VSeparator)); @@ -1288,21 +1287,21 @@ GridMapEditor::GridMapEditor() { search_box->set_clear_button_enabled(true); hb->add_child(search_box); search_box->connect("text_changed", callable_mp(this, &GridMapEditor::_text_changed)); - search_box->connect("gui_input", callable_mp(this, &GridMapEditor::_sbox_input)); + search_box->connect(SceneStringName(gui_input), callable_mp(this, &GridMapEditor::_sbox_input)); mode_thumbnail = memnew(Button); mode_thumbnail->set_theme_type_variation("FlatButton"); mode_thumbnail->set_toggle_mode(true); mode_thumbnail->set_pressed(true); hb->add_child(mode_thumbnail); - mode_thumbnail->connect("pressed", callable_mp(this, &GridMapEditor::_set_display_mode).bind(DISPLAY_THUMBNAIL)); + mode_thumbnail->connect(SceneStringName(pressed), callable_mp(this, &GridMapEditor::_set_display_mode).bind(DISPLAY_THUMBNAIL)); mode_list = memnew(Button); mode_list->set_theme_type_variation("FlatButton"); mode_list->set_toggle_mode(true); mode_list->set_pressed(false); hb->add_child(mode_list); - mode_list->connect("pressed", callable_mp(this, &GridMapEditor::_set_display_mode).bind(DISPLAY_LIST)); + mode_list->connect(SceneStringName(pressed), callable_mp(this, &GridMapEditor::_set_display_mode).bind(DISPLAY_LIST)); size_slider = memnew(HSlider); size_slider->set_h_size_flags(SIZE_EXPAND_FILL); @@ -1319,7 +1318,7 @@ GridMapEditor::GridMapEditor() { mesh_library_palette->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); add_child(mesh_library_palette); mesh_library_palette->set_v_size_flags(SIZE_EXPAND_FILL); - mesh_library_palette->connect("gui_input", callable_mp(this, &GridMapEditor::_mesh_library_palette_input)); + mesh_library_palette->connect(SceneStringName(gui_input), callable_mp(this, &GridMapEditor::_mesh_library_palette_input)); info_message = memnew(Label); info_message->set_text(TTR("Give a MeshLibrary resource to this GridMap to use its meshes.")); diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp index 25519c6e3c..71171be3f1 100644 --- a/modules/gridmap/grid_map.cpp +++ b/modules/gridmap/grid_map.cpp @@ -30,14 +30,12 @@ #include "grid_map.h" -#include "core/core_string_names.h" #include "core/io/marshalls.h" #include "scene/3d/light_3d.h" #include "scene/resources/3d/mesh_library.h" #include "scene/resources/3d/primitive_meshes.h" #include "scene/resources/physics_material.h" #include "scene/resources/surface_tool.h" -#include "scene/scene_string_names.h" #include "servers/navigation_server_3d.h" #include "servers/rendering_server.h" @@ -266,7 +264,7 @@ void GridMap::set_mesh_library(const Ref<MeshLibrary> &p_mesh_library) { } _recreate_octant_data(); - emit_signal(CoreStringNames::get_singleton()->changed); + emit_signal(CoreStringName(changed)); } Ref<MeshLibrary> GridMap::get_mesh_library() const { @@ -1136,7 +1134,7 @@ void GridMap::_bind_methods() { BIND_CONSTANT(INVALID_CELL_ITEM); ADD_SIGNAL(MethodInfo("cell_size_changed", PropertyInfo(Variant::VECTOR3, "cell_size"))); - ADD_SIGNAL(MethodInfo(CoreStringNames::get_singleton()->changed)); + ADD_SIGNAL(MethodInfo(CoreStringName(changed))); } void GridMap::set_cell_scale(float p_scale) { diff --git a/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp b/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp index 9b51221df6..cd3814879a 100644 --- a/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp +++ b/modules/interactive_music/editor/audio_stream_interactive_editor_plugin.cpp @@ -250,8 +250,8 @@ void AudioStreamInteractiveTransitionEditor::edit(Object *p_obj) { return; } - Ref<Font> header_font = get_theme_font("bold", "EditorFonts"); - int header_font_size = get_theme_font_size("bold_size", "EditorFonts"); + Ref<Font> header_font = get_theme_font("bold", EditorStringName(EditorFonts)); + int header_font_size = get_theme_font_size("bold_size", EditorStringName(EditorFonts)); tree->clear(); rows.clear(); @@ -342,7 +342,7 @@ AudioStreamInteractiveTransitionEditor::AudioStreamInteractiveTransitionEditor() transition_enabled = memnew(CheckBox); transition_enabled->set_text(TTR("Enabled")); edit_vb->add_margin_child(TTR("Use Transition:"), transition_enabled); - transition_enabled->connect("pressed", callable_mp(this, &AudioStreamInteractiveTransitionEditor::_edited)); + transition_enabled->connect(SceneStringName(pressed), callable_mp(this, &AudioStreamInteractiveTransitionEditor::_edited)); transition_from = memnew(OptionButton); edit_vb->add_margin_child(TTR("Transition From:"), transition_from); @@ -377,7 +377,7 @@ AudioStreamInteractiveTransitionEditor::AudioStreamInteractiveTransitionEditor() hold_previous = memnew(CheckBox); hold_previous->set_text(TTR("Enabled")); - hold_previous->connect("pressed", callable_mp(this, &AudioStreamInteractiveTransitionEditor::_edited)); + hold_previous->connect(SceneStringName(pressed), callable_mp(this, &AudioStreamInteractiveTransitionEditor::_edited)); edit_vb->add_margin_child(TTR("Hold Previous:"), hold_previous); set_exclusive(true); @@ -397,7 +397,7 @@ void EditorInspectorPluginAudioStreamInteractive::parse_end(Object *p_object) { if (Object::cast_to<AudioStreamInteractive>(p_object)) { Button *button = EditorInspector::create_inspector_action_button(TTR("Edit Transitions")); button->set_icon(audio_stream_interactive_transition_editor->get_editor_theme_icon(SNAME("Blend"))); - button->connect("pressed", callable_mp(this, &EditorInspectorPluginAudioStreamInteractive::_edit).bind(p_object)); + button->connect(SceneStringName(pressed), callable_mp(this, &EditorInspectorPluginAudioStreamInteractive::_edit).bind(p_object)); add_custom_control(button); } } diff --git a/modules/lightmapper_rd/lightmapper_rd.cpp b/modules/lightmapper_rd/lightmapper_rd.cpp index 835fb3e59d..7ac7bd8088 100644 --- a/modules/lightmapper_rd/lightmapper_rd.cpp +++ b/modules/lightmapper_rd/lightmapper_rd.cpp @@ -226,7 +226,7 @@ void LightmapperRD::_sort_triangle_clusters(uint32_t p_cluster_size, uint32_t p_ } } -Lightmapper::BakeError LightmapperRD::_blit_meshes_into_atlas(int p_max_texture_size, Vector<Ref<Image>> &albedo_images, Vector<Ref<Image>> &emission_images, AABB &bounds, Size2i &atlas_size, int &atlas_slices, BakeStepFunc p_step_function, void *p_bake_userdata) { +Lightmapper::BakeError LightmapperRD::_blit_meshes_into_atlas(int p_max_texture_size, int p_denoiser_range, Vector<Ref<Image>> &albedo_images, Vector<Ref<Image>> &emission_images, AABB &bounds, Size2i &atlas_size, int &atlas_slices, BakeStepFunc p_step_function, void *p_bake_userdata) { Vector<Size2i> sizes; for (int m_i = 0; m_i < mesh_instances.size(); m_i++) { @@ -261,7 +261,7 @@ Lightmapper::BakeError LightmapperRD::_blit_meshes_into_atlas(int p_max_texture_ source_sizes.resize(sizes.size()); source_indices.resize(sizes.size()); for (int i = 0; i < source_indices.size(); i++) { - source_sizes.write[i] = sizes[i] + Vector2i(2, 2); // Add padding between lightmaps + source_sizes.write[i] = sizes[i] + Vector2i(2, 2).maxi(p_denoiser_range); // Add padding between lightmaps source_indices.write[i] = i; } Vector<Vector3i> atlas_offsets; @@ -428,6 +428,7 @@ void LightmapperRD::_create_acceleration_structures(RenderingDevice *rd, Size2i SWAP(edge.a, edge.b); SWAP(edge.na, edge.nb); SWAP(uv2.a, uv2.b); + SWAP(uv2.indices.x, uv2.indices.y); SWAP(edge_indices.x, edge_indices.y); } @@ -906,7 +907,7 @@ LightmapperRD::BakeError LightmapperRD::_denoise_oidn(RenderingDevice *p_rd, RID return BAKE_OK; } -LightmapperRD::BakeError LightmapperRD::_denoise(RenderingDevice *p_rd, Ref<RDShaderFile> &p_compute_shader, const RID &p_compute_base_uniform_set, PushConstant &p_push_constant, RID p_source_light_tex, RID p_source_normal_tex, RID p_dest_light_tex, float p_denoiser_strength, const Size2i &p_atlas_size, int p_atlas_slices, bool p_bake_sh, BakeStepFunc p_step_function) { +LightmapperRD::BakeError LightmapperRD::_denoise(RenderingDevice *p_rd, Ref<RDShaderFile> &p_compute_shader, const RID &p_compute_base_uniform_set, PushConstant &p_push_constant, RID p_source_light_tex, RID p_source_normal_tex, RID p_dest_light_tex, float p_denoiser_strength, int p_denoiser_range, const Size2i &p_atlas_size, int p_atlas_slices, bool p_bake_sh, BakeStepFunc p_step_function) { RID denoise_params_buffer = p_rd->uniform_buffer_create(sizeof(DenoiseParams)); DenoiseParams denoise_params; denoise_params.spatial_bandwidth = 5.0f; @@ -914,6 +915,7 @@ LightmapperRD::BakeError LightmapperRD::_denoise(RenderingDevice *p_rd, Ref<RDSh denoise_params.albedo_bandwidth = 1.0f; denoise_params.normal_bandwidth = 0.1f; denoise_params.filter_strength = 10.0f; + denoise_params.half_search_window = p_denoiser_range; p_rd->buffer_update(denoise_params_buffer, 0, sizeof(DenoiseParams), &denoise_params); Vector<RD::Uniform> uniforms = dilate_or_denoise_common_uniforms(p_source_light_tex, p_dest_light_tex); @@ -976,7 +978,7 @@ LightmapperRD::BakeError LightmapperRD::_denoise(RenderingDevice *p_rd, Ref<RDSh return BAKE_OK; } -LightmapperRD::BakeError LightmapperRD::bake(BakeQuality p_quality, bool p_use_denoiser, float p_denoiser_strength, int p_bounces, float p_bounce_indirect_energy, float p_bias, int p_max_texture_size, bool p_bake_sh, bool p_texture_for_bounces, GenerateProbes p_generate_probes, const Ref<Image> &p_environment_panorama, const Basis &p_environment_transform, BakeStepFunc p_step_function, void *p_bake_userdata, float p_exposure_normalization) { +LightmapperRD::BakeError LightmapperRD::bake(BakeQuality p_quality, bool p_use_denoiser, float p_denoiser_strength, int p_denoiser_range, int p_bounces, float p_bounce_indirect_energy, float p_bias, int p_max_texture_size, bool p_bake_sh, bool p_texture_for_bounces, GenerateProbes p_generate_probes, const Ref<Image> &p_environment_panorama, const Basis &p_environment_transform, BakeStepFunc p_step_function, void *p_bake_userdata, float p_exposure_normalization) { int denoiser = GLOBAL_GET("rendering/lightmapping/denoising/denoiser"); String oidn_path = EDITOR_GET("filesystem/tools/oidn/oidn_denoise_path"); @@ -1008,7 +1010,7 @@ LightmapperRD::BakeError LightmapperRD::bake(BakeQuality p_quality, bool p_use_d Vector<Ref<Image>> albedo_images; Vector<Ref<Image>> emission_images; - BakeError bake_error = _blit_meshes_into_atlas(p_max_texture_size, albedo_images, emission_images, bounds, atlas_size, atlas_slices, p_step_function, p_bake_userdata); + BakeError bake_error = _blit_meshes_into_atlas(p_max_texture_size, p_denoiser_range, albedo_images, emission_images, bounds, atlas_size, atlas_slices, p_step_function, p_bake_userdata); if (bake_error != BAKE_OK) { return bake_error; } @@ -1793,7 +1795,7 @@ LightmapperRD::BakeError LightmapperRD::bake(BakeQuality p_quality, bool p_use_d } else { // JNLM (built-in). SWAP(light_accum_tex, light_accum_tex2); - error = _denoise(rd, compute_shader, compute_base_uniform_set, push_constant, light_accum_tex2, normal_tex, light_accum_tex, p_denoiser_strength, atlas_size, atlas_slices, p_bake_sh, p_step_function); + error = _denoise(rd, compute_shader, compute_base_uniform_set, push_constant, light_accum_tex2, normal_tex, light_accum_tex, p_denoiser_strength, p_denoiser_range, atlas_size, atlas_slices, p_bake_sh, p_step_function); } if (unlikely(error != BAKE_OK)) { return error; diff --git a/modules/lightmapper_rd/lightmapper_rd.h b/modules/lightmapper_rd/lightmapper_rd.h index 5414048ddc..487c44a480 100644 --- a/modules/lightmapper_rd/lightmapper_rd.h +++ b/modules/lightmapper_rd/lightmapper_rd.h @@ -262,16 +262,17 @@ class LightmapperRD : public Lightmapper { float albedo_bandwidth; float normal_bandwidth; + int half_search_window; float filter_strength; - float pad[3]; + float pad[2]; }; - BakeError _blit_meshes_into_atlas(int p_max_texture_size, Vector<Ref<Image>> &albedo_images, Vector<Ref<Image>> &emission_images, AABB &bounds, Size2i &atlas_size, int &atlas_slices, BakeStepFunc p_step_function, void *p_bake_userdata); + BakeError _blit_meshes_into_atlas(int p_max_texture_size, int p_denoiser_range, Vector<Ref<Image>> &albedo_images, Vector<Ref<Image>> &emission_images, AABB &bounds, Size2i &atlas_size, int &atlas_slices, BakeStepFunc p_step_function, void *p_bake_userdata); void _create_acceleration_structures(RenderingDevice *rd, Size2i atlas_size, int atlas_slices, AABB &bounds, int grid_size, uint32_t p_cluster_size, Vector<Probe> &probe_positions, GenerateProbes p_generate_probes, Vector<int> &slice_triangle_count, Vector<int> &slice_seam_count, RID &vertex_buffer, RID &triangle_buffer, RID &lights_buffer, RID &r_triangle_indices_buffer, RID &r_cluster_indices_buffer, RID &r_cluster_aabbs_buffer, RID &probe_positions_buffer, RID &grid_texture, RID &seams_buffer, BakeStepFunc p_step_function, void *p_bake_userdata); void _raster_geometry(RenderingDevice *rd, Size2i atlas_size, int atlas_slices, int grid_size, AABB bounds, float p_bias, Vector<int> slice_triangle_count, RID position_tex, RID unocclude_tex, RID normal_tex, RID raster_depth_buffer, RID rasterize_shader, RID raster_base_uniform); BakeError _dilate(RenderingDevice *rd, Ref<RDShaderFile> &compute_shader, RID &compute_base_uniform_set, PushConstant &push_constant, RID &source_light_tex, RID &dest_light_tex, const Size2i &atlas_size, int atlas_slices); - BakeError _denoise(RenderingDevice *p_rd, Ref<RDShaderFile> &p_compute_shader, const RID &p_compute_base_uniform_set, PushConstant &p_push_constant, RID p_source_light_tex, RID p_source_normal_tex, RID p_dest_light_tex, float p_denoiser_strength, const Size2i &p_atlas_size, int p_atlas_slices, bool p_bake_sh, BakeStepFunc p_step_function); + BakeError _denoise(RenderingDevice *p_rd, Ref<RDShaderFile> &p_compute_shader, const RID &p_compute_base_uniform_set, PushConstant &p_push_constant, RID p_source_light_tex, RID p_source_normal_tex, RID p_dest_light_tex, float p_denoiser_strength, int p_denoiser_range, const Size2i &p_atlas_size, int p_atlas_slices, bool p_bake_sh, BakeStepFunc p_step_function); Error _store_pfm(RenderingDevice *p_rd, RID p_atlas_tex, int p_index, const Size2i &p_atlas_size, const String &p_name); Ref<Image> _read_pfm(const String &p_name); @@ -283,7 +284,7 @@ public: virtual void add_omni_light(bool p_static, const Vector3 &p_position, const Color &p_color, float p_energy, float p_indirect_energy, float p_range, float p_attenuation, float p_size, float p_shadow_blur) override; virtual void add_spot_light(bool p_static, const Vector3 &p_position, const Vector3 p_direction, const Color &p_color, float p_energy, float p_indirect_energy, float p_range, float p_attenuation, float p_spot_angle, float p_spot_attenuation, float p_size, float p_shadow_blur) override; virtual void add_probe(const Vector3 &p_position) override; - virtual BakeError bake(BakeQuality p_quality, bool p_use_denoiser, float p_denoiser_strength, int p_bounces, float p_bounce_indirect_energy, float p_bias, int p_max_texture_size, bool p_bake_sh, bool p_texture_for_bounces, GenerateProbes p_generate_probes, const Ref<Image> &p_environment_panorama, const Basis &p_environment_transform, BakeStepFunc p_step_function = nullptr, void *p_bake_userdata = nullptr, float p_exposure_normalization = 1.0) override; + virtual BakeError bake(BakeQuality p_quality, bool p_use_denoiser, float p_denoiser_strength, int p_denoiser_range, int p_bounces, float p_bounce_indirect_energy, float p_bias, int p_max_texture_size, bool p_bake_sh, bool p_texture_for_bounces, GenerateProbes p_generate_probes, const Ref<Image> &p_environment_panorama, const Basis &p_environment_transform, BakeStepFunc p_step_function = nullptr, void *p_bake_userdata = nullptr, float p_exposure_normalization = 1.0) override; int get_bake_texture_count() const override; Ref<Image> get_bake_texture(int p_index) const override; diff --git a/modules/lightmapper_rd/lm_compute.glsl b/modules/lightmapper_rd/lm_compute.glsl index 1d088450e9..9424d5a4c1 100644 --- a/modules/lightmapper_rd/lm_compute.glsl +++ b/modules/lightmapper_rd/lm_compute.glsl @@ -76,6 +76,7 @@ layout(set = 1, binding = 3) uniform DenoiseParams { float albedo_bandwidth; float normal_bandwidth; + int half_search_window; float filter_strength; } denoise_params; @@ -849,10 +850,10 @@ void main() { // Half the size of the patch window around each pixel that is weighted to compute the denoised pixel. // A value of 1 represents a 3x3 window, a value of 2 a 5x5 window, etc. - const int HALF_PATCH_WINDOW = 4; + const int HALF_PATCH_WINDOW = 3; // Half the size of the search window around each pixel that is denoised and weighted to compute the denoised pixel. - const int HALF_SEARCH_WINDOW = 10; + const int HALF_SEARCH_WINDOW = denoise_params.half_search_window; // For all of the following sigma values, smaller values will give less weight to pixels that have a bigger distance // in the feature being evaluated. Therefore, smaller values are likely to cause more noise to appear, but will also diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/AllReadOnly_ScriptProperties.generated.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/AllReadOnly_ScriptProperties.generated.cs index 96ff0f75e9..825daffe80 100644 --- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/AllReadOnly_ScriptProperties.generated.cs +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/AllReadOnly_ScriptProperties.generated.cs @@ -33,15 +33,15 @@ partial class AllReadOnly value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.ReadOnlyAutoProperty); return true; } - else if (name == PropertyName.ReadOnlyProperty) { + if (name == PropertyName.ReadOnlyProperty) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.ReadOnlyProperty); return true; } - else if (name == PropertyName.InitOnlyAutoProperty) { + if (name == PropertyName.InitOnlyAutoProperty) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.InitOnlyAutoProperty); return true; } - else if (name == PropertyName.ReadOnlyField) { + if (name == PropertyName.ReadOnlyField) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.ReadOnlyField); return true; } diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/AllWriteOnly_ScriptProperties.generated.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/AllWriteOnly_ScriptProperties.generated.cs index 91dd282b99..615450efe8 100644 --- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/AllWriteOnly_ScriptProperties.generated.cs +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/AllWriteOnly_ScriptProperties.generated.cs @@ -25,7 +25,7 @@ partial class AllWriteOnly this.WriteOnlyProperty = global::Godot.NativeInterop.VariantUtils.ConvertTo<bool>(value); return true; } - else if (name == PropertyName._writeOnlyBackingField) { + if (name == PropertyName._writeOnlyBackingField) { this._writeOnlyBackingField = global::Godot.NativeInterop.VariantUtils.ConvertTo<bool>(value); return true; } diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ExportedFields_ScriptProperties.generated.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ExportedFields_ScriptProperties.generated.cs index 334adc1243..67ec4fa883 100644 --- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ExportedFields_ScriptProperties.generated.cs +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ExportedFields_ScriptProperties.generated.cs @@ -257,239 +257,239 @@ partial class ExportedFields this._fieldBoolean = global::Godot.NativeInterop.VariantUtils.ConvertTo<bool>(value); return true; } - else if (name == PropertyName._fieldChar) { + if (name == PropertyName._fieldChar) { this._fieldChar = global::Godot.NativeInterop.VariantUtils.ConvertTo<char>(value); return true; } - else if (name == PropertyName._fieldSByte) { + if (name == PropertyName._fieldSByte) { this._fieldSByte = global::Godot.NativeInterop.VariantUtils.ConvertTo<sbyte>(value); return true; } - else if (name == PropertyName._fieldInt16) { + if (name == PropertyName._fieldInt16) { this._fieldInt16 = global::Godot.NativeInterop.VariantUtils.ConvertTo<short>(value); return true; } - else if (name == PropertyName._fieldInt32) { + if (name == PropertyName._fieldInt32) { this._fieldInt32 = global::Godot.NativeInterop.VariantUtils.ConvertTo<int>(value); return true; } - else if (name == PropertyName._fieldInt64) { + if (name == PropertyName._fieldInt64) { this._fieldInt64 = global::Godot.NativeInterop.VariantUtils.ConvertTo<long>(value); return true; } - else if (name == PropertyName._fieldByte) { + if (name == PropertyName._fieldByte) { this._fieldByte = global::Godot.NativeInterop.VariantUtils.ConvertTo<byte>(value); return true; } - else if (name == PropertyName._fieldUInt16) { + if (name == PropertyName._fieldUInt16) { this._fieldUInt16 = global::Godot.NativeInterop.VariantUtils.ConvertTo<ushort>(value); return true; } - else if (name == PropertyName._fieldUInt32) { + if (name == PropertyName._fieldUInt32) { this._fieldUInt32 = global::Godot.NativeInterop.VariantUtils.ConvertTo<uint>(value); return true; } - else if (name == PropertyName._fieldUInt64) { + if (name == PropertyName._fieldUInt64) { this._fieldUInt64 = global::Godot.NativeInterop.VariantUtils.ConvertTo<ulong>(value); return true; } - else if (name == PropertyName._fieldSingle) { + if (name == PropertyName._fieldSingle) { this._fieldSingle = global::Godot.NativeInterop.VariantUtils.ConvertTo<float>(value); return true; } - else if (name == PropertyName._fieldDouble) { + if (name == PropertyName._fieldDouble) { this._fieldDouble = global::Godot.NativeInterop.VariantUtils.ConvertTo<double>(value); return true; } - else if (name == PropertyName._fieldString) { + if (name == PropertyName._fieldString) { this._fieldString = global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(value); return true; } - else if (name == PropertyName._fieldVector2) { + if (name == PropertyName._fieldVector2) { this._fieldVector2 = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector2>(value); return true; } - else if (name == PropertyName._fieldVector2I) { + if (name == PropertyName._fieldVector2I) { this._fieldVector2I = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector2I>(value); return true; } - else if (name == PropertyName._fieldRect2) { + if (name == PropertyName._fieldRect2) { this._fieldRect2 = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Rect2>(value); return true; } - else if (name == PropertyName._fieldRect2I) { + if (name == PropertyName._fieldRect2I) { this._fieldRect2I = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Rect2I>(value); return true; } - else if (name == PropertyName._fieldTransform2D) { + if (name == PropertyName._fieldTransform2D) { this._fieldTransform2D = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Transform2D>(value); return true; } - else if (name == PropertyName._fieldVector3) { + if (name == PropertyName._fieldVector3) { this._fieldVector3 = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector3>(value); return true; } - else if (name == PropertyName._fieldVector3I) { + if (name == PropertyName._fieldVector3I) { this._fieldVector3I = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector3I>(value); return true; } - else if (name == PropertyName._fieldBasis) { + if (name == PropertyName._fieldBasis) { this._fieldBasis = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Basis>(value); return true; } - else if (name == PropertyName._fieldQuaternion) { + if (name == PropertyName._fieldQuaternion) { this._fieldQuaternion = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Quaternion>(value); return true; } - else if (name == PropertyName._fieldTransform3D) { + if (name == PropertyName._fieldTransform3D) { this._fieldTransform3D = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Transform3D>(value); return true; } - else if (name == PropertyName._fieldVector4) { + if (name == PropertyName._fieldVector4) { this._fieldVector4 = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector4>(value); return true; } - else if (name == PropertyName._fieldVector4I) { + if (name == PropertyName._fieldVector4I) { this._fieldVector4I = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector4I>(value); return true; } - else if (name == PropertyName._fieldProjection) { + if (name == PropertyName._fieldProjection) { this._fieldProjection = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Projection>(value); return true; } - else if (name == PropertyName._fieldAabb) { + if (name == PropertyName._fieldAabb) { this._fieldAabb = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Aabb>(value); return true; } - else if (name == PropertyName._fieldColor) { + if (name == PropertyName._fieldColor) { this._fieldColor = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Color>(value); return true; } - else if (name == PropertyName._fieldPlane) { + if (name == PropertyName._fieldPlane) { this._fieldPlane = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Plane>(value); return true; } - else if (name == PropertyName._fieldCallable) { + if (name == PropertyName._fieldCallable) { this._fieldCallable = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Callable>(value); return true; } - else if (name == PropertyName._fieldSignal) { + if (name == PropertyName._fieldSignal) { this._fieldSignal = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Signal>(value); return true; } - else if (name == PropertyName._fieldEnum) { + if (name == PropertyName._fieldEnum) { this._fieldEnum = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::ExportedFields.MyEnum>(value); return true; } - else if (name == PropertyName._fieldFlagsEnum) { + if (name == PropertyName._fieldFlagsEnum) { this._fieldFlagsEnum = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::ExportedFields.MyFlagsEnum>(value); return true; } - else if (name == PropertyName._fieldByteArray) { + if (name == PropertyName._fieldByteArray) { this._fieldByteArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<byte[]>(value); return true; } - else if (name == PropertyName._fieldInt32Array) { + if (name == PropertyName._fieldInt32Array) { this._fieldInt32Array = global::Godot.NativeInterop.VariantUtils.ConvertTo<int[]>(value); return true; } - else if (name == PropertyName._fieldInt64Array) { + if (name == PropertyName._fieldInt64Array) { this._fieldInt64Array = global::Godot.NativeInterop.VariantUtils.ConvertTo<long[]>(value); return true; } - else if (name == PropertyName._fieldSingleArray) { + if (name == PropertyName._fieldSingleArray) { this._fieldSingleArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<float[]>(value); return true; } - else if (name == PropertyName._fieldDoubleArray) { + if (name == PropertyName._fieldDoubleArray) { this._fieldDoubleArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<double[]>(value); return true; } - else if (name == PropertyName._fieldStringArray) { + if (name == PropertyName._fieldStringArray) { this._fieldStringArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<string[]>(value); return true; } - else if (name == PropertyName._fieldStringArrayEnum) { + if (name == PropertyName._fieldStringArrayEnum) { this._fieldStringArrayEnum = global::Godot.NativeInterop.VariantUtils.ConvertTo<string[]>(value); return true; } - else if (name == PropertyName._fieldVector2Array) { + if (name == PropertyName._fieldVector2Array) { this._fieldVector2Array = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector2[]>(value); return true; } - else if (name == PropertyName._fieldVector3Array) { + if (name == PropertyName._fieldVector3Array) { this._fieldVector3Array = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector3[]>(value); return true; } - else if (name == PropertyName._fieldColorArray) { + if (name == PropertyName._fieldColorArray) { this._fieldColorArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Color[]>(value); return true; } - else if (name == PropertyName._fieldGodotObjectOrDerivedArray) { + if (name == PropertyName._fieldGodotObjectOrDerivedArray) { this._fieldGodotObjectOrDerivedArray = global::Godot.NativeInterop.VariantUtils.ConvertToSystemArrayOfGodotObject<global::Godot.GodotObject>(value); return true; } - else if (name == PropertyName._fieldStringNameArray) { + if (name == PropertyName._fieldStringNameArray) { this._fieldStringNameArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.StringName[]>(value); return true; } - else if (name == PropertyName._fieldNodePathArray) { + if (name == PropertyName._fieldNodePathArray) { this._fieldNodePathArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.NodePath[]>(value); return true; } - else if (name == PropertyName._fieldRidArray) { + if (name == PropertyName._fieldRidArray) { this._fieldRidArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Rid[]>(value); return true; } - else if (name == PropertyName._fieldEmptyInt32Array) { + if (name == PropertyName._fieldEmptyInt32Array) { this._fieldEmptyInt32Array = global::Godot.NativeInterop.VariantUtils.ConvertTo<int[]>(value); return true; } - else if (name == PropertyName._fieldArrayFromList) { + if (name == PropertyName._fieldArrayFromList) { this._fieldArrayFromList = global::Godot.NativeInterop.VariantUtils.ConvertTo<int[]>(value); return true; } - else if (name == PropertyName._fieldVariant) { + if (name == PropertyName._fieldVariant) { this._fieldVariant = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Variant>(value); return true; } - else if (name == PropertyName._fieldGodotObjectOrDerived) { + if (name == PropertyName._fieldGodotObjectOrDerived) { this._fieldGodotObjectOrDerived = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.GodotObject>(value); return true; } - else if (name == PropertyName._fieldGodotResourceTexture) { + if (name == PropertyName._fieldGodotResourceTexture) { this._fieldGodotResourceTexture = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Texture>(value); return true; } - else if (name == PropertyName._fieldStringName) { + if (name == PropertyName._fieldStringName) { this._fieldStringName = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.StringName>(value); return true; } - else if (name == PropertyName._fieldNodePath) { + if (name == PropertyName._fieldNodePath) { this._fieldNodePath = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.NodePath>(value); return true; } - else if (name == PropertyName._fieldRid) { + if (name == PropertyName._fieldRid) { this._fieldRid = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Rid>(value); return true; } - else if (name == PropertyName._fieldGodotDictionary) { + if (name == PropertyName._fieldGodotDictionary) { this._fieldGodotDictionary = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Collections.Dictionary>(value); return true; } - else if (name == PropertyName._fieldGodotArray) { + if (name == PropertyName._fieldGodotArray) { this._fieldGodotArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Collections.Array>(value); return true; } - else if (name == PropertyName._fieldGodotGenericDictionary) { + if (name == PropertyName._fieldGodotGenericDictionary) { this._fieldGodotGenericDictionary = global::Godot.NativeInterop.VariantUtils.ConvertToDictionary<string, bool>(value); return true; } - else if (name == PropertyName._fieldGodotGenericArray) { + if (name == PropertyName._fieldGodotGenericArray) { this._fieldGodotGenericArray = global::Godot.NativeInterop.VariantUtils.ConvertToArray<int>(value); return true; } - else if (name == PropertyName._fieldEmptyInt64Array) { + if (name == PropertyName._fieldEmptyInt64Array) { this._fieldEmptyInt64Array = global::Godot.NativeInterop.VariantUtils.ConvertTo<long[]>(value); return true; } @@ -503,239 +503,239 @@ partial class ExportedFields value = global::Godot.NativeInterop.VariantUtils.CreateFrom<bool>(this._fieldBoolean); return true; } - else if (name == PropertyName._fieldChar) { + if (name == PropertyName._fieldChar) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<char>(this._fieldChar); return true; } - else if (name == PropertyName._fieldSByte) { + if (name == PropertyName._fieldSByte) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<sbyte>(this._fieldSByte); return true; } - else if (name == PropertyName._fieldInt16) { + if (name == PropertyName._fieldInt16) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<short>(this._fieldInt16); return true; } - else if (name == PropertyName._fieldInt32) { + if (name == PropertyName._fieldInt32) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<int>(this._fieldInt32); return true; } - else if (name == PropertyName._fieldInt64) { + if (name == PropertyName._fieldInt64) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<long>(this._fieldInt64); return true; } - else if (name == PropertyName._fieldByte) { + if (name == PropertyName._fieldByte) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<byte>(this._fieldByte); return true; } - else if (name == PropertyName._fieldUInt16) { + if (name == PropertyName._fieldUInt16) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<ushort>(this._fieldUInt16); return true; } - else if (name == PropertyName._fieldUInt32) { + if (name == PropertyName._fieldUInt32) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<uint>(this._fieldUInt32); return true; } - else if (name == PropertyName._fieldUInt64) { + if (name == PropertyName._fieldUInt64) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<ulong>(this._fieldUInt64); return true; } - else if (name == PropertyName._fieldSingle) { + if (name == PropertyName._fieldSingle) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<float>(this._fieldSingle); return true; } - else if (name == PropertyName._fieldDouble) { + if (name == PropertyName._fieldDouble) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<double>(this._fieldDouble); return true; } - else if (name == PropertyName._fieldString) { + if (name == PropertyName._fieldString) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this._fieldString); return true; } - else if (name == PropertyName._fieldVector2) { + if (name == PropertyName._fieldVector2) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector2>(this._fieldVector2); return true; } - else if (name == PropertyName._fieldVector2I) { + if (name == PropertyName._fieldVector2I) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector2I>(this._fieldVector2I); return true; } - else if (name == PropertyName._fieldRect2) { + if (name == PropertyName._fieldRect2) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Rect2>(this._fieldRect2); return true; } - else if (name == PropertyName._fieldRect2I) { + if (name == PropertyName._fieldRect2I) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Rect2I>(this._fieldRect2I); return true; } - else if (name == PropertyName._fieldTransform2D) { + if (name == PropertyName._fieldTransform2D) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Transform2D>(this._fieldTransform2D); return true; } - else if (name == PropertyName._fieldVector3) { + if (name == PropertyName._fieldVector3) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector3>(this._fieldVector3); return true; } - else if (name == PropertyName._fieldVector3I) { + if (name == PropertyName._fieldVector3I) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector3I>(this._fieldVector3I); return true; } - else if (name == PropertyName._fieldBasis) { + if (name == PropertyName._fieldBasis) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Basis>(this._fieldBasis); return true; } - else if (name == PropertyName._fieldQuaternion) { + if (name == PropertyName._fieldQuaternion) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Quaternion>(this._fieldQuaternion); return true; } - else if (name == PropertyName._fieldTransform3D) { + if (name == PropertyName._fieldTransform3D) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Transform3D>(this._fieldTransform3D); return true; } - else if (name == PropertyName._fieldVector4) { + if (name == PropertyName._fieldVector4) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector4>(this._fieldVector4); return true; } - else if (name == PropertyName._fieldVector4I) { + if (name == PropertyName._fieldVector4I) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector4I>(this._fieldVector4I); return true; } - else if (name == PropertyName._fieldProjection) { + if (name == PropertyName._fieldProjection) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Projection>(this._fieldProjection); return true; } - else if (name == PropertyName._fieldAabb) { + if (name == PropertyName._fieldAabb) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Aabb>(this._fieldAabb); return true; } - else if (name == PropertyName._fieldColor) { + if (name == PropertyName._fieldColor) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Color>(this._fieldColor); return true; } - else if (name == PropertyName._fieldPlane) { + if (name == PropertyName._fieldPlane) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Plane>(this._fieldPlane); return true; } - else if (name == PropertyName._fieldCallable) { + if (name == PropertyName._fieldCallable) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Callable>(this._fieldCallable); return true; } - else if (name == PropertyName._fieldSignal) { + if (name == PropertyName._fieldSignal) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Signal>(this._fieldSignal); return true; } - else if (name == PropertyName._fieldEnum) { + if (name == PropertyName._fieldEnum) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::ExportedFields.MyEnum>(this._fieldEnum); return true; } - else if (name == PropertyName._fieldFlagsEnum) { + if (name == PropertyName._fieldFlagsEnum) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::ExportedFields.MyFlagsEnum>(this._fieldFlagsEnum); return true; } - else if (name == PropertyName._fieldByteArray) { + if (name == PropertyName._fieldByteArray) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<byte[]>(this._fieldByteArray); return true; } - else if (name == PropertyName._fieldInt32Array) { + if (name == PropertyName._fieldInt32Array) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<int[]>(this._fieldInt32Array); return true; } - else if (name == PropertyName._fieldInt64Array) { + if (name == PropertyName._fieldInt64Array) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<long[]>(this._fieldInt64Array); return true; } - else if (name == PropertyName._fieldSingleArray) { + if (name == PropertyName._fieldSingleArray) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<float[]>(this._fieldSingleArray); return true; } - else if (name == PropertyName._fieldDoubleArray) { + if (name == PropertyName._fieldDoubleArray) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<double[]>(this._fieldDoubleArray); return true; } - else if (name == PropertyName._fieldStringArray) { + if (name == PropertyName._fieldStringArray) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string[]>(this._fieldStringArray); return true; } - else if (name == PropertyName._fieldStringArrayEnum) { + if (name == PropertyName._fieldStringArrayEnum) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string[]>(this._fieldStringArrayEnum); return true; } - else if (name == PropertyName._fieldVector2Array) { + if (name == PropertyName._fieldVector2Array) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector2[]>(this._fieldVector2Array); return true; } - else if (name == PropertyName._fieldVector3Array) { + if (name == PropertyName._fieldVector3Array) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector3[]>(this._fieldVector3Array); return true; } - else if (name == PropertyName._fieldColorArray) { + if (name == PropertyName._fieldColorArray) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Color[]>(this._fieldColorArray); return true; } - else if (name == PropertyName._fieldGodotObjectOrDerivedArray) { + if (name == PropertyName._fieldGodotObjectOrDerivedArray) { value = global::Godot.NativeInterop.VariantUtils.CreateFromSystemArrayOfGodotObject(this._fieldGodotObjectOrDerivedArray); return true; } - else if (name == PropertyName._fieldStringNameArray) { + if (name == PropertyName._fieldStringNameArray) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.StringName[]>(this._fieldStringNameArray); return true; } - else if (name == PropertyName._fieldNodePathArray) { + if (name == PropertyName._fieldNodePathArray) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.NodePath[]>(this._fieldNodePathArray); return true; } - else if (name == PropertyName._fieldRidArray) { + if (name == PropertyName._fieldRidArray) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Rid[]>(this._fieldRidArray); return true; } - else if (name == PropertyName._fieldEmptyInt32Array) { + if (name == PropertyName._fieldEmptyInt32Array) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<int[]>(this._fieldEmptyInt32Array); return true; } - else if (name == PropertyName._fieldArrayFromList) { + if (name == PropertyName._fieldArrayFromList) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<int[]>(this._fieldArrayFromList); return true; } - else if (name == PropertyName._fieldVariant) { + if (name == PropertyName._fieldVariant) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Variant>(this._fieldVariant); return true; } - else if (name == PropertyName._fieldGodotObjectOrDerived) { + if (name == PropertyName._fieldGodotObjectOrDerived) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.GodotObject>(this._fieldGodotObjectOrDerived); return true; } - else if (name == PropertyName._fieldGodotResourceTexture) { + if (name == PropertyName._fieldGodotResourceTexture) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Texture>(this._fieldGodotResourceTexture); return true; } - else if (name == PropertyName._fieldStringName) { + if (name == PropertyName._fieldStringName) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.StringName>(this._fieldStringName); return true; } - else if (name == PropertyName._fieldNodePath) { + if (name == PropertyName._fieldNodePath) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.NodePath>(this._fieldNodePath); return true; } - else if (name == PropertyName._fieldRid) { + if (name == PropertyName._fieldRid) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Rid>(this._fieldRid); return true; } - else if (name == PropertyName._fieldGodotDictionary) { + if (name == PropertyName._fieldGodotDictionary) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Collections.Dictionary>(this._fieldGodotDictionary); return true; } - else if (name == PropertyName._fieldGodotArray) { + if (name == PropertyName._fieldGodotArray) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Collections.Array>(this._fieldGodotArray); return true; } - else if (name == PropertyName._fieldGodotGenericDictionary) { + if (name == PropertyName._fieldGodotGenericDictionary) { value = global::Godot.NativeInterop.VariantUtils.CreateFromDictionary(this._fieldGodotGenericDictionary); return true; } - else if (name == PropertyName._fieldGodotGenericArray) { + if (name == PropertyName._fieldGodotGenericArray) { value = global::Godot.NativeInterop.VariantUtils.CreateFromArray(this._fieldGodotGenericArray); return true; } - else if (name == PropertyName._fieldEmptyInt64Array) { + if (name == PropertyName._fieldEmptyInt64Array) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<long[]>(this._fieldEmptyInt64Array); return true; } diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ExportedProperties_ScriptProperties.generated.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ExportedProperties_ScriptProperties.generated.cs index 6e0e9fffbe..aa876d8d7d 100644 --- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ExportedProperties_ScriptProperties.generated.cs +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ExportedProperties_ScriptProperties.generated.cs @@ -293,275 +293,275 @@ partial class ExportedProperties this.NotGenerateComplexLamdaProperty = global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(value); return true; } - else if (name == PropertyName.NotGenerateLamdaNoFieldProperty) { + if (name == PropertyName.NotGenerateLamdaNoFieldProperty) { this.NotGenerateLamdaNoFieldProperty = global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(value); return true; } - else if (name == PropertyName.NotGenerateComplexReturnProperty) { + if (name == PropertyName.NotGenerateComplexReturnProperty) { this.NotGenerateComplexReturnProperty = global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(value); return true; } - else if (name == PropertyName.NotGenerateReturnsProperty) { + if (name == PropertyName.NotGenerateReturnsProperty) { this.NotGenerateReturnsProperty = global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(value); return true; } - else if (name == PropertyName.FullPropertyString) { + if (name == PropertyName.FullPropertyString) { this.FullPropertyString = global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(value); return true; } - else if (name == PropertyName.FullPropertyString_Complex) { + if (name == PropertyName.FullPropertyString_Complex) { this.FullPropertyString_Complex = global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(value); return true; } - else if (name == PropertyName.LamdaPropertyString) { + if (name == PropertyName.LamdaPropertyString) { this.LamdaPropertyString = global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(value); return true; } - else if (name == PropertyName.PropertyBoolean) { + if (name == PropertyName.PropertyBoolean) { this.PropertyBoolean = global::Godot.NativeInterop.VariantUtils.ConvertTo<bool>(value); return true; } - else if (name == PropertyName.PropertyChar) { + if (name == PropertyName.PropertyChar) { this.PropertyChar = global::Godot.NativeInterop.VariantUtils.ConvertTo<char>(value); return true; } - else if (name == PropertyName.PropertySByte) { + if (name == PropertyName.PropertySByte) { this.PropertySByte = global::Godot.NativeInterop.VariantUtils.ConvertTo<sbyte>(value); return true; } - else if (name == PropertyName.PropertyInt16) { + if (name == PropertyName.PropertyInt16) { this.PropertyInt16 = global::Godot.NativeInterop.VariantUtils.ConvertTo<short>(value); return true; } - else if (name == PropertyName.PropertyInt32) { + if (name == PropertyName.PropertyInt32) { this.PropertyInt32 = global::Godot.NativeInterop.VariantUtils.ConvertTo<int>(value); return true; } - else if (name == PropertyName.PropertyInt64) { + if (name == PropertyName.PropertyInt64) { this.PropertyInt64 = global::Godot.NativeInterop.VariantUtils.ConvertTo<long>(value); return true; } - else if (name == PropertyName.PropertyByte) { + if (name == PropertyName.PropertyByte) { this.PropertyByte = global::Godot.NativeInterop.VariantUtils.ConvertTo<byte>(value); return true; } - else if (name == PropertyName.PropertyUInt16) { + if (name == PropertyName.PropertyUInt16) { this.PropertyUInt16 = global::Godot.NativeInterop.VariantUtils.ConvertTo<ushort>(value); return true; } - else if (name == PropertyName.PropertyUInt32) { + if (name == PropertyName.PropertyUInt32) { this.PropertyUInt32 = global::Godot.NativeInterop.VariantUtils.ConvertTo<uint>(value); return true; } - else if (name == PropertyName.PropertyUInt64) { + if (name == PropertyName.PropertyUInt64) { this.PropertyUInt64 = global::Godot.NativeInterop.VariantUtils.ConvertTo<ulong>(value); return true; } - else if (name == PropertyName.PropertySingle) { + if (name == PropertyName.PropertySingle) { this.PropertySingle = global::Godot.NativeInterop.VariantUtils.ConvertTo<float>(value); return true; } - else if (name == PropertyName.PropertyDouble) { + if (name == PropertyName.PropertyDouble) { this.PropertyDouble = global::Godot.NativeInterop.VariantUtils.ConvertTo<double>(value); return true; } - else if (name == PropertyName.PropertyString) { + if (name == PropertyName.PropertyString) { this.PropertyString = global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(value); return true; } - else if (name == PropertyName.PropertyVector2) { + if (name == PropertyName.PropertyVector2) { this.PropertyVector2 = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector2>(value); return true; } - else if (name == PropertyName.PropertyVector2I) { + if (name == PropertyName.PropertyVector2I) { this.PropertyVector2I = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector2I>(value); return true; } - else if (name == PropertyName.PropertyRect2) { + if (name == PropertyName.PropertyRect2) { this.PropertyRect2 = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Rect2>(value); return true; } - else if (name == PropertyName.PropertyRect2I) { + if (name == PropertyName.PropertyRect2I) { this.PropertyRect2I = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Rect2I>(value); return true; } - else if (name == PropertyName.PropertyTransform2D) { + if (name == PropertyName.PropertyTransform2D) { this.PropertyTransform2D = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Transform2D>(value); return true; } - else if (name == PropertyName.PropertyVector3) { + if (name == PropertyName.PropertyVector3) { this.PropertyVector3 = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector3>(value); return true; } - else if (name == PropertyName.PropertyVector3I) { + if (name == PropertyName.PropertyVector3I) { this.PropertyVector3I = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector3I>(value); return true; } - else if (name == PropertyName.PropertyBasis) { + if (name == PropertyName.PropertyBasis) { this.PropertyBasis = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Basis>(value); return true; } - else if (name == PropertyName.PropertyQuaternion) { + if (name == PropertyName.PropertyQuaternion) { this.PropertyQuaternion = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Quaternion>(value); return true; } - else if (name == PropertyName.PropertyTransform3D) { + if (name == PropertyName.PropertyTransform3D) { this.PropertyTransform3D = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Transform3D>(value); return true; } - else if (name == PropertyName.PropertyVector4) { + if (name == PropertyName.PropertyVector4) { this.PropertyVector4 = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector4>(value); return true; } - else if (name == PropertyName.PropertyVector4I) { + if (name == PropertyName.PropertyVector4I) { this.PropertyVector4I = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector4I>(value); return true; } - else if (name == PropertyName.PropertyProjection) { + if (name == PropertyName.PropertyProjection) { this.PropertyProjection = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Projection>(value); return true; } - else if (name == PropertyName.PropertyAabb) { + if (name == PropertyName.PropertyAabb) { this.PropertyAabb = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Aabb>(value); return true; } - else if (name == PropertyName.PropertyColor) { + if (name == PropertyName.PropertyColor) { this.PropertyColor = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Color>(value); return true; } - else if (name == PropertyName.PropertyPlane) { + if (name == PropertyName.PropertyPlane) { this.PropertyPlane = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Plane>(value); return true; } - else if (name == PropertyName.PropertyCallable) { + if (name == PropertyName.PropertyCallable) { this.PropertyCallable = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Callable>(value); return true; } - else if (name == PropertyName.PropertySignal) { + if (name == PropertyName.PropertySignal) { this.PropertySignal = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Signal>(value); return true; } - else if (name == PropertyName.PropertyEnum) { + if (name == PropertyName.PropertyEnum) { this.PropertyEnum = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::ExportedProperties.MyEnum>(value); return true; } - else if (name == PropertyName.PropertyFlagsEnum) { + if (name == PropertyName.PropertyFlagsEnum) { this.PropertyFlagsEnum = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::ExportedProperties.MyFlagsEnum>(value); return true; } - else if (name == PropertyName.PropertyByteArray) { + if (name == PropertyName.PropertyByteArray) { this.PropertyByteArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<byte[]>(value); return true; } - else if (name == PropertyName.PropertyInt32Array) { + if (name == PropertyName.PropertyInt32Array) { this.PropertyInt32Array = global::Godot.NativeInterop.VariantUtils.ConvertTo<int[]>(value); return true; } - else if (name == PropertyName.PropertyInt64Array) { + if (name == PropertyName.PropertyInt64Array) { this.PropertyInt64Array = global::Godot.NativeInterop.VariantUtils.ConvertTo<long[]>(value); return true; } - else if (name == PropertyName.PropertySingleArray) { + if (name == PropertyName.PropertySingleArray) { this.PropertySingleArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<float[]>(value); return true; } - else if (name == PropertyName.PropertyDoubleArray) { + if (name == PropertyName.PropertyDoubleArray) { this.PropertyDoubleArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<double[]>(value); return true; } - else if (name == PropertyName.PropertyStringArray) { + if (name == PropertyName.PropertyStringArray) { this.PropertyStringArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<string[]>(value); return true; } - else if (name == PropertyName.PropertyStringArrayEnum) { + if (name == PropertyName.PropertyStringArrayEnum) { this.PropertyStringArrayEnum = global::Godot.NativeInterop.VariantUtils.ConvertTo<string[]>(value); return true; } - else if (name == PropertyName.PropertyVector2Array) { + if (name == PropertyName.PropertyVector2Array) { this.PropertyVector2Array = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector2[]>(value); return true; } - else if (name == PropertyName.PropertyVector3Array) { + if (name == PropertyName.PropertyVector3Array) { this.PropertyVector3Array = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Vector3[]>(value); return true; } - else if (name == PropertyName.PropertyColorArray) { + if (name == PropertyName.PropertyColorArray) { this.PropertyColorArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Color[]>(value); return true; } - else if (name == PropertyName.PropertyGodotObjectOrDerivedArray) { + if (name == PropertyName.PropertyGodotObjectOrDerivedArray) { this.PropertyGodotObjectOrDerivedArray = global::Godot.NativeInterop.VariantUtils.ConvertToSystemArrayOfGodotObject<global::Godot.GodotObject>(value); return true; } - else if (name == PropertyName.field_StringNameArray) { + if (name == PropertyName.field_StringNameArray) { this.field_StringNameArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.StringName[]>(value); return true; } - else if (name == PropertyName.field_NodePathArray) { + if (name == PropertyName.field_NodePathArray) { this.field_NodePathArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.NodePath[]>(value); return true; } - else if (name == PropertyName.field_RidArray) { + if (name == PropertyName.field_RidArray) { this.field_RidArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Rid[]>(value); return true; } - else if (name == PropertyName.PropertyVariant) { + if (name == PropertyName.PropertyVariant) { this.PropertyVariant = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Variant>(value); return true; } - else if (name == PropertyName.PropertyGodotObjectOrDerived) { + if (name == PropertyName.PropertyGodotObjectOrDerived) { this.PropertyGodotObjectOrDerived = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.GodotObject>(value); return true; } - else if (name == PropertyName.PropertyGodotResourceTexture) { + if (name == PropertyName.PropertyGodotResourceTexture) { this.PropertyGodotResourceTexture = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Texture>(value); return true; } - else if (name == PropertyName.PropertyStringName) { + if (name == PropertyName.PropertyStringName) { this.PropertyStringName = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.StringName>(value); return true; } - else if (name == PropertyName.PropertyNodePath) { + if (name == PropertyName.PropertyNodePath) { this.PropertyNodePath = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.NodePath>(value); return true; } - else if (name == PropertyName.PropertyRid) { + if (name == PropertyName.PropertyRid) { this.PropertyRid = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Rid>(value); return true; } - else if (name == PropertyName.PropertyGodotDictionary) { + if (name == PropertyName.PropertyGodotDictionary) { this.PropertyGodotDictionary = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Collections.Dictionary>(value); return true; } - else if (name == PropertyName.PropertyGodotArray) { + if (name == PropertyName.PropertyGodotArray) { this.PropertyGodotArray = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.Collections.Array>(value); return true; } - else if (name == PropertyName.PropertyGodotGenericDictionary) { + if (name == PropertyName.PropertyGodotGenericDictionary) { this.PropertyGodotGenericDictionary = global::Godot.NativeInterop.VariantUtils.ConvertToDictionary<string, bool>(value); return true; } - else if (name == PropertyName.PropertyGodotGenericArray) { + if (name == PropertyName.PropertyGodotGenericArray) { this.PropertyGodotGenericArray = global::Godot.NativeInterop.VariantUtils.ConvertToArray<int>(value); return true; } - else if (name == PropertyName._notGeneratePropertyString) { + if (name == PropertyName._notGeneratePropertyString) { this._notGeneratePropertyString = global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(value); return true; } - else if (name == PropertyName._notGeneratePropertyInt) { + if (name == PropertyName._notGeneratePropertyInt) { this._notGeneratePropertyInt = global::Godot.NativeInterop.VariantUtils.ConvertTo<int>(value); return true; } - else if (name == PropertyName._fullPropertyString) { + if (name == PropertyName._fullPropertyString) { this._fullPropertyString = global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(value); return true; } - else if (name == PropertyName._fullPropertyStringComplex) { + if (name == PropertyName._fullPropertyStringComplex) { this._fullPropertyStringComplex = global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(value); return true; } - else if (name == PropertyName._lamdaPropertyString) { + if (name == PropertyName._lamdaPropertyString) { this._lamdaPropertyString = global::Godot.NativeInterop.VariantUtils.ConvertTo<string>(value); return true; } @@ -575,275 +575,275 @@ partial class ExportedProperties value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.NotGenerateComplexLamdaProperty); return true; } - else if (name == PropertyName.NotGenerateLamdaNoFieldProperty) { + if (name == PropertyName.NotGenerateLamdaNoFieldProperty) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.NotGenerateLamdaNoFieldProperty); return true; } - else if (name == PropertyName.NotGenerateComplexReturnProperty) { + if (name == PropertyName.NotGenerateComplexReturnProperty) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.NotGenerateComplexReturnProperty); return true; } - else if (name == PropertyName.NotGenerateReturnsProperty) { + if (name == PropertyName.NotGenerateReturnsProperty) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.NotGenerateReturnsProperty); return true; } - else if (name == PropertyName.FullPropertyString) { + if (name == PropertyName.FullPropertyString) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.FullPropertyString); return true; } - else if (name == PropertyName.FullPropertyString_Complex) { + if (name == PropertyName.FullPropertyString_Complex) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.FullPropertyString_Complex); return true; } - else if (name == PropertyName.LamdaPropertyString) { + if (name == PropertyName.LamdaPropertyString) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.LamdaPropertyString); return true; } - else if (name == PropertyName.PropertyBoolean) { + if (name == PropertyName.PropertyBoolean) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<bool>(this.PropertyBoolean); return true; } - else if (name == PropertyName.PropertyChar) { + if (name == PropertyName.PropertyChar) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<char>(this.PropertyChar); return true; } - else if (name == PropertyName.PropertySByte) { + if (name == PropertyName.PropertySByte) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<sbyte>(this.PropertySByte); return true; } - else if (name == PropertyName.PropertyInt16) { + if (name == PropertyName.PropertyInt16) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<short>(this.PropertyInt16); return true; } - else if (name == PropertyName.PropertyInt32) { + if (name == PropertyName.PropertyInt32) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<int>(this.PropertyInt32); return true; } - else if (name == PropertyName.PropertyInt64) { + if (name == PropertyName.PropertyInt64) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<long>(this.PropertyInt64); return true; } - else if (name == PropertyName.PropertyByte) { + if (name == PropertyName.PropertyByte) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<byte>(this.PropertyByte); return true; } - else if (name == PropertyName.PropertyUInt16) { + if (name == PropertyName.PropertyUInt16) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<ushort>(this.PropertyUInt16); return true; } - else if (name == PropertyName.PropertyUInt32) { + if (name == PropertyName.PropertyUInt32) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<uint>(this.PropertyUInt32); return true; } - else if (name == PropertyName.PropertyUInt64) { + if (name == PropertyName.PropertyUInt64) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<ulong>(this.PropertyUInt64); return true; } - else if (name == PropertyName.PropertySingle) { + if (name == PropertyName.PropertySingle) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<float>(this.PropertySingle); return true; } - else if (name == PropertyName.PropertyDouble) { + if (name == PropertyName.PropertyDouble) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<double>(this.PropertyDouble); return true; } - else if (name == PropertyName.PropertyString) { + if (name == PropertyName.PropertyString) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.PropertyString); return true; } - else if (name == PropertyName.PropertyVector2) { + if (name == PropertyName.PropertyVector2) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector2>(this.PropertyVector2); return true; } - else if (name == PropertyName.PropertyVector2I) { + if (name == PropertyName.PropertyVector2I) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector2I>(this.PropertyVector2I); return true; } - else if (name == PropertyName.PropertyRect2) { + if (name == PropertyName.PropertyRect2) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Rect2>(this.PropertyRect2); return true; } - else if (name == PropertyName.PropertyRect2I) { + if (name == PropertyName.PropertyRect2I) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Rect2I>(this.PropertyRect2I); return true; } - else if (name == PropertyName.PropertyTransform2D) { + if (name == PropertyName.PropertyTransform2D) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Transform2D>(this.PropertyTransform2D); return true; } - else if (name == PropertyName.PropertyVector3) { + if (name == PropertyName.PropertyVector3) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector3>(this.PropertyVector3); return true; } - else if (name == PropertyName.PropertyVector3I) { + if (name == PropertyName.PropertyVector3I) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector3I>(this.PropertyVector3I); return true; } - else if (name == PropertyName.PropertyBasis) { + if (name == PropertyName.PropertyBasis) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Basis>(this.PropertyBasis); return true; } - else if (name == PropertyName.PropertyQuaternion) { + if (name == PropertyName.PropertyQuaternion) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Quaternion>(this.PropertyQuaternion); return true; } - else if (name == PropertyName.PropertyTransform3D) { + if (name == PropertyName.PropertyTransform3D) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Transform3D>(this.PropertyTransform3D); return true; } - else if (name == PropertyName.PropertyVector4) { + if (name == PropertyName.PropertyVector4) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector4>(this.PropertyVector4); return true; } - else if (name == PropertyName.PropertyVector4I) { + if (name == PropertyName.PropertyVector4I) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector4I>(this.PropertyVector4I); return true; } - else if (name == PropertyName.PropertyProjection) { + if (name == PropertyName.PropertyProjection) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Projection>(this.PropertyProjection); return true; } - else if (name == PropertyName.PropertyAabb) { + if (name == PropertyName.PropertyAabb) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Aabb>(this.PropertyAabb); return true; } - else if (name == PropertyName.PropertyColor) { + if (name == PropertyName.PropertyColor) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Color>(this.PropertyColor); return true; } - else if (name == PropertyName.PropertyPlane) { + if (name == PropertyName.PropertyPlane) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Plane>(this.PropertyPlane); return true; } - else if (name == PropertyName.PropertyCallable) { + if (name == PropertyName.PropertyCallable) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Callable>(this.PropertyCallable); return true; } - else if (name == PropertyName.PropertySignal) { + if (name == PropertyName.PropertySignal) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Signal>(this.PropertySignal); return true; } - else if (name == PropertyName.PropertyEnum) { + if (name == PropertyName.PropertyEnum) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::ExportedProperties.MyEnum>(this.PropertyEnum); return true; } - else if (name == PropertyName.PropertyFlagsEnum) { + if (name == PropertyName.PropertyFlagsEnum) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::ExportedProperties.MyFlagsEnum>(this.PropertyFlagsEnum); return true; } - else if (name == PropertyName.PropertyByteArray) { + if (name == PropertyName.PropertyByteArray) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<byte[]>(this.PropertyByteArray); return true; } - else if (name == PropertyName.PropertyInt32Array) { + if (name == PropertyName.PropertyInt32Array) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<int[]>(this.PropertyInt32Array); return true; } - else if (name == PropertyName.PropertyInt64Array) { + if (name == PropertyName.PropertyInt64Array) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<long[]>(this.PropertyInt64Array); return true; } - else if (name == PropertyName.PropertySingleArray) { + if (name == PropertyName.PropertySingleArray) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<float[]>(this.PropertySingleArray); return true; } - else if (name == PropertyName.PropertyDoubleArray) { + if (name == PropertyName.PropertyDoubleArray) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<double[]>(this.PropertyDoubleArray); return true; } - else if (name == PropertyName.PropertyStringArray) { + if (name == PropertyName.PropertyStringArray) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string[]>(this.PropertyStringArray); return true; } - else if (name == PropertyName.PropertyStringArrayEnum) { + if (name == PropertyName.PropertyStringArrayEnum) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string[]>(this.PropertyStringArrayEnum); return true; } - else if (name == PropertyName.PropertyVector2Array) { + if (name == PropertyName.PropertyVector2Array) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector2[]>(this.PropertyVector2Array); return true; } - else if (name == PropertyName.PropertyVector3Array) { + if (name == PropertyName.PropertyVector3Array) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Vector3[]>(this.PropertyVector3Array); return true; } - else if (name == PropertyName.PropertyColorArray) { + if (name == PropertyName.PropertyColorArray) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Color[]>(this.PropertyColorArray); return true; } - else if (name == PropertyName.PropertyGodotObjectOrDerivedArray) { + if (name == PropertyName.PropertyGodotObjectOrDerivedArray) { value = global::Godot.NativeInterop.VariantUtils.CreateFromSystemArrayOfGodotObject(this.PropertyGodotObjectOrDerivedArray); return true; } - else if (name == PropertyName.field_StringNameArray) { + if (name == PropertyName.field_StringNameArray) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.StringName[]>(this.field_StringNameArray); return true; } - else if (name == PropertyName.field_NodePathArray) { + if (name == PropertyName.field_NodePathArray) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.NodePath[]>(this.field_NodePathArray); return true; } - else if (name == PropertyName.field_RidArray) { + if (name == PropertyName.field_RidArray) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Rid[]>(this.field_RidArray); return true; } - else if (name == PropertyName.PropertyVariant) { + if (name == PropertyName.PropertyVariant) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Variant>(this.PropertyVariant); return true; } - else if (name == PropertyName.PropertyGodotObjectOrDerived) { + if (name == PropertyName.PropertyGodotObjectOrDerived) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.GodotObject>(this.PropertyGodotObjectOrDerived); return true; } - else if (name == PropertyName.PropertyGodotResourceTexture) { + if (name == PropertyName.PropertyGodotResourceTexture) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Texture>(this.PropertyGodotResourceTexture); return true; } - else if (name == PropertyName.PropertyStringName) { + if (name == PropertyName.PropertyStringName) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.StringName>(this.PropertyStringName); return true; } - else if (name == PropertyName.PropertyNodePath) { + if (name == PropertyName.PropertyNodePath) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.NodePath>(this.PropertyNodePath); return true; } - else if (name == PropertyName.PropertyRid) { + if (name == PropertyName.PropertyRid) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Rid>(this.PropertyRid); return true; } - else if (name == PropertyName.PropertyGodotDictionary) { + if (name == PropertyName.PropertyGodotDictionary) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Collections.Dictionary>(this.PropertyGodotDictionary); return true; } - else if (name == PropertyName.PropertyGodotArray) { + if (name == PropertyName.PropertyGodotArray) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.Collections.Array>(this.PropertyGodotArray); return true; } - else if (name == PropertyName.PropertyGodotGenericDictionary) { + if (name == PropertyName.PropertyGodotGenericDictionary) { value = global::Godot.NativeInterop.VariantUtils.CreateFromDictionary(this.PropertyGodotGenericDictionary); return true; } - else if (name == PropertyName.PropertyGodotGenericArray) { + if (name == PropertyName.PropertyGodotGenericArray) { value = global::Godot.NativeInterop.VariantUtils.CreateFromArray(this.PropertyGodotGenericArray); return true; } - else if (name == PropertyName._notGeneratePropertyString) { + if (name == PropertyName._notGeneratePropertyString) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this._notGeneratePropertyString); return true; } - else if (name == PropertyName._notGeneratePropertyInt) { + if (name == PropertyName._notGeneratePropertyInt) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<int>(this._notGeneratePropertyInt); return true; } - else if (name == PropertyName._fullPropertyString) { + if (name == PropertyName._fullPropertyString) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this._fullPropertyString); return true; } - else if (name == PropertyName._fullPropertyStringComplex) { + if (name == PropertyName._fullPropertyStringComplex) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this._fullPropertyStringComplex); return true; } - else if (name == PropertyName._lamdaPropertyString) { + if (name == PropertyName._lamdaPropertyString) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this._lamdaPropertyString); return true; } diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/MixedReadOnlyWriteOnly_ScriptProperties.generated.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/MixedReadOnlyWriteOnly_ScriptProperties.generated.cs index 91f808f55e..cabdbe8d99 100644 --- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/MixedReadOnlyWriteOnly_ScriptProperties.generated.cs +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/MixedReadOnlyWriteOnly_ScriptProperties.generated.cs @@ -41,7 +41,7 @@ partial class MixedReadOnlyWriteOnly this.WriteOnlyProperty = global::Godot.NativeInterop.VariantUtils.ConvertTo<bool>(value); return true; } - else if (name == PropertyName._writeOnlyBackingField) { + if (name == PropertyName._writeOnlyBackingField) { this._writeOnlyBackingField = global::Godot.NativeInterop.VariantUtils.ConvertTo<bool>(value); return true; } @@ -55,19 +55,19 @@ partial class MixedReadOnlyWriteOnly value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.ReadOnlyAutoProperty); return true; } - else if (name == PropertyName.ReadOnlyProperty) { + if (name == PropertyName.ReadOnlyProperty) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.ReadOnlyProperty); return true; } - else if (name == PropertyName.InitOnlyAutoProperty) { + if (name == PropertyName.InitOnlyAutoProperty) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.InitOnlyAutoProperty); return true; } - else if (name == PropertyName.ReadOnlyField) { + if (name == PropertyName.ReadOnlyField) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<string>(this.ReadOnlyField); return true; } - else if (name == PropertyName._writeOnlyBackingField) { + if (name == PropertyName._writeOnlyBackingField) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<bool>(this._writeOnlyBackingField); return true; } diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ScriptBoilerplate_ScriptMethods.generated.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ScriptBoilerplate_ScriptMethods.generated.cs index 8656f4617e..a6e58bf27d 100644 --- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ScriptBoilerplate_ScriptMethods.generated.cs +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ScriptBoilerplate_ScriptMethods.generated.cs @@ -54,7 +54,7 @@ partial class ScriptBoilerplate if (method == MethodName._Process) { return true; } - else if (method == MethodName.Bazz) { + if (method == MethodName.Bazz) { return true; } return base.HasGodotClassMethod(method); diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ScriptBoilerplate_ScriptProperties.generated.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ScriptBoilerplate_ScriptProperties.generated.cs index 09368b7ab6..81cc27502f 100644 --- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ScriptBoilerplate_ScriptProperties.generated.cs +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators.Tests/TestData/GeneratedSources/ScriptBoilerplate_ScriptProperties.generated.cs @@ -25,7 +25,7 @@ partial class ScriptBoilerplate this._nodePath = global::Godot.NativeInterop.VariantUtils.ConvertTo<global::Godot.NodePath>(value); return true; } - else if (name == PropertyName._velocity) { + if (name == PropertyName._velocity) { this._velocity = global::Godot.NativeInterop.VariantUtils.ConvertTo<int>(value); return true; } @@ -39,7 +39,7 @@ partial class ScriptBoilerplate value = global::Godot.NativeInterop.VariantUtils.CreateFrom<global::Godot.NodePath>(this._nodePath); return true; } - else if (name == PropertyName._velocity) { + if (name == PropertyName._velocity) { value = global::Godot.NativeInterop.VariantUtils.CreateFrom<int>(this._velocity); return true; } diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptMethodsGenerator.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptMethodsGenerator.cs index f314f7dada..39d3a6f94e 100644 --- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptMethodsGenerator.cs +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptMethodsGenerator.cs @@ -253,11 +253,9 @@ namespace Godot.SourceGenerators source.Append(" [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]\n"); source.Append(" protected override bool HasGodotClassMethod(in godot_string_name method)\n {\n"); - bool isFirstEntry = true; foreach (string methodName in distinctMethodNames) { - GenerateHasMethodEntry(methodName, source, isFirstEntry); - isFirstEntry = false; + GenerateHasMethodEntry(methodName, source); } source.Append(" return base.HasGodotClassMethod(method);\n"); @@ -412,13 +410,10 @@ namespace Godot.SourceGenerators private static void GenerateHasMethodEntry( string methodName, - StringBuilder source, - bool isFirstEntry + StringBuilder source ) { source.Append(" "); - if (!isFirstEntry) - source.Append("else "); source.Append("if (method == MethodName."); source.Append(methodName); source.Append(") {\n return true;\n }\n"); diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertiesGenerator.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertiesGenerator.cs index a25a2c2f68..02c2cd4034 100644 --- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertiesGenerator.cs +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptPropertiesGenerator.cs @@ -172,7 +172,6 @@ namespace Godot.SourceGenerators if (godotClassProperties.Length > 0 || godotClassFields.Length > 0) { - bool isFirstEntry; // Generate SetGodotClassPropertyValue @@ -186,15 +185,13 @@ namespace Godot.SourceGenerators source.Append(" protected override bool SetGodotClassPropertyValue(in godot_string_name name, "); source.Append("in godot_variant value)\n {\n"); - isFirstEntry = true; foreach (var property in godotClassProperties) { if (property.PropertySymbol.IsReadOnly || property.PropertySymbol.SetMethod!.IsInitOnly) continue; GeneratePropertySetter(property.PropertySymbol.Name, - property.PropertySymbol.Type, property.Type, source, isFirstEntry); - isFirstEntry = false; + property.PropertySymbol.Type, property.Type, source); } foreach (var field in godotClassFields) @@ -203,8 +200,7 @@ namespace Godot.SourceGenerators continue; GeneratePropertySetter(field.FieldSymbol.Name, - field.FieldSymbol.Type, field.Type, source, isFirstEntry); - isFirstEntry = false; + field.FieldSymbol.Type, field.Type, source); } source.Append(" return base.SetGodotClassPropertyValue(name, value);\n"); @@ -222,22 +218,19 @@ namespace Godot.SourceGenerators source.Append(" protected override bool GetGodotClassPropertyValue(in godot_string_name name, "); source.Append("out godot_variant value)\n {\n"); - isFirstEntry = true; foreach (var property in godotClassProperties) { if (property.PropertySymbol.IsWriteOnly) continue; GeneratePropertyGetter(property.PropertySymbol.Name, - property.PropertySymbol.Type, property.Type, source, isFirstEntry); - isFirstEntry = false; + property.PropertySymbol.Type, property.Type, source); } foreach (var field in godotClassFields) { GeneratePropertyGetter(field.FieldSymbol.Name, - field.FieldSymbol.Type, field.Type, source, isFirstEntry); - isFirstEntry = false; + field.FieldSymbol.Type, field.Type, source); } source.Append(" return base.GetGodotClassPropertyValue(name, out value);\n"); @@ -318,15 +311,11 @@ namespace Godot.SourceGenerators string propertyMemberName, ITypeSymbol propertyTypeSymbol, MarshalType propertyMarshalType, - StringBuilder source, - bool isFirstEntry + StringBuilder source ) { source.Append(" "); - if (!isFirstEntry) - source.Append("else "); - source.Append("if (name == PropertyName.") .Append(propertyMemberName) .Append(") {\n") @@ -343,15 +332,11 @@ namespace Godot.SourceGenerators string propertyMemberName, ITypeSymbol propertyTypeSymbol, MarshalType propertyMarshalType, - StringBuilder source, - bool isFirstEntry + StringBuilder source ) { source.Append(" "); - if (!isFirstEntry) - source.Append("else "); - source.Append("if (name == PropertyName.") .Append(propertyMemberName) .Append(") {\n") diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptSignalsGenerator.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptSignalsGenerator.cs index 107bd93faa..deac5f2bcf 100644 --- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptSignalsGenerator.cs +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ScriptSignalsGenerator.cs @@ -319,11 +319,9 @@ namespace Godot.SourceGenerators source.Append( " protected override bool HasGodotClassSignal(in godot_string_name signal)\n {\n"); - bool isFirstEntry = true; foreach (var signal in godotSignalDelegates) { - GenerateHasSignalEntry(signal.Name, source, isFirstEntry); - isFirstEntry = false; + GenerateHasSignalEntry(signal.Name, source); } source.Append(" return base.HasGodotClassSignal(signal);\n"); @@ -473,13 +471,10 @@ namespace Godot.SourceGenerators private static void GenerateHasSignalEntry( string signalName, - StringBuilder source, - bool isFirstEntry + StringBuilder source ) { source.Append(" "); - if (!isFirstEntry) - source.Append("else "); source.Append("if (signal == SignalName."); source.Append(signalName); source.Append(") {\n return true;\n }\n"); diff --git a/modules/mono/editor/GodotTools/GodotTools/Build/BuildProblemsView.cs b/modules/mono/editor/GodotTools/GodotTools/Build/BuildProblemsView.cs index b6d6d9ebf8..35a62a0eab 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Build/BuildProblemsView.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Build/BuildProblemsView.cs @@ -280,7 +280,7 @@ namespace GodotTools.Build if (_problemsContextMenu.ItemCount > 0) { - _problemsContextMenu.Position = (Vector2I)(_problemsTree.GlobalPosition + position); + _problemsContextMenu.Position = (Vector2I)(GetScreenPosition() + position); _problemsContextMenu.Popup(); } } diff --git a/modules/multiplayer/editor/editor_network_profiler.cpp b/modules/multiplayer/editor/editor_network_profiler.cpp index a45e5ffdc0..75941207c7 100644 --- a/modules/multiplayer/editor/editor_network_profiler.cpp +++ b/modules/multiplayer/editor/editor_network_profiler.cpp @@ -260,12 +260,12 @@ EditorNetworkProfiler::EditorNetworkProfiler() { activate = memnew(Button); activate->set_toggle_mode(true); activate->set_text(TTR("Start")); - activate->connect("pressed", callable_mp(this, &EditorNetworkProfiler::_activate_pressed)); + activate->connect(SceneStringName(pressed), callable_mp(this, &EditorNetworkProfiler::_activate_pressed)); hb->add_child(activate); clear_button = memnew(Button); clear_button->set_text(TTR("Clear")); - clear_button->connect("pressed", callable_mp(this, &EditorNetworkProfiler::_clear_pressed)); + clear_button->connect(SceneStringName(pressed), callable_mp(this, &EditorNetworkProfiler::_clear_pressed)); hb->add_child(clear_button); hb->add_spacer(); diff --git a/modules/multiplayer/editor/multiplayer_editor_plugin.cpp b/modules/multiplayer/editor/multiplayer_editor_plugin.cpp index 29ebc38edf..a496f5dfa2 100644 --- a/modules/multiplayer/editor/multiplayer_editor_plugin.cpp +++ b/modules/multiplayer/editor/multiplayer_editor_plugin.cpp @@ -116,7 +116,7 @@ MultiplayerEditorPlugin::MultiplayerEditorPlugin() { repl_editor = memnew(ReplicationEditor); button = EditorNode::get_bottom_panel()->add_item(TTR("Replication"), repl_editor, ED_SHORTCUT_AND_COMMAND("bottom_panels/toggle_replication_bottom_panel", TTR("Toggle Replication Bottom Panel"))); button->hide(); - repl_editor->get_pin()->connect("pressed", callable_mp(this, &MultiplayerEditorPlugin::_pinned)); + repl_editor->get_pin()->connect(SceneStringName(pressed), callable_mp(this, &MultiplayerEditorPlugin::_pinned)); debugger.instantiate(); debugger->connect("open_request", callable_mp(this, &MultiplayerEditorPlugin::_open_request)); } diff --git a/modules/multiplayer/editor/replication_editor.cpp b/modules/multiplayer/editor/replication_editor.cpp index 08e7ba360a..3cc0a5ae53 100644 --- a/modules/multiplayer/editor/replication_editor.cpp +++ b/modules/multiplayer/editor/replication_editor.cpp @@ -244,7 +244,7 @@ ReplicationEditor::ReplicationEditor() { vb->add_child(hb); add_pick_button = memnew(Button); - add_pick_button->connect("pressed", callable_mp(this, &ReplicationEditor::_pick_new_property)); + add_pick_button->connect(SceneStringName(pressed), callable_mp(this, &ReplicationEditor::_pick_new_property)); add_pick_button->set_text(TTR("Add property to sync...")); hb->add_child(add_pick_button); @@ -260,7 +260,7 @@ ReplicationEditor::ReplicationEditor() { hb->add_child(np_line_edit); add_from_path_button = memnew(Button); - add_from_path_button->connect("pressed", callable_mp(this, &ReplicationEditor::_add_pressed)); + add_from_path_button->connect(SceneStringName(pressed), callable_mp(this, &ReplicationEditor::_add_pressed)); add_from_path_button->set_text(TTR("Add from path")); hb->add_child(add_from_path_button); diff --git a/modules/multiplayer/multiplayer_spawner.cpp b/modules/multiplayer/multiplayer_spawner.cpp index 6c0669b2f3..2408d7231b 100644 --- a/modules/multiplayer/multiplayer_spawner.cpp +++ b/modules/multiplayer/multiplayer_spawner.cpp @@ -33,7 +33,6 @@ #include "core/io/marshalls.h" #include "scene/main/multiplayer_api.h" #include "scene/main/window.h" -#include "scene/scene_string_names.h" #ifdef TOOLS_ENABLED /* This is editor only */ @@ -216,7 +215,7 @@ void MultiplayerSpawner::_notification(int p_what) { for (const KeyValue<ObjectID, SpawnInfo> &E : tracked_nodes) { Node *node = Object::cast_to<Node>(ObjectDB::get_instance(E.key)); ERR_CONTINUE(!node); - node->disconnect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &MultiplayerSpawner::_node_exit)); + node->disconnect(SceneStringName(tree_exiting), callable_mp(this, &MultiplayerSpawner::_node_exit)); get_multiplayer()->object_configuration_remove(node, this); } tracked_nodes.clear(); @@ -258,7 +257,7 @@ void MultiplayerSpawner::_track(Node *p_node, const Variant &p_argument, int p_s ObjectID oid = p_node->get_instance_id(); if (!tracked_nodes.has(oid)) { tracked_nodes[oid] = SpawnInfo(p_argument.duplicate(true), p_scene_id); - p_node->connect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &MultiplayerSpawner::_node_exit).bind(p_node->get_instance_id()), CONNECT_ONE_SHOT); + p_node->connect(SceneStringName(tree_exiting), callable_mp(this, &MultiplayerSpawner::_node_exit).bind(p_node->get_instance_id()), CONNECT_ONE_SHOT); _spawn_notify(p_node->get_instance_id()); } } diff --git a/modules/multiplayer/multiplayer_synchronizer.cpp b/modules/multiplayer/multiplayer_synchronizer.cpp index c2ce500af8..ca3fa43207 100644 --- a/modules/multiplayer/multiplayer_synchronizer.cpp +++ b/modules/multiplayer/multiplayer_synchronizer.cpp @@ -343,7 +343,7 @@ void MultiplayerSynchronizer::update_visibility(int p_for_peer) { #endif Node *node = is_inside_tree() ? get_node_or_null(root_path) : nullptr; if (node && get_multiplayer()->has_multiplayer_peer() && is_multiplayer_authority()) { - emit_signal(SNAME("visibility_changed"), p_for_peer); + emit_signal(SceneStringName(visibility_changed), p_for_peer); } } diff --git a/modules/multiplayer/scene_cache_interface.cpp b/modules/multiplayer/scene_cache_interface.cpp index c08ccbe4cc..2ea9ce8819 100644 --- a/modules/multiplayer/scene_cache_interface.cpp +++ b/modules/multiplayer/scene_cache_interface.cpp @@ -35,14 +35,13 @@ #include "core/io/marshalls.h" #include "scene/main/node.h" #include "scene/main/window.h" -#include "scene/scene_string_names.h" SceneCacheInterface::NodeCache &SceneCacheInterface::_track(Node *p_node) { const ObjectID oid = p_node->get_instance_id(); NodeCache *nc = nodes_cache.getptr(oid); if (!nc) { nodes_cache[oid] = NodeCache(); - p_node->connect(SceneStringNames::get_singleton()->tree_exited, callable_mp(this, &SceneCacheInterface::_remove_node_cache).bind(oid), Object::CONNECT_ONE_SHOT); + p_node->connect(SceneStringName(tree_exited), callable_mp(this, &SceneCacheInterface::_remove_node_cache).bind(oid), Object::CONNECT_ONE_SHOT); } return nodes_cache[oid]; } @@ -286,7 +285,7 @@ void SceneCacheInterface::clear() { for (KeyValue<ObjectID, NodeCache> &E : nodes_cache) { Object *obj = ObjectDB::get_instance(E.key); ERR_CONTINUE(!obj); - obj->disconnect(SceneStringNames::get_singleton()->tree_exited, callable_mp(this, &SceneCacheInterface::_remove_node_cache)); + obj->disconnect(SceneStringName(tree_exited), callable_mp(this, &SceneCacheInterface::_remove_node_cache)); } peers_info.clear(); nodes_cache.clear(); diff --git a/modules/multiplayer/scene_replication_interface.cpp b/modules/multiplayer/scene_replication_interface.cpp index 182e9b455c..edc66c876c 100644 --- a/modules/multiplayer/scene_replication_interface.cpp +++ b/modules/multiplayer/scene_replication_interface.cpp @@ -35,7 +35,6 @@ #include "core/debugger/engine_debugger.h" #include "core/io/marshalls.h" #include "scene/main/node.h" -#include "scene/scene_string_names.h" #define MAKE_ROOM(m_amount) \ if (packet_cache.size() < m_amount) \ @@ -57,7 +56,7 @@ SceneReplicationInterface::TrackedNode &SceneReplicationInterface::_track(const if (!tracked_nodes.has(p_id)) { tracked_nodes[p_id] = TrackedNode(p_id); Node *node = get_id_as<Node>(p_id); - node->connect(SceneStringNames::get_singleton()->tree_exited, callable_mp(this, &SceneReplicationInterface::_untrack).bind(p_id), Node::CONNECT_ONE_SHOT); + node->connect(SceneStringName(tree_exited), callable_mp(this, &SceneReplicationInterface::_untrack).bind(p_id), Node::CONNECT_ONE_SHOT); } return tracked_nodes[p_id]; } @@ -135,8 +134,8 @@ void SceneReplicationInterface::on_network_process() { for (const ObjectID &oid : spawn_queue) { Node *node = get_id_as<Node>(oid); ERR_CONTINUE(!node); - if (node->is_connected(SceneStringNames::get_singleton()->ready, callable_mp(this, &SceneReplicationInterface::_node_ready))) { - node->disconnect(SceneStringNames::get_singleton()->ready, callable_mp(this, &SceneReplicationInterface::_node_ready)); + if (node->is_connected(SceneStringName(ready), callable_mp(this, &SceneReplicationInterface::_node_ready))) { + node->disconnect(SceneStringName(ready), callable_mp(this, &SceneReplicationInterface::_node_ready)); } } spawn_queue.clear(); @@ -168,7 +167,7 @@ Error SceneReplicationInterface::on_spawn(Object *p_obj, Variant p_config) { ERR_FAIL_COND_V(tobj.spawner != ObjectID(), ERR_ALREADY_IN_USE); tobj.spawner = spawner->get_instance_id(); spawn_queue.insert(oid); - node->connect(SceneStringNames::get_singleton()->ready, callable_mp(this, &SceneReplicationInterface::_node_ready).bind(oid), Node::CONNECT_ONE_SHOT); + node->connect(SceneStringName(ready), callable_mp(this, &SceneReplicationInterface::_node_ready).bind(oid), Node::CONNECT_ONE_SHOT); return OK; } @@ -236,7 +235,7 @@ Error SceneReplicationInterface::on_replication_start(Object *p_obj, Variant p_c sync_nodes.insert(sid); // Update visibility. - sync->connect("visibility_changed", callable_mp(this, &SceneReplicationInterface::_visibility_changed).bind(sync->get_instance_id())); + sync->connect(SceneStringName(visibility_changed), callable_mp(this, &SceneReplicationInterface::_visibility_changed).bind(sync->get_instance_id())); _update_sync_visibility(0, sync); if (pending_spawn == p_obj->get_instance_id() && sync->get_multiplayer_authority() == pending_spawn_remote) { @@ -273,7 +272,7 @@ Error SceneReplicationInterface::on_replication_stop(Object *p_obj, Variant p_co ERR_FAIL_COND_V(!node || p_config.get_type() != Variant::OBJECT, ERR_INVALID_PARAMETER); MultiplayerSynchronizer *sync = Object::cast_to<MultiplayerSynchronizer>(p_config.get_validated_object()); ERR_FAIL_NULL_V(sync, ERR_INVALID_PARAMETER); - sync->disconnect("visibility_changed", callable_mp(this, &SceneReplicationInterface::_visibility_changed)); + sync->disconnect(SceneStringName(visibility_changed), callable_mp(this, &SceneReplicationInterface::_visibility_changed)); // Untrack synchronizer. const ObjectID oid = node->get_instance_id(); const ObjectID sid = sync->get_instance_id(); diff --git a/modules/navigation/editor/navigation_mesh_editor_plugin.cpp b/modules/navigation/editor/navigation_mesh_editor_plugin.cpp index d7bf1cdd38..d07d3cdff5 100644 --- a/modules/navigation/editor/navigation_mesh_editor_plugin.cpp +++ b/modules/navigation/editor/navigation_mesh_editor_plugin.cpp @@ -138,14 +138,14 @@ NavigationMeshEditor::NavigationMeshEditor() { button_bake->set_toggle_mode(true); button_bake->set_text(TTR("Bake NavigationMesh")); button_bake->set_tooltip_text(TTR("Bakes the NavigationMesh by first parsing the scene for source geometry and then creating the navigation mesh vertices and polygons.")); - button_bake->connect("pressed", callable_mp(this, &NavigationMeshEditor::_bake_pressed)); + button_bake->connect(SceneStringName(pressed), callable_mp(this, &NavigationMeshEditor::_bake_pressed)); button_reset = memnew(Button); button_reset->set_theme_type_variation("FlatButton"); bake_hbox->add_child(button_reset); button_reset->set_text(TTR("Clear NavigationMesh")); button_reset->set_tooltip_text(TTR("Clears the internal NavigationMesh vertices and polygons.")); - button_reset->connect("pressed", callable_mp(this, &NavigationMeshEditor::_clear_pressed)); + button_reset->connect(SceneStringName(pressed), callable_mp(this, &NavigationMeshEditor::_clear_pressed)); bake_info = memnew(Label); bake_hbox->add_child(bake_info); diff --git a/modules/noise/editor/noise_editor_plugin.cpp b/modules/noise/editor/noise_editor_plugin.cpp index 917fa0cd15..200f31cca1 100644 --- a/modules/noise/editor/noise_editor_plugin.cpp +++ b/modules/noise/editor/noise_editor_plugin.cpp @@ -67,7 +67,7 @@ public: _3d_space_switch->set_toggle_mode(true); _3d_space_switch->set_offset(SIDE_LEFT, PADDING_3D_SPACE_SWITCH); _3d_space_switch->set_offset(SIDE_TOP, PADDING_3D_SPACE_SWITCH); - _3d_space_switch->connect("pressed", callable_mp(this, &NoisePreview::_on_3d_button_pressed)); + _3d_space_switch->connect(SceneStringName(pressed), callable_mp(this, &NoisePreview::_on_3d_button_pressed)); add_child(_3d_space_switch); } diff --git a/modules/noise/noise_texture_2d.cpp b/modules/noise/noise_texture_2d.cpp index 0443fec4a0..0960b2ad36 100644 --- a/modules/noise/noise_texture_2d.cpp +++ b/modules/noise/noise_texture_2d.cpp @@ -119,6 +119,7 @@ void NoiseTexture2D::_set_texture_image(const Ref<Image> &p_image) { } else { texture = RS::get_singleton()->texture_2d_create(p_image); } + RS::get_singleton()->texture_set_path(texture, get_path()); } emit_changed(); } diff --git a/modules/openxr/editor/openxr_action_editor.cpp b/modules/openxr/editor/openxr_action_editor.cpp index 4b188471a0..06d2e8dcc9 100644 --- a/modules/openxr/editor/openxr_action_editor.cpp +++ b/modules/openxr/editor/openxr_action_editor.cpp @@ -159,7 +159,7 @@ OpenXRActionEditor::OpenXRActionEditor(Ref<OpenXRAction> p_action) { rem_action = memnew(Button); rem_action->set_tooltip_text(TTR("Remove action")); - rem_action->connect("pressed", callable_mp(this, &OpenXRActionEditor::_on_remove_action)); + rem_action->connect(SceneStringName(pressed), callable_mp(this, &OpenXRActionEditor::_on_remove_action)); rem_action->set_flat(true); add_child(rem_action); } diff --git a/modules/openxr/editor/openxr_action_map_editor.cpp b/modules/openxr/editor/openxr_action_map_editor.cpp index 5dd737756a..62b4a427b9 100644 --- a/modules/openxr/editor/openxr_action_map_editor.cpp +++ b/modules/openxr/editor/openxr_action_map_editor.cpp @@ -402,13 +402,13 @@ OpenXRActionMapEditor::OpenXRActionMapEditor() { add_action_set = memnew(Button); add_action_set->set_text(TTR("Add Action Set")); add_action_set->set_tooltip_text(TTR("Add an action set.")); - add_action_set->connect("pressed", callable_mp(this, &OpenXRActionMapEditor::_on_add_action_set)); + add_action_set->connect(SceneStringName(pressed), callable_mp(this, &OpenXRActionMapEditor::_on_add_action_set)); top_hb->add_child(add_action_set); add_interaction_profile = memnew(Button); add_interaction_profile->set_text(TTR("Add profile")); add_interaction_profile->set_tooltip_text(TTR("Add an interaction profile.")); - add_interaction_profile->connect("pressed", callable_mp(this, &OpenXRActionMapEditor::_on_add_interaction_profile)); + add_interaction_profile->connect(SceneStringName(pressed), callable_mp(this, &OpenXRActionMapEditor::_on_add_interaction_profile)); top_hb->add_child(add_interaction_profile); VSeparator *vseparator = memnew(VSeparator); @@ -417,13 +417,13 @@ OpenXRActionMapEditor::OpenXRActionMapEditor() { save_as = memnew(Button); save_as->set_text(TTR("Save")); save_as->set_tooltip_text(TTR("Save this OpenXR action map.")); - save_as->connect("pressed", callable_mp(this, &OpenXRActionMapEditor::_on_save_action_map)); + save_as->connect(SceneStringName(pressed), callable_mp(this, &OpenXRActionMapEditor::_on_save_action_map)); top_hb->add_child(save_as); _default = memnew(Button); _default->set_text(TTR("Reset to Default")); _default->set_tooltip_text(TTR("Reset to default OpenXR action map.")); - _default->connect("pressed", callable_mp(this, &OpenXRActionMapEditor::_on_reset_to_default_layout)); + _default->connect(SceneStringName(pressed), callable_mp(this, &OpenXRActionMapEditor::_on_reset_to_default_layout)); top_hb->add_child(_default); tabs = memnew(TabContainer); diff --git a/modules/openxr/editor/openxr_action_set_editor.cpp b/modules/openxr/editor/openxr_action_set_editor.cpp index 8b4a0e989c..5d9a3155fb 100644 --- a/modules/openxr/editor/openxr_action_set_editor.cpp +++ b/modules/openxr/editor/openxr_action_set_editor.cpp @@ -229,7 +229,7 @@ OpenXRActionSetEditor::OpenXRActionSetEditor(Ref<OpenXRActionMap> p_action_map, fold_btn = memnew(Button); fold_btn->set_v_size_flags(Control::SIZE_SHRINK_BEGIN); - fold_btn->connect("pressed", callable_mp(this, &OpenXRActionSetEditor::_on_toggle_expand)); + fold_btn->connect(SceneStringName(pressed), callable_mp(this, &OpenXRActionSetEditor::_on_toggle_expand)); fold_btn->set_flat(true); panel_hb->add_child(fold_btn); @@ -262,13 +262,13 @@ OpenXRActionSetEditor::OpenXRActionSetEditor(Ref<OpenXRActionMap> p_action_map, add_action = memnew(Button); add_action->set_tooltip_text(TTR("Add action.")); - add_action->connect("pressed", callable_mp(this, &OpenXRActionSetEditor::_on_add_action)); + add_action->connect(SceneStringName(pressed), callable_mp(this, &OpenXRActionSetEditor::_on_add_action)); add_action->set_flat(true); action_set_hb->add_child(add_action); rem_action_set = memnew(Button); rem_action_set->set_tooltip_text(TTR("Remove action set.")); - rem_action_set->connect("pressed", callable_mp(this, &OpenXRActionSetEditor::_on_remove_action_set)); + rem_action_set->connect(SceneStringName(pressed), callable_mp(this, &OpenXRActionSetEditor::_on_remove_action_set)); rem_action_set->set_flat(true); action_set_hb->add_child(rem_action_set); diff --git a/modules/openxr/editor/openxr_interaction_profile_editor.cpp b/modules/openxr/editor/openxr_interaction_profile_editor.cpp index da6a9eed70..ab36c0744e 100644 --- a/modules/openxr/editor/openxr_interaction_profile_editor.cpp +++ b/modules/openxr/editor/openxr_interaction_profile_editor.cpp @@ -222,7 +222,7 @@ void OpenXRInteractionProfileEditor::_add_io_path(VBoxContainer *p_container, co Button *path_add = memnew(Button); path_add->set_icon(get_theme_icon(SNAME("Add"), EditorStringName(EditorIcons))); path_add->set_flat(true); - path_add->connect("pressed", callable_mp(this, &OpenXRInteractionProfileEditor::select_action_for).bind(String(p_io_path->openxr_path))); + path_add->connect(SceneStringName(pressed), callable_mp(this, &OpenXRInteractionProfileEditor::select_action_for).bind(String(p_io_path->openxr_path))); path_hb->add_child(path_add); if (interaction_profile.is_valid()) { @@ -249,7 +249,7 @@ void OpenXRInteractionProfileEditor::_add_io_path(VBoxContainer *p_container, co Button *action_rem = memnew(Button); action_rem->set_flat(true); action_rem->set_icon(get_theme_icon(SNAME("Remove"), EditorStringName(EditorIcons))); - action_rem->connect("pressed", callable_mp((OpenXRInteractionProfileEditor *)this, &OpenXRInteractionProfileEditor::_on_remove_pressed).bind(action->get_name_with_set(), String(p_io_path->openxr_path))); + action_rem->connect(SceneStringName(pressed), callable_mp((OpenXRInteractionProfileEditor *)this, &OpenXRInteractionProfileEditor::_on_remove_pressed).bind(action->get_name_with_set(), String(p_io_path->openxr_path))); action_hb->add_child(action_rem); } } diff --git a/modules/openxr/editor/openxr_select_action_dialog.cpp b/modules/openxr/editor/openxr_select_action_dialog.cpp index 8eec54be63..de0ab40f9e 100644 --- a/modules/openxr/editor/openxr_select_action_dialog.cpp +++ b/modules/openxr/editor/openxr_select_action_dialog.cpp @@ -97,7 +97,7 @@ void OpenXRSelectActionDialog::open() { String action_name = action->get_name_with_set(); action_button->set_flat(true); action_button->set_text(action->get_name() + ": " + action->get_localized_name()); - action_button->connect("pressed", callable_mp(this, &OpenXRSelectActionDialog::_on_select_action).bind(action_name)); + action_button->connect(SceneStringName(pressed), callable_mp(this, &OpenXRSelectActionDialog::_on_select_action).bind(action_name)); action_hb->add_child(action_button); action_buttons[action_name] = action_button->get_path(); diff --git a/modules/openxr/editor/openxr_select_interaction_profile_dialog.cpp b/modules/openxr/editor/openxr_select_interaction_profile_dialog.cpp index 8fd66fac04..e6705d5c82 100644 --- a/modules/openxr/editor/openxr_select_interaction_profile_dialog.cpp +++ b/modules/openxr/editor/openxr_select_interaction_profile_dialog.cpp @@ -82,7 +82,7 @@ void OpenXRSelectInteractionProfileDialog::open(PackedStringArray p_do_not_inclu Button *ip_button = memnew(Button); ip_button->set_flat(true); ip_button->set_text(OpenXRInteractionProfileMetadata::get_singleton()->get_profile(path)->display_name); - ip_button->connect("pressed", callable_mp(this, &OpenXRSelectInteractionProfileDialog::_on_select_interaction_profile).bind(path)); + ip_button->connect(SceneStringName(pressed), callable_mp(this, &OpenXRSelectInteractionProfileDialog::_on_select_interaction_profile).bind(path)); main_vb->add_child(ip_button); ip_buttons[path] = ip_button->get_path(); diff --git a/modules/openxr/extensions/openxr_composition_layer_extension.cpp b/modules/openxr/extensions/openxr_composition_layer_extension.cpp index fb21c45fd8..994b08af53 100644 --- a/modules/openxr/extensions/openxr_composition_layer_extension.cpp +++ b/modules/openxr/extensions/openxr_composition_layer_extension.cpp @@ -286,7 +286,7 @@ bool OpenXRViewportCompositionLayerProvider::update_and_acquire_swapchain(bool p // Create our new swap chain int64_t swapchain_format = openxr_api->get_color_swapchain_format(); - const uint32_t sample_count = 3; + const uint32_t sample_count = 1; const uint32_t array_size = 1; XrSwapchainCreateFlags create_flags = 0; if (p_static_image) { diff --git a/modules/svg/SCsub b/modules/svg/SCsub index 0e21c1e6d7..a32be0e41a 100644 --- a/modules/svg/SCsub +++ b/modules/svg/SCsub @@ -26,7 +26,6 @@ thirdparty_sources = [ "src/loaders/raw/tvgRawLoader.cpp", # image loaders "src/loaders/external_png/tvgPngLoader.cpp", - "src/loaders/external_webp/tvgWebpLoader.cpp", "src/loaders/jpg/tvgJpgd.cpp", "src/loaders/jpg/tvgJpgLoader.cpp", # renderer common @@ -59,6 +58,10 @@ thirdparty_sources = [ "src/renderer/sw_engine/tvgSwStroke.cpp", ] +if env["module_webp_enabled"]: + thirdparty_sources += ["src/loaders/external_webp/tvgWebpLoader.cpp"] + env_svg.Append(CPPDEFINES=["THORVG_WEBP_LOADER_SUPPORT"]) + thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] env_svg.Prepend(CPPPATH=[thirdparty_dir + "inc"]) @@ -76,12 +79,15 @@ env_thirdparty.Prepend( thirdparty_dir + "src/renderer/sw_engine", thirdparty_dir + "src/loaders/raw", thirdparty_dir + "src/loaders/external_png", - thirdparty_dir + "src/loaders/external_webp", thirdparty_dir + "src/loaders/jpg", - "#thirdparty/libpng", - "#thirdparty/libwebp/src", ] ) +if env["builtin_libpng"]: + env_thirdparty.Prepend(CPPPATH=["#thirdparty/libpng"]) +if env["module_webp_enabled"]: + env_thirdparty.Prepend(CPPPATH=[thirdparty_dir + "src/loaders/external_webp"]) + if env["builtin_libwebp"]: + env_thirdparty.Prepend(CPPPATH=["#thirdparty/libwebp/src"]) env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources) env.modules_sources += thirdparty_obj diff --git a/modules/text_server_adv/SCsub b/modules/text_server_adv/SCsub index 15695476de..68a5d499d4 100644 --- a/modules/text_server_adv/SCsub +++ b/modules/text_server_adv/SCsub @@ -468,7 +468,7 @@ if env["builtin_icu4c"]: ] thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] - icu_data_name = "icudt74l.dat" + icu_data_name = "icudt75l.dat" if env.editor_build: env_icu.Depends("#thirdparty/icu4c/icudata.gen.h", "#thirdparty/icu4c/" + icu_data_name) diff --git a/modules/text_server_adv/gdextension_build/SConstruct b/modules/text_server_adv/gdextension_build/SConstruct index fcf3f64315..018984a52f 100644 --- a/modules/text_server_adv/gdextension_build/SConstruct +++ b/modules/text_server_adv/gdextension_build/SConstruct @@ -703,7 +703,7 @@ thirdparty_icu_sources = [ ] thirdparty_icu_sources = [thirdparty_icu_dir + file for file in thirdparty_icu_sources] -icu_data_name = "icudt74l.dat" +icu_data_name = "icudt75l.dat" if env["static_icu_data"]: env_icu.Depends("../../../thirdparty/icu4c/icudata.gen.h", "../../../thirdparty/icu4c/" + icu_data_name) diff --git a/modules/webp/SCsub b/modules/webp/SCsub index e78236a60b..dde4450c23 100644 --- a/modules/webp/SCsub +++ b/modules/webp/SCsub @@ -128,6 +128,7 @@ if env["builtin_libwebp"]: "src/utils/filters_utils.c", "src/utils/huffman_encode_utils.c", "src/utils/huffman_utils.c", + "src/utils/palette.c", "src/utils/quant_levels_dec_utils.c", "src/utils/quant_levels_utils.c", "src/utils/random_utils.c", diff --git a/modules/webxr/webxr_interface_js.cpp b/modules/webxr/webxr_interface_js.cpp index 45c1d8ec06..916566fc1b 100644 --- a/modules/webxr/webxr_interface_js.cpp +++ b/modules/webxr/webxr_interface_js.cpp @@ -39,6 +39,7 @@ #include "drivers/gles3/storage/texture_storage.h" #include "scene/main/scene_tree.h" #include "scene/main/window.h" +#include "scene/scene_string_names.h" #include "servers/rendering/renderer_compositor.h" #include "servers/rendering/rendering_server_globals.h" #include "servers/xr/xr_hand_tracker.h" @@ -641,7 +642,7 @@ void WebXRInterfaceJS::_update_input_source(int p_input_source_id) { } Transform3D aim_transform = _js_matrix_to_transform(target_pose); - tracker->set_pose(SNAME("default"), aim_transform, Vector3(), Vector3()); + tracker->set_pose(SceneStringName(default_), aim_transform, Vector3(), Vector3()); tracker->set_pose(SNAME("aim"), aim_transform, Vector3(), Vector3()); if (has_grip_pose) { tracker->set_pose(SNAME("grip"), _js_matrix_to_transform(grip_pose), Vector3(), Vector3()); |