diff options
author | Matt Ebb <matt@mke3.net> | 2006-10-28 20:48:56 +0400 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2006-10-28 20:48:56 +0400 |
commit | ddbfb04642187505ff8c321fc1febd1a55576f59 (patch) | |
tree | 0899ee60547c2f97ff22ed7d089adbc4b5bd41a1 /source/blender/blenkernel/intern/lattice.c | |
parent | 3e0c45440d8fd5998a944699feb5afa033e80918 (diff) |
* Changed the Curve Modifier to have it's own X/Y/Z axis deform direction
settings, rather than using the object's TrackX/Y/Z/etc buttons.
This is good for two reasons: a) having the settings over in the object buttons
before was terribly unintuitive and hidden, now it's more visible how to
control the deformation, and b) now if you have more than one curve modifier,
they can have their own settings, instead of being forced to use the object
level data.
Diffstat (limited to 'source/blender/blenkernel/intern/lattice.c')
-rw-r--r-- | source/blender/blenkernel/intern/lattice.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c index fe28d0f3150..3d8fd7d1311 100644 --- a/source/blender/blenkernel/intern/lattice.c +++ b/source/blender/blenkernel/intern/lattice.c @@ -514,14 +514,14 @@ static void calc_curve_deform(Object *par, float *co, short axis, CurveDeform *c float fac, loc[4], dir[3], *quat, q[4], mat[3][3], cent[3]; short upflag, index; - if(axis==OB_POSX || axis==OB_NEGX) { + if(axis==MOD_CURVE_POSX || axis==MOD_CURVE_NEGX) { upflag= OB_POSZ; cent[0]= 0.0; cent[1]= co[1]; cent[2]= co[2]; index= 0; } - else if(axis==OB_POSY || axis==OB_NEGY) { + else if(axis==MOD_CURVE_POSY || axis==MOD_CURVE_NEGY) { upflag= OB_POSZ; cent[0]= co[0]; cent[1]= 0.0; @@ -548,7 +548,7 @@ static void calc_curve_deform(Object *par, float *co, short axis, CurveDeform *c if( where_on_path_deform(par, fac, loc, dir)) { /* returns OK */ - quat= vectoquat(dir, axis, upflag); + quat= vectoquat(dir, axis-1, upflag); /* -1 for compatibility with old track defines */ /* the tilt */ if(loc[3]!=0.0) { @@ -572,7 +572,7 @@ static void calc_curve_deform(Object *par, float *co, short axis, CurveDeform *c } -void curve_deform_verts(Object *cuOb, Object *target, DerivedMesh *dm, float (*vertexCos)[3], int numVerts, char *vgroup) +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; @@ -633,7 +633,7 @@ void curve_deform_verts(Object *cuOb, Object *target, DerivedMesh *dm, float (*v for(j = 0; j < dvert->totweight; j++) { if(dvert->dw[j].def_nr == index) { VECCOPY(vec, vertexCos[a]); - calc_curve_deform(cuOb, vec, target->trackflag, &cd); + calc_curve_deform(cuOb, vec, defaxis, &cd); VecLerpf(vertexCos[a], vertexCos[a], vec, dvert->dw[j].weight); Mat4MulVecfl(cd.objectspace, vertexCos[a]); @@ -651,7 +651,7 @@ void curve_deform_verts(Object *cuOb, Object *target, DerivedMesh *dm, float (*v } for(a = 0; a < numVerts; a++) { - calc_curve_deform(cuOb, vertexCos[a], target->trackflag, &cd); + calc_curve_deform(cuOb, vertexCos[a], defaxis, &cd); Mat4MulVecfl(cd.objectspace, vertexCos[a]); } } |