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.
This commit is contained in:
Brecht Van Lommel
2008-04-04 12:33:01 +00:00
parent 4574dbea98
commit eb667866df

View File

@@ -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)