[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [23550] trunk/blender/source/blender/ editors/mesh/mesh_data.c: Bugfix #19490: Adding UV texture, adds Vertex color instead

Joshua Leung aligorith at gmail.com
Tue Sep 29 04:19:35 CEST 2009


Revision: 23550
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23550
Author:   aligorith
Date:     2009-09-29 04:19:27 +0200 (Tue, 29 Sep 2009)

Log Message:
-----------
Bugfix #19490: Adding UV texture, adds Vertex color instead

Seems to have been a copy+paste error (code for Vertex Color adding was pasted in place of texture paint). Restored the code from an earlier revision (from another file).

Modified Paths:
--------------
    trunk/blender/source/blender/editors/mesh/mesh_data.c

Modified: trunk/blender/source/blender/editors/mesh/mesh_data.c
===================================================================
--- trunk/blender/source/blender/editors/mesh/mesh_data.c	2009-09-29 01:52:54 UTC (rev 23549)
+++ trunk/blender/source/blender/editors/mesh/mesh_data.c	2009-09-29 02:19:27 UTC (rev 23550)
@@ -159,36 +159,30 @@
 int ED_mesh_uv_texture_add(bContext *C, Scene *scene, Object *ob, Mesh *me)
 {
 	EditMesh *em;
-	MCol *mcol;
 	int layernum;
 
 	if(me->edit_mesh) {
 		em= me->edit_mesh;
 
-		layernum= CustomData_number_of_layers(&em->fdata, CD_MCOL);
-		if(layernum >= MAX_MCOL)
-			return 0;
+		layernum= CustomData_number_of_layers(&em->fdata, CD_MTFACE);
+		if(layernum >= MAX_MTFACE)
+			return OPERATOR_CANCELLED;
 
-		EM_add_data_layer(em, &em->fdata, CD_MCOL);
-		CustomData_set_layer_active(&em->fdata, CD_MCOL, layernum);
+		EM_add_data_layer(em, &em->fdata, CD_MTFACE);
+		CustomData_set_layer_active(&em->fdata, CD_MTFACE, layernum);
 	}
 	else {
-		layernum= CustomData_number_of_layers(&me->fdata, CD_MCOL);
-		if(layernum >= MAX_MCOL)
-			return 0;
+		layernum= CustomData_number_of_layers(&me->fdata, CD_MTFACE);
+		if(layernum >= MAX_MTFACE)
+			return OPERATOR_CANCELLED;
 
-		mcol= me->mcol;
-
-		if(me->mcol)
-			CustomData_add_layer(&me->fdata, CD_MCOL, CD_DUPLICATE, me->mcol, me->totface);
+		if(me->mtface)
+			CustomData_add_layer(&me->fdata, CD_MTFACE, CD_DUPLICATE, me->mtface, me->totface);
 		else
-			CustomData_add_layer(&me->fdata, CD_MCOL, CD_DEFAULT, NULL, me->totface);
+			CustomData_add_layer(&me->fdata, CD_MTFACE, CD_DEFAULT, NULL, me->totface);
 
-		CustomData_set_layer_active(&me->fdata, CD_MCOL, layernum);
+		CustomData_set_layer_active(&me->fdata, CD_MTFACE, layernum);
 		mesh_update_customdata_pointers(me);
-
-		if(!mcol && ob)
-			shadeMeshMCol(scene, ob, me);
 	}
 
 	DAG_id_flush_update(&me->id, OB_RECALC_DATA);





More information about the Bf-blender-cvs mailing list