[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [35975] trunk/blender/source/blender/ blenkernel/intern/material.c: Add material slot now adds no material in the new slot.

Brecht Van Lommel brechtvanlommel at pandora.be
Sun Apr 3 18:11:22 CEST 2011


Revision: 35975
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=35975
Author:   blendix
Date:     2011-04-03 16:11:21 +0000 (Sun, 03 Apr 2011)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/material.c

Modified: trunk/blender/source/blender/blenkernel/intern/material.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/material.c	2011-04-03 13:17:07 UTC (rev 35974)
+++ trunk/blender/source/blender/blenkernel/intern/material.c	2011-04-03 16:11:21 UTC (rev 35975)
@@ -785,21 +785,10 @@
 
 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;
 }




More information about the Bf-blender-cvs mailing list