Transform:

Camera grab from camera mode works, but not the middlemouse-toggle, that
has to become a new "Dolly" constraint coded by Martin P! :)
This commit is contained in:
2005-03-13 19:48:17 +00:00
parent 8c564af147
commit e76a63635b
2 changed files with 20 additions and 1 deletions

View File

@@ -1305,6 +1305,11 @@ void Transform(int mode)
break;
case MIDDLEMOUSE:
/* exception for switching to dolly, in camera view */
if( (Trans.flag & T_OBJECT) && G.vd->camera==OBACT && G.vd->persp>1) {
// setLocalConstraint(&Trans, (CON_AXIS2), "along local Z");
}
else
initSelectConstraint(&Trans);
Trans.redraw = 1;
break;

View File

@@ -611,6 +611,20 @@ void calculateCenter(TransInfo *t)
printf("local\n");
break;
}
/* voor panning from cameraview */
if(t->flag & T_OBJECT) {
if( G.vd->camera==OBACT && G.vd->persp>1) {
float axis[3];
VECCOPY(axis, G.vd->persinv[2]);
Normalise(axis);
/* 6.0 = 6 grid units */
t->center[0]+= -6.0*axis[0];
t->center[1]+= -6.0*axis[1];
t->center[2]+= -6.0*axis[2];
}
}
initgrabz(t->center[0], t->center[1], t->center[2]);
}