Fix T48806: mesh.materials.clear() does not decrement users counts.
This commit is contained in:
parent
70cf77e1ce
commit
c8bf45c323
Notes:
blender-bot
2023-06-21 19:23:24 +02:00
Referenced by issue #46806, mesh.materials.clear() does not decrement users counts
|
@ -669,6 +669,10 @@ void BKE_material_clear_id(struct ID *id, bool update_data)
|
|||
Material ***matar;
|
||||
if ((matar = give_matarar_id(id))) {
|
||||
short *totcol = give_totcolp_id(id);
|
||||
|
||||
while ((*totcol)--) {
|
||||
id_us_min((ID *)((*matar)[*totcol]));
|
||||
}
|
||||
*totcol = 0;
|
||||
if (*matar) {
|
||||
MEM_freeN(*matar);
|
||||
|
|
Loading…
Reference in New Issue