[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18365] branches/blender2.5/blender/source /blender/blenkernel/intern/lattice.c: 2.5

Ton Roosendaal ton at blender.org
Tue Jan 6 13:30:44 CET 2009


Revision: 18365
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18365
Author:   ton
Date:     2009-01-06 13:30:44 +0100 (Tue, 06 Jan 2009)

Log Message:
-----------
2.5

Bugfix: some old dangling globals still crash lattice.
Editmode lattice has to be coded still, but now Mancandy
loads again :)

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/blenkernel/intern/lattice.c

Modified: branches/blender2.5/blender/source/blender/blenkernel/intern/lattice.c
===================================================================
--- branches/blender2.5/blender/source/blender/blenkernel/intern/lattice.c	2009-01-06 12:30:28 UTC (rev 18364)
+++ branches/blender2.5/blender/source/blender/blenkernel/intern/lattice.c	2009-01-06 12:30:44 UTC (rev 18365)
@@ -30,6 +30,7 @@
  * ***** END GPL LICENSE BLOCK *****
  */
 
+
 #include <stdio.h>
 #include <string.h>
 #include <math.h>
@@ -72,13 +73,7 @@
 
 //XXX #include "BIF_editdeform.h"
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
 Lattice *editLatt=0;
-static Lattice *deformLatt=0;
-
 static float *latticedata=0, latmat[4][4];
 
 void calc_lat_fudu(int flag, int res, float *fu, float *du)
@@ -308,7 +303,7 @@
 	if(lt->editlatt) lt= lt->editlatt;
 	bp = lt->def;
 	
-	fp= latticedata= MEM_mallocN(sizeof(float)*3*deformLatt->pntsu*deformLatt->pntsv*deformLatt->pntsw, "latticedata");
+	fp= latticedata= MEM_mallocN(sizeof(float)*3*lt->pntsu*lt->pntsv*lt->pntsw, "latticedata");
 	
 		/* for example with a particle system: ob==0 */
 	if(ob==0) {
@@ -355,8 +350,6 @@
 	
 	if(latticedata==0) return;
 	
-	lt= deformLatt;	/* just for shorter notation! */
-	
 	/* co is in local coords, treat with latmat */
 	
 	VECCOPY(vec, co);
@@ -873,11 +866,13 @@
 {
 	Lattice *lt = ob->data;
 	int i, numVerts;
-	float (*vertexCos)[3] = MEM_mallocN(sizeof(*vertexCos)*numVerts,"lt_vcos");
+	float (*vertexCos)[3];
 
 	if(lt->editlatt) lt= lt->editlatt;
 	numVerts = *numVerts_r = lt->pntsu*lt->pntsv*lt->pntsw;
 	
+	vertexCos = MEM_mallocN(sizeof(*vertexCos)*numVerts,"lt_vcos");
+	
 	for (i=0; i<numVerts; i++) {
 		VECCOPY(vertexCos[i], lt->def[i].vec);
 	}





More information about the Bf-blender-cvs mailing list