Fix T49228: Separate by material, materials dissappear after reload.

Yet another mismatch where code would decrease usercount (of Material here) but never increase it again
when re-assigning the datablock...
This commit is contained in:
Bastien Montagne 2016-09-03 12:51:50 +02:00 committed by Sergey Sharybin
parent 894a4f5230
commit ab934e7d61
1 changed files with 2 additions and 0 deletions

View File

@ -3121,8 +3121,10 @@ static void mesh_separate_material_assign_mat_nr(Main *bmain, Object *ob, const
BKE_material_resize_id(bmain, obdata, 1, true);
ob->mat[0] = ma_ob;
id_us_plus((ID *)ma_ob);
ob->matbits[0] = matbit;
(*matarar)[0] = ma_obdata;
id_us_plus((ID *)ma_obdata);
}
else {
BKE_material_clear_id(bmain, obdata, true);