Individual Element (object) center for Rotate and Resize. Note that using this in edit mode is a bit useless right now, but we have some surprises in our bozo bin :P

Transform can switch mode on the fly again (GRS).

Fixed a bug with the BIF constraint call, needed to call startConstraint and normalise the space matrix (this affected the manipulator).
This commit is contained in:
2005-03-18 15:08:02 +00:00
parent ecdf0d3412
commit f08504c525
3 changed files with 72 additions and 41 deletions

View File

@@ -930,9 +930,7 @@ static void ObjectToTransData(TransData *td, Object *ob)
VECCOPY(td->center, ob->obmat[3]);
Mat3CpyMat4(td->axismtx, ob->obmat);
Normalise(td->axismtx[0]);
Normalise(td->axismtx[1]);
Normalise(td->axismtx[2]);
Mat3Ortho(td->axismtx);
if (ob->parent)
{
@@ -1403,12 +1401,22 @@ void Transform(int mode)
ret_val = TRANS_CONFIRM;
break;
case GKEY:
restoreTransObjects(&Trans);
initTransModeFlags(&Trans, TFM_TRANSLATION);
initTranslation(&Trans);
Trans.redraw = 1;
break;
case SKEY:
restoreTransObjects(&Trans);
initTransModeFlags(&Trans, TFM_RESIZE);
initResize(&Trans);
Trans.redraw = 1;
break;
case RKEY:
if (G.qual == LR_CTRLKEY)
applyTransObjects(&Trans);
else
restoreTransObjects(&Trans);
restoreTransObjects(&Trans);
initTransModeFlags(&Trans, TFM_ROTATION);
initRotation(&Trans);
Trans.redraw = 1;
break;
case XKEY:
if (cmode == 'X') {
@@ -1994,6 +2002,10 @@ int Resize(TransInfo *t, short mval[2])
t->con.applySize(t, td, tmat);
}
if (G.vd->around == V3D_LOCAL) {
VECCOPY(t->center, td->center);
}
if (td->ext) {
float fsize[3];
@@ -2249,6 +2261,10 @@ int Rotation(TransInfo *t, short mval[2])
VecRotToMat3(axis, final * td->factor, mat);
}
if (G.vd->around == V3D_LOCAL) {
VECCOPY(t->center, td->center);
}
if (t->flag & T_EDIT) {
Mat3MulMat3(totmat, mat, td->mtx);
Mat3MulMat3(smat, td->smtx, totmat);