Merge pull request #115528 from akshat-loya/master

Fix extracting materials from `.gltf` and `.blend` files throws error
This commit is contained in:
Thaddeus Crews 2026-02-27 08:49:27 -06:00
commit 2c9ba44815
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC

View file

@ -1599,7 +1599,7 @@ Node *ResourceImporterScene::_post_fix_node(Node *p_node, Node *p_root, HashMap<
post_importer_plugins.write[j]->internal_process(EditorScenePostImportPlugin::INTERNAL_IMPORT_CATEGORY_MATERIAL, p_root, p_node, mat, matdata);
}
}
if (!mat_id.is_empty() && extract_mat != 0) {
if (!mat_id.is_empty() && p_material_data.has(mat_id) && extract_mat != 0) {
String ext = material_extension[p_options.has("materials/extract_format") ? (int)p_options["materials/extract_format"] : 0];
String path = spath.path_join(mat_id.validate_filename() + ext);
String uid_path = ResourceUID::path_to_uid(path);