From 1dc7bcc83c81b32c3651f3fa869055a0cce22085 Mon Sep 17 00:00:00 2001 From: kobewi Date: Fri, 1 Apr 2022 20:30:23 +0200 Subject: Cleanup metadata usage --- editor/import/resource_importer_scene.cpp | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) (limited to 'editor/import') diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp index 34079d0a4b..06a84ff23c 100644 --- a/editor/import/resource_importer_scene.cpp +++ b/editor/import/resource_importer_scene.cpp @@ -715,13 +715,7 @@ Node *ResourceImporterScene::_post_fix_node(Node *p_node, Node *p_root, Maphas_meta("import_id")) { - import_id = p_node->get_meta("import_id"); - } else { - import_id = "PATH:" + p_root->get_path_to(p_node); - } + String import_id = p_node->get_meta("import_id", "PATH:" + p_root->get_path_to(p_node)); Dictionary node_settings; if (p_node_data.has(import_id)) { @@ -763,12 +757,7 @@ Node *ResourceImporterScene::_post_fix_node(Node *p_node, Node *p_root, Mapget_surface_count(); i++) { Ref mat = m->get_surface_material(i); if (mat.is_valid()) { - String mat_id; - if (mat->has_meta("import_id")) { - mat_id = mat->get_meta("import_id"); - } else { - mat_id = mat->get_name(); - } + String mat_id = mat->get_meta("import_id", mat->get_name()); if (!mat_id.is_empty() && p_material_data.has(mat_id)) { Dictionary matdata = p_material_data[mat_id]; @@ -1591,13 +1580,7 @@ void ResourceImporterScene::_generate_meshes(Node *p_node, const Dictionary &p_m bool bake_lightmaps = p_light_bake_mode == LIGHT_BAKE_STATIC_LIGHTMAPS; String save_to_file; - String mesh_id; - - if (src_mesh_node->get_mesh()->has_meta("import_id")) { - mesh_id = src_mesh_node->get_mesh()->get_meta("import_id"); - } else { - mesh_id = src_mesh_node->get_mesh()->get_name(); - } + String mesh_id = src_mesh_node->get_mesh()->get_meta("import_id", src_mesh_node->get_mesh()->get_name()); if (!mesh_id.is_empty() && p_mesh_data.has(mesh_id)) { Dictionary mesh_settings = p_mesh_data[mesh_id]; -- cgit v1.2.3