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! :)
This commit is contained in:
2005-04-10 20:09:31 +00:00
parent 4ea8947ea7
commit 218ee423d9
2 changed files with 28 additions and 8 deletions

View File

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