Fix T67999: calling obj.data.materials.clear() crashes Blender

The `BKE_material_clear_id()` didn't call `test_all_objects_materials()`,
which caused the object and mesh material slot count to go out of sync.
This commit is contained in:
Sybren A. Stüvel 2019-07-31 17:18:04 +02:00
parent 3566b81c8b
commit 92a3995c6d
Notes: blender-bot 2023-02-14 01:26:56 +01:00
Referenced by issue #67999, calling obj.data.materials.clear() on an object with 2+ materials in lookdev or rendered(eevee) shading crashes Blender
1 changed files with 1 additions and 0 deletions

View File

@ -496,6 +496,7 @@ void BKE_material_clear_id(Main *bmain, ID *id, bool update_data)
MEM_freeN(*matar);
*matar = NULL;
}
test_all_objects_materials(bmain, id);
if (update_data) {
/* decrease mat_nr index */