Encountered this while swapping some materials in my scene to use a shared file, which caused some polys on preexisting meshes to point to invalid materials. On validation, mesh_object.material_slots[polygon.material_index] threw a very vague exception that took me a few hours to track down. Now instead, it will raise an error point to the exact mesh + polygon that is invalid.
Encountered this while swapping some materials in my scene to use a shared file, which caused some polys on preexisting meshes to point to invalid materials. On validation,
mesh_object.material_slots[polygon.material_index]
threw a very vague exception that took me a few hours to track down. Now instead, it will raise an error point to the exact mesh + polygon that is invalid.