Fix #5265. Accommodate invalid material sets.

This commit is contained in:
Dion Moult
2024-09-01 07:53:42 +10:00
parent ec21574be5
commit b476cb825c
2 changed files with 4 additions and 4 deletions
@@ -1712,7 +1712,7 @@ class LoadLinkedProject(bpy.types.Operator):
mesh.polygons.foreach_set("loop_total", loop_total)
mesh.polygons.foreach_set("use_smooth", [0] * total_faces)
if material_ids.size > 0:
if material_ids.size > 0 and len(mesh.polygons) == len(material_ids):
mesh.polygons.foreach_set("material_index", material_ids)
mesh.update()