Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2008-04-04 16:33:01 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2008-04-04 16:33:01 +0400
commiteb667866dfde9a227259b0f9bfeaab7fdeaef7ce (patch)
tree6ffef020446f34db4c4ddec8bc11f4cd4c940c96 /source/blender/blenkernel/intern/lattice.c
parent4574dbea98342e862962923101176a309aec3ebb (diff)
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.
Diffstat (limited to 'source/blender/blenkernel/intern/lattice.c')
-rw-r--r--source/blender/blenkernel/intern/lattice.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c
index 47175a789b1..479dd38eb89 100644
--- a/source/blender/blenkernel/intern/lattice.c
+++ b/source/blender/blenkernel/intern/lattice.c
@@ -611,11 +611,16 @@ static int calc_curve_deform(Object *par, float *co, short axis, CurveDeform *cd
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 @@ void curve_deform_vector(Object *cuOb, Object *target, float *orco, float *vec,
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 @@ void lattice_deform_verts(Object *laOb, Object *target, DerivedMesh *dm,
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)