[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [14325] trunk/blender/source/blender/ blenkernel/intern/lattice.c:
Brecht Van Lommel
brechtvanlommel at pandora.be
Fri Apr 4 14:33:17 CEST 2008
Revision: 14325
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14325
Author: blendix
Date: 2008-04-04 14:33:01 +0200 (Fri, 04 Apr 2008)
Log Message:
-----------
Fix for bug #8870: crash converting curve to mesh. The object was being
used for curve deform, but after conversion wasn't a curve anymore, and
there was no check for this.
Modified Paths:
--------------
trunk/blender/source/blender/blenkernel/intern/lattice.c
Modified: trunk/blender/source/blender/blenkernel/intern/lattice.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/lattice.c 2008-04-03 00:40:53 UTC (rev 14324)
+++ trunk/blender/source/blender/blenkernel/intern/lattice.c 2008-04-04 12:33:01 UTC (rev 14325)
@@ -611,11 +611,16 @@
void curve_deform_verts(Object *cuOb, Object *target, DerivedMesh *dm, float (*vertexCos)[3], int numVerts, char *vgroup, short defaxis)
{
- Curve *cu = cuOb->data;
- int a, flag = cu->flag;
+ Curve *cu;
+ int a, flag;
CurveDeform cd;
int use_vgroups;
-
+
+ if(cuOb->type != OB_CURVE)
+ return;
+
+ cu = cuOb->data;
+ flag = cu->flag;
cu->flag |= (CU_PATH|CU_FOLLOW); // needed for path & bevlist
init_curve_deform(cuOb, target, &cd, (cu->flag & CU_STRETCH)==0);
@@ -703,6 +708,11 @@
CurveDeform cd;
float quat[4];
+ if(cuOb->type != OB_CURVE) {
+ Mat3One(mat);
+ return;
+ }
+
init_curve_deform(cuOb, target, &cd, 0); /* 0 no dloc */
cd.no_rot_axis= no_rot_axis; /* option to only rotate for XY, for example */
@@ -730,6 +740,9 @@
int a;
int use_vgroups;
+ if(laOb->type != OB_LATTICE)
+ return;
+
init_latt_deform(laOb, target);
/* check whether to use vertex groups (only possible if target is a Mesh)
More information about the Bf-blender-cvs
mailing list