[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [40145] branches/bmesh/blender/source/ blender/modifiers/intern/MOD_array.c: fix [#28587] Array modifier draws an extra object

Campbell Barton ideasman42 at gmail.com
Mon Sep 12 04:36:15 CEST 2011


Revision: 40145
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=40145
Author:   campbellbarton
Date:     2011-09-12 02:36:14 +0000 (Mon, 12 Sep 2011)
Log Message:
-----------
fix [#28587] Array modifier draws an extra object
patch [#28586] from Andrew Wiggin (ender79)

Modified Paths:
--------------
    branches/bmesh/blender/source/blender/modifiers/intern/MOD_array.c

Modified: branches/bmesh/blender/source/blender/modifiers/intern/MOD_array.c
===================================================================
--- branches/bmesh/blender/source/blender/modifiers/intern/MOD_array.c	2011-09-12 02:23:30 UTC (rev 40144)
+++ branches/bmesh/blender/source/blender/modifiers/intern/MOD_array.c	2011-09-12 02:36:14 UTC (rev 40145)
@@ -317,11 +317,8 @@
 	int i, j, indexLen;
 	/* offset matrix */
 	float offset[4][4];
-	float final_offset[4][4];
-	float tmp_mat[4][4];
 	float length = amd->length;
 	int count = amd->count, maxVerts;
-	int finalVerts, finalEdges, finalFaces;
 	int *indexMap = NULL;
 	DerivedMesh *start_cap = NULL, *end_cap = NULL;
 	MVert *src_mvert;
@@ -397,35 +394,10 @@
 	if(count < 1)
 		count = 1;
 
-	/* allocate memory for count duplicates (including original) plus
-		  * start and end caps
-	*/
-	finalVerts = dm->getNumVerts(dm) * count;
-	finalEdges = dm->getNumEdges(dm) * count;
-	finalFaces = dm->getNumFaces(dm) * count;
-	if(start_cap) {
-		finalVerts += start_cap->getNumVerts(start_cap);
-		finalEdges += start_cap->getNumEdges(start_cap);
-		finalFaces += start_cap->getNumFaces(start_cap);
-	}
-	if(end_cap) {
-		finalVerts += end_cap->getNumVerts(end_cap);
-		finalEdges += end_cap->getNumEdges(end_cap);
-		finalFaces += end_cap->getNumFaces(end_cap);
-	}
-
-	/* calculate the offset matrix of the final copy (for merging) */
-	unit_m4(final_offset);
-
-	for(j=0; j < count - 1; j++) {
-		mul_m4_m4m4(tmp_mat, final_offset, offset);
-		copy_m4_m4(final_offset, tmp_mat);
-	}
-
 	BMO_Init_Op(&weldop, "weldverts");
 	BMO_InitOpf(em->bm, &op, "dupe geom=%avef");
 	oldop = op;
-	for (j=0; j < count; j++) {
+	for (j=0; j < count - 1; j++) {
 		BMVert *v, *v2;
 		BMOpSlot *s1;
 		BMOpSlot *s2;




More information about the Bf-blender-cvs mailing list