diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-09-12 20:25:49 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-09-12 20:25:49 +0400 |
commit | f130f16fef38d40ee492ccb4ff1ad0708329ae3c (patch) | |
tree | 3eac35dcbfd3669f0ff18f366f715587d4d032dc /source/blender/blenkernel/intern/lattice.c | |
parent | d16bde417fb985eb348cdbf2314e324fa9d098a9 (diff) |
Use curve radius for paths
- use_radius option, off by default for 2.4x files, on by default on new curves.
- curve deform modifiers (think tentacles)
- follow path (parent mode and constraint)
- curve guides
- added back Alt+S to scale point radius
- Mat3Scale and Mat4Scale arithb.c functions to make a new uniform scale matrix.
- TODO, effectors, looks like they have no way to scale from the radius yet.
Diffstat (limited to 'source/blender/blenkernel/intern/lattice.c')
-rw-r--r-- | source/blender/blenkernel/intern/lattice.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c index e2c2723d036..730a12bea09 100644 --- a/source/blender/blenkernel/intern/lattice.c +++ b/source/blender/blenkernel/intern/lattice.c @@ -524,7 +524,7 @@ static int where_on_path_deform(Object *ob, float ctime, float *vec, float *dir, static int calc_curve_deform(Scene *scene, Object *par, float *co, short axis, CurveDeform *cd, float *quatp) { Curve *cu= par->data; - float fac, loc[4], dir[3], cent[3]; + float fac, loc[4], dir[3], cent[3], radius; short upflag, index; if(axis==MOD_CURVE_POSX || axis==MOD_CURVE_NEGX) { @@ -579,7 +579,7 @@ static int calc_curve_deform(Scene *scene, Object *par, float *co, short axis, C } #endif // XXX old animation system - if( where_on_path_deform(par, fac, loc, dir, NULL, NULL)) { /* returns OK */ + if( where_on_path_deform(par, fac, loc, dir, NULL, &radius)) { /* returns OK */ float q[4], mat[3][3], quat[4]; if(cd->no_rot_axis) /* set by caller */ @@ -599,7 +599,14 @@ static int calc_curve_deform(Scene *scene, Object *par, float *co, short axis, C QuatMul(quat, q, quat); } QuatToMat3(quat, mat); - + + if(cu->flag & CU_PATH_RADIUS) { + float tmat[3][3], rmat[3][3]; + Mat3Scale(tmat, radius); + Mat3MulMat3(rmat, mat, tmat); + Mat3CpyMat3(mat, rmat); + } + /* local rotation */ Mat3MulVecfl(mat, cent); |