Material slots: on adding a new one, the material datablock is now copied again

like in 2.4x. This can result in material datablocks you don't need, but not
doing it seems to cause too much confusion.
This commit is contained in:
2011-01-05 13:15:29 +00:00
parent 0daebd0ed6
commit 8e29c7b76f

View File

@@ -786,6 +786,13 @@ int object_add_material_slot(Object *ob)
ma= give_current_material(ob, ob->actcol);
if(ma == NULL)
ma= add_material("Material");
else
ma= copy_material(ma);
id_us_min(&ma->id);
assign_material(ob, ma, ob->totcol+1);
ob->actcol= ob->totcol;
return TRUE;