forked from bartvdbraak/blender
Add material slot now adds no material in the new slot.
It's obviously much better than the two previous behaviors, since you don't get confusing linked materials, and you don't have useless added materials.
This commit is contained in:
parent
4c44a1fc04
commit
480b9dca64
@ -785,21 +785,10 @@ int find_material_index(Object *ob, Material *ma)
|
||||
|
||||
int object_add_material_slot(Object *ob)
|
||||
{
|
||||
Material *ma;
|
||||
|
||||
if(ob==NULL) return FALSE;
|
||||
if(ob->totcol>=MAXMAT) return FALSE;
|
||||
|
||||
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);
|
||||
assign_material(ob, NULL, ob->totcol+1);
|
||||
ob->actcol= ob->totcol;
|
||||
return TRUE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user