diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2019-07-31 18:18:04 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2019-07-31 18:18:21 +0300 |
commit | 92a3995c6d4487e5bc0735b35fbef5c34b29421a (patch) | |
tree | 11bccd748a2b7ec963adead53be55a39c780ecb4 /source/blender/blenkernel/intern/material.c | |
parent | 3566b81c8bfa8c69d542a5de29ecb8d5af3ccb3d (diff) |
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.
Diffstat (limited to 'source/blender/blenkernel/intern/material.c')
-rw-r--r-- | source/blender/blenkernel/intern/material.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index 6fdc1995ca5..391af8b96ab 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -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 */ |