mirror of
https://github.com/godotengine/godot.git
synced 2025-01-18 20:40:57 +08:00
Merge pull request #94102 from Calinou/obj-import-fix-no-surfaces-error
Fix error message being printed when importing an OBJ with no surfaces
This commit is contained in:
commit
6d2fe76084
@ -425,9 +425,13 @@ static Error _parse_obj(const String &p_path, List<Ref<ImporterMesh>> &r_meshes,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!current_material.is_empty()) {
|
if (!current_material.is_empty()) {
|
||||||
mesh->set_surface_name(mesh->get_surface_count() - 1, current_material.get_basename());
|
if (mesh->get_surface_count() >= 1) {
|
||||||
|
mesh->set_surface_name(mesh->get_surface_count() - 1, current_material.get_basename());
|
||||||
|
}
|
||||||
} else if (!current_group.is_empty()) {
|
} else if (!current_group.is_empty()) {
|
||||||
mesh->set_surface_name(mesh->get_surface_count() - 1, current_group);
|
if (mesh->get_surface_count() >= 1) {
|
||||||
|
mesh->set_surface_name(mesh->get_surface_count() - 1, current_group);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Array array = surf_tool->commit_to_arrays();
|
Array array = surf_tool->commit_to_arrays();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user