diff options
author | Martin Poirier <theeth@yahoo.com> | 2005-04-11 00:09:31 +0400 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2005-04-11 00:09:31 +0400 |
commit | 218ee423d92c4575745d29f676ff5ceb76f06195 (patch) | |
tree | ffa54175719450b0f89192877890e916551f2e59 /source/blender/src/transform.c | |
parent | 4ea8947ea78b227e73cf0eb7f1597d089a945269 (diff) |
Resize didn't work with bezier handles correctly. That is because bezier has preleminary work for Individual Center in edit mode.
While I was there, I cleaned up individual center a bit, it was messing with helpline.
For fun, set the center mode to Individual Center, create a bezier circle, change handle to free (H) and Resize or Rotate. Fun isn't it! :)
Diffstat (limited to 'source/blender/src/transform.c')
-rwxr-xr-x | source/blender/src/transform.c | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/source/blender/src/transform.c b/source/blender/src/transform.c index 9c3f9f6d9a0..7358e68e4ff 100755 --- a/source/blender/src/transform.c +++ b/source/blender/src/transform.c @@ -969,7 +969,7 @@ int Resize(TransInfo *t, short mval[2]) headerResize(t, size, str); for(i = 0 ; i < t->total; i++, td++) { - float smat[3][3]; + float smat[3][3], center[3]; if (td->flag & TD_NOACTION) break; @@ -987,7 +987,10 @@ int Resize(TransInfo *t, short mval[2]) } if (G.vd->around == V3D_LOCAL) { - VECCOPY(t->center, td->center); + VECCOPY(center, td->center); + } + else { + VECCOPY(center, t->center); } if (td->ext) { @@ -1025,12 +1028,19 @@ int Resize(TransInfo *t, short mval[2]) } } } - VecSubf(vec, td->center, t->center); + /* For individual element center, Editmode need to use iloc */ + if (t->flag & T_EDIT) + VecSubf(vec, td->iloc, center); + else + VecSubf(vec, td->center, center); Mat3MulVecfl(tmat, vec); - VecAddf(vec, vec, t->center); - VecSubf(vec, vec, td->center); + VecAddf(vec, vec, center); + if (t->flag & T_EDIT) + VecSubf(vec, vec, td->iloc); + else + VecSubf(vec, vec, td->center); VecMulf(vec, td->factor); @@ -1248,12 +1258,18 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3]) { static void applyRotation(TransInfo *t, float angle, float axis[3]) { TransData *td = t->data; - float mat[3][3]; + float mat[3][3], center[3]; int i; + /* saving original center */ + if (G.vd->around == V3D_LOCAL) { + VECCOPY(center, t->center); + } + VecRotToMat3(axis, angle, mat); for(i = 0 ; i < t->total; i++, td++) { + if (td->flag & TD_NOACTION) break; @@ -1271,6 +1287,11 @@ static void applyRotation(TransInfo *t, float angle, float axis[3]) ElementRotation(t, td, mat); } + + /* restoring original center */ + if (G.vd->around == V3D_LOCAL) { + VECCOPY(t->center, center); + } } int Rotation(TransInfo *t, short mval[2]) |