[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58936] branches/ soc-2013-meshdata_transfer/source/blender: Vertex Groups transfer: removing the layer identificationcompletely outside of the copy function -continued- (fixing indices and removing unused variables)

Walid Shouman eng.walidshouman at gmail.com
Mon Aug 5 17:54:31 CEST 2013


Revision: 58936
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58936
Author:   walid
Date:     2013-08-05 15:54:31 +0000 (Mon, 05 Aug 2013)
Log Message:
-----------
Vertex Groups transfer: removing the layer identificationcompletely outside of the copy function -continued- (fixing indices and removing unused variables)

Modified Paths:
--------------
    branches/soc-2013-meshdata_transfer/source/blender/bmesh/tools/bmesh_data_transfer.c
    branches/soc-2013-meshdata_transfer/source/blender/editors/object/object_vgroup.c

Modified: branches/soc-2013-meshdata_transfer/source/blender/bmesh/tools/bmesh_data_transfer.c
===================================================================
--- branches/soc-2013-meshdata_transfer/source/blender/bmesh/tools/bmesh_data_transfer.c	2013-08-05 15:51:50 UTC (rev 58935)
+++ branches/soc-2013-meshdata_transfer/source/blender/bmesh/tools/bmesh_data_transfer.c	2013-08-05 15:54:31 UTC (rev 58936)
@@ -2539,15 +2539,14 @@
 	BMVert *v;
 	//iter => vertex iterator
 	BMIter iter;
-	int tot_layer_src,tot_layer_dst;
 	int src_lay_iter, dst_lay_iter;
 
 	//tree variables
 	BMEditMesh *em_src;
 
-	//replace mode variables
+	//replace layer variables
 	int src_lay_start, src_lay_end;
-	int dst_lay_start, dst_lay_end;	//dst_lay_end currently isn't being used
+	int dst_lay_start;
 
 	//Is that good to support edit mesh mode at the cost of receiving me_src too ?
 	//if (me_src->edit_btmesh != NULL) em_src = me_src->edit_btmesh;	//edit mesh mode
@@ -2555,11 +2554,6 @@
 	em_src = BKE_editmesh_create(bm_src, true);	//create editmesh data from bm WITH tess.
 													//if it was false ... data other than
 													//em->bm won't be copied
-
-	tot_layer_src = CustomData_number_of_layers(&bm_src->vdata, CD_MDEFORMVERT);//to change the last one
-	tot_layer_dst = CustomData_number_of_layers(&bm_dst->vdata, CD_MDEFORMVERT);	//get the number of Shapekey layers
-																				//within the target
-
 	//get the faces tree
 	bmtree_src = BKE_bmbvh_new(em_src, 0, NULL, false);
 
@@ -2581,7 +2575,6 @@
 	src_lay_start = replace_info.src_lay_start;
 	src_lay_end = replace_info.src_lay_end;
 	dst_lay_start = replace_info.dst_lay_start;
-	dst_lay_end = replace_info.dst_lay_end;
 
 	for (src_lay_iter = src_lay_start, dst_lay_iter = dst_lay_start; src_lay_iter <= src_lay_end;
 		src_lay_iter++, dst_lay_iter++) {

Modified: branches/soc-2013-meshdata_transfer/source/blender/editors/object/object_vgroup.c
===================================================================
--- branches/soc-2013-meshdata_transfer/source/blender/editors/object/object_vgroup.c	2013-08-05 15:51:50 UTC (rev 58935)
+++ branches/soc-2013-meshdata_transfer/source/blender/editors/object/object_vgroup.c	2013-08-05 15:54:31 UTC (rev 58936)
@@ -295,9 +295,9 @@
 		}
 
 		replace_info.src_lay_start = 0;
-		replace_info.src_lay_end = num_src_lay;
+		replace_info.src_lay_end = num_src_lay - 1;
 		replace_info.dst_lay_start = 0;
-		replace_info.dst_lay_end = num_src_lay;
+		replace_info.dst_lay_end = num_src_lay - 1;
 	}
 
 	//we'll tell the copy function to start copying from # of source layers from the end of the dst layers
@@ -331,9 +331,9 @@
 		}
 
 		replace_info.src_lay_start = 0;
-		replace_info.src_lay_end = num_src_lay;
+		replace_info.src_lay_end = num_src_lay - 1;
 		replace_info.dst_lay_start = 0;
-		replace_info.dst_lay_end = num_src_lay;
+		replace_info.dst_lay_end = num_src_lay - 1;
 	}
 
 	else if (replace_mode == REPLACE_ACTIVE_GROUP) {




More information about the Bf-blender-cvs mailing list