diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-04-03 20:11:21 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-04-03 20:11:21 +0400 |
commit | 480b9dca64abd85622c28d195733f3915752636e (patch) | |
tree | 027b90a7226f51bca0bf153dc5283f14a41cf938 /source/blender/blenkernel/intern/material.c | |
parent | 4c44a1fc041aeae2ca82649490e86dc38184a6a0 (diff) |
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.
Diffstat (limited to 'source/blender/blenkernel/intern/material.c')
-rw-r--r-- | source/blender/blenkernel/intern/material.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index 3ca5cdb9bb1..14848de693c 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -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; } |