Cleaning up manipulator code a bit

Made transform confirm or cancel on mouse up. More inline with button clicking and better for tablets.

Add operator params to make sure Rip and Extrude turn off PET and Mirror correctly.

Note: sorry for all the whitespace changes, I need to reconfigure this editor not to do autocleanup.
This commit is contained in:
Martin Poirier 2009-07-12 02:01:13 +00:00
parent 42469ba1e5
commit 8b9bb47a3f
8 changed files with 2657 additions and 2838 deletions

@ -1,5 +1,5 @@
/**
* $Id: ED_transform.h 21450 2009-07-09 02:45:48Z theeth $
* $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
@ -119,12 +119,16 @@ struct EnumPropertyItem *BIF_enumTransformOrientation(struct bContext *C);
char * BIF_menustringTransformOrientation(const struct bContext *C, char *title); /* the returned value was allocated and needs to be freed after use */
int BIF_countTransformOrientation(const struct bContext *C);
void BIF_getPropCenter(float *center);
void BIF_TransformSetUndo(char *str);
void BIF_selectOrientation(void);
/* to be able to add operator properties to other operators */
void Properties_Proportional(struct wmOperatorType *ot);
void Properties_Snapping(struct wmOperatorType *ot, short align);
void Properties_Constraints(struct wmOperatorType *ot);
/* view3d manipulators */
void initManipulator(int mode);
void ManipulatorTransform();

@ -710,8 +710,9 @@ static int mesh_extrude_invoke(bContext *C, wmOperator *op, wmEvent *event)
DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
RNA_int_set(op->ptr, "mode", TFM_TRANSLATION);
WM_operator_name_call(C, "TFM_OT_transform", WM_OP_INVOKE_REGION_WIN, op->ptr);
RNA_enum_set(op->ptr, "proportional", 0);
RNA_boolean_set(op->ptr, "mirror", 0);
WM_operator_name_call(C, "TFM_OT_translation", WM_OP_INVOKE_REGION_WIN, op->ptr);
return OPERATOR_FINISHED;
}
@ -748,7 +749,8 @@ void MESH_OT_extrude(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* to give to transform */
RNA_def_int(ot->srna, "mode", TFM_TRANSLATION, 0, INT_MAX, "Mode", "", 0, INT_MAX);
Properties_Proportional(ot);
RNA_def_boolean(ot->srna, "mirror", 0, "Mirror Editing", "");
}
static int split_mesh(bContext *C, wmOperator *op)
@ -4787,13 +4789,7 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event)
EditEdge *eed, *seed= NULL;
EditFace *efa, *sefa= NULL;
float projectMat[4][4], vec[3], dist, mindist;
short doit= 1, *mval= event->mval; // XXX ,propmode,prop;
// XXX propmode = scene->prop_mode;
// scene->prop_mode = 0;
// prop = scene->proportional;
// scene->proportional = 0;
short doit= 1, *mval= event->mval;
/* select flush... vertices are important */
EM_selectmode_set(em);
@ -4985,11 +4981,9 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event)
BKE_mesh_end_editmesh(obedit->data, em);
RNA_int_set(op->ptr, "mode", TFM_TRANSLATION);
WM_operator_name_call(C, "TFM_OT_transform", WM_OP_INVOKE_REGION_WIN, op->ptr);
// scene->prop_mode = propmode;
// XXX scene->proportional = prop;
RNA_enum_set(op->ptr, "proportional", 0);
RNA_boolean_set(op->ptr, "mirror", 0);
WM_operator_name_call(C, "TFM_OT_translation", WM_OP_INVOKE_REGION_WIN, op->ptr);
return OPERATOR_FINISHED;
}
@ -5008,7 +5002,8 @@ void MESH_OT_rip(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* to give to transform */
RNA_def_int(ot->srna, "mode", TFM_TRANSLATION, 0, INT_MAX, "Mode", "", 0, INT_MAX);
Properties_Proportional(ot);
RNA_def_boolean(ot->srna, "mirror", 0, "Mirror Editing", "");
}

@ -577,11 +577,8 @@ void transformEvent(TransInfo *t, wmEvent *event)
}
break;
case ESCKEY:
case RIGHTMOUSE:
printf("cancelled\n");
t->state = TRANS_CANCEL;
break;
case LEFTMOUSE:
case PADENTER:
case RETKEY:
t->state = TRANS_CONFIRM;
@ -817,6 +814,12 @@ void transformEvent(TransInfo *t, wmEvent *event)
}
else {
switch (event->type){
case RIGHTMOUSE:
t->state = TRANS_CANCEL;
break;
case LEFTMOUSE:
t->state = TRANS_CONFIRM;
break;
case LEFTSHIFTKEY:
case RIGHTSHIFTKEY:
t->modifiers &= ~MOD_CONSTRAINT_PLANE;
@ -837,12 +840,12 @@ void transformEvent(TransInfo *t, wmEvent *event)
t->redraw = 1;
}
break;
case LEFTMOUSE:
case RIGHTMOUSE:
if(WM_modal_tweak_exit(event, t->event_type))
// if (t->options & CTX_TWEAK)
t->state = TRANS_CONFIRM;
break;
// case LEFTMOUSE:
// case RIGHTMOUSE:
// if(WM_modal_tweak_exit(event, t->event_type))
//// if (t->options & CTX_TWEAK)
// t->state = TRANS_CONFIRM;
// break;
}
}

@ -507,6 +507,8 @@ void special_aftertrans_update(TransInfo *t);
void transform_autoik_update(TransInfo *t, short mode);
int count_set_pose_transflags(int *out_mode, short around, struct Object *ob);
/* auto-keying stuff used by special_aftertrans_update */
short autokeyframe_cfra_can_key(struct Scene *scene, struct Object *ob);
void autokeyframe_ob_cb_func(struct Scene *scene, struct View3D *v3d, struct Object *ob, int tmode);
@ -607,8 +609,6 @@ void calculatePropRatio(TransInfo *t);
void getViewVector(TransInfo *t, float coord[3], float vec[3]);
TransInfo * BIF_GetTransInfo(void);
/*********************** NumInput ********************************/
void initNumInput(NumInput *n);

@ -585,128 +585,6 @@ void setUserConstraint(TransInfo *t, int mode, const char ftext[]) {
t->con.mode |= CON_USER;
}
/*--------------------- EXTERNAL SETUP CALLS ------------------*/
void BIF_setLocalLockConstraint(char axis, char *text) {
TransInfo *t = BIF_GetTransInfo();
if (t->total == 0) {
return;
}
switch (axis) {
case 'x':
setLocalConstraint(t, (CON_AXIS1|CON_AXIS2), text);
break;
case 'y':
setLocalConstraint(t, (CON_AXIS0|CON_AXIS2), text);
break;
case 'z':
setLocalConstraint(t, (CON_AXIS0|CON_AXIS1), text);
break;
}
}
void BIF_setLocalAxisConstraint(char axis, char *text) {
TransInfo *t = BIF_GetTransInfo();
if (t->total == 0) {
return;
}
switch (axis) {
case 'X':
setLocalConstraint(t, CON_AXIS0, text);
break;
case 'Y':
setLocalConstraint(t, CON_AXIS1, text);
break;
case 'Z':
setLocalConstraint(t, CON_AXIS2, text);
break;
}
}
/* text is optional, for header print */
void BIF_setSingleAxisConstraint(float vec[3], char *text) {
TransInfo *t = BIF_GetTransInfo();
float space[3][3], v[3];
if (t->total == 0) {
return;
}
VECCOPY(space[0], vec);
v[0] = vec[2];
v[1] = vec[0];
v[2] = vec[1];
Crossf(space[1], vec, v);
Crossf(space[2], vec, space[1]);
Mat3Ortho(space);
Mat3CpyMat3(t->con.mtx, space);
t->con.mode = CON_AXIS0;
getConstraintMatrix(t);
startConstraint(t);
/* start copying with an offset of 1, to reserve a spot for the SPACE char */
if(text)
{
strncpy(t->con.text+1, text, 48); /* 50 in struct */
}
else
{
t->con.text[1] = '\0'; /* No text */
}
t->con.drawExtra = NULL;
t->con.applyVec = applyAxisConstraintVec;
t->con.applySize = applyAxisConstraintSize;
t->con.applyRot = applyAxisConstraintRot;
t->redraw = 1;
}
void BIF_setDualAxisConstraint(float vec1[3], float vec2[3], char *text) {
TransInfo *t = BIF_GetTransInfo();
float space[3][3];
if (t->total == 0) {
return;
}
VECCOPY(space[0], vec1);
VECCOPY(space[1], vec2);
Crossf(space[2], space[0], space[1]);
Mat3Ortho(space);
Mat3CpyMat3(t->con.mtx, space);
t->con.mode = CON_AXIS0|CON_AXIS1;
getConstraintMatrix(t);
startConstraint(t);
/* start copying with an offset of 1, to reserve a spot for the SPACE char */
if(text)
{
strncpy(t->con.text+1, text, 48); /* 50 in struct */
}
else
{
t->con.text[1] = '\0'; /* No text */
}
t->con.drawExtra = NULL;
t->con.applyVec = applyAxisConstraintVec;
t->con.applySize = applyAxisConstraintSize;
t->con.applyRot = applyAxisConstraintRot;
t->redraw = 1;
}
/*----------------- DRAWING CONSTRAINTS -------------------*/
void drawConstraint(const struct bContext *C, TransInfo *t)
@ -809,17 +687,6 @@ void drawPropCircle(const struct bContext *C, TransInfo *t)
}
}
void BIF_getPropCenter(float *center)
{
TransInfo *t = BIF_GetTransInfo();
if (t && t->flag & T_PROP_EDIT) {
VECCOPY(center, t->center);
}
else
center[0] = center[1] = center[2] = 0.0f;
}
static void drawObjectConstraint(TransInfo *t) {
int i;
TransData * td = t->data;

@ -655,7 +655,7 @@ static void add_pose_transdata(TransInfo *t, bPoseChannel *pchan, Object *ob, Tr
td->con= pchan->constraints.first;
}
static void bone_children_clear_transflag(TransInfo *t, ListBase *lb)
static void bone_children_clear_transflag(int mode, short around, ListBase *lb)
{
Bone *bone= lb->first;
@ -664,7 +664,7 @@ static void bone_children_clear_transflag(TransInfo *t, ListBase *lb)
{
bone->flag |= BONE_HINGE_CHILD_TRANSFORM;
}
else if (bone->flag & BONE_TRANSFORM && (t->mode == TFM_ROTATION || t->mode == TFM_TRACKBALL) && t->around == V3D_LOCAL)
else if (bone->flag & BONE_TRANSFORM && (mode == TFM_ROTATION || mode == TFM_TRACKBALL) && around == V3D_LOCAL)
{
bone->flag |= BONE_TRANSFORM_CHILD;
}
@ -673,19 +673,19 @@ static void bone_children_clear_transflag(TransInfo *t, ListBase *lb)
bone->flag &= ~BONE_TRANSFORM;
}
bone_children_clear_transflag(t, &bone->childbase);
bone_children_clear_transflag(mode, around, &bone->childbase);
}
}
/* sets transform flags in the bones, returns total */
static void set_pose_transflags(TransInfo *t, Object *ob)
int count_set_pose_transflags(int *out_mode, short around, Object *ob)
{
bArmature *arm= ob->data;
bPoseChannel *pchan;
Bone *bone;
int hastranslation;
t->total= 0;
int mode = *out_mode;
int hastranslation = 0;
int total = 0;
for(pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
bone = pchan->bone;
@ -702,11 +702,11 @@ static void set_pose_transflags(TransInfo *t, Object *ob)
/* make sure no bone can be transformed when a parent is transformed */
/* since pchans are depsgraph sorted, the parents are in beginning of list */
if(t->mode!=TFM_BONESIZE) {
if(mode != TFM_BONESIZE) {
for(pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
bone = pchan->bone;
if(bone->flag & BONE_TRANSFORM)
bone_children_clear_transflag(t, &bone->childbase);
bone_children_clear_transflag(mode, around, &bone->childbase);
}
}
/* now count, and check if we have autoIK or have to switch from translate to rotate */
@ -716,9 +716,9 @@ static void set_pose_transflags(TransInfo *t, Object *ob)
bone = pchan->bone;
if(bone->flag & BONE_TRANSFORM) {
t->total++;
total++;
if(t->mode==TFM_TRANSLATION) {
if(mode == TFM_TRANSLATION) {
if( has_targetless_ik(pchan)==NULL ) {
if(pchan->parent && (pchan->bone->flag & BONE_CONNECTED)) {
if(pchan->bone->flag & BONE_HINGE_CHILD_TRANSFORM)
@ -734,8 +734,12 @@ static void set_pose_transflags(TransInfo *t, Object *ob)
}
/* if there are no translatable bones, do rotation */
if(t->mode==TFM_TRANSLATION && !hastranslation)
t->mode= TFM_ROTATION;
if(mode == TFM_TRANSLATION && !hastranslation)
{
*out_mode = TFM_ROTATION;
}
return total;
}
@ -984,7 +988,7 @@ static void createTransPose(bContext *C, TransInfo *t, Object *ob)
}
/* set flags and count total (warning, can change transform to rotate) */
set_pose_transflags(t, ob);
t->total = count_set_pose_transflags(&t->mode, t->around, ob);
if(t->total == 0) return;

@ -1362,14 +1362,6 @@ void calculatePropRatio(TransInfo *t)
}
}
/* XXX only to make manipulators run now */
TransInfo *BIF_GetTransInfo()
{
static struct TransInfo trans;
memset(&trans, 0, sizeof(struct TransInfo));
return &trans;
}
float get_drawsize(ARegion *ar, float *co)
{
RegionView3D *rv3d= ar->regiondata;

@ -174,37 +174,10 @@ static void stats_editbone(View3D *v3d, EditBone *ebo)
protectflag_to_drawflags(OB_LOCK_LOC|OB_LOCK_ROT|OB_LOCK_SCALE, &v3d->twdrawflag);
}
/* only counts the parent selection, and tags transform flag */
/* bad call... should re-use method from transform_conversion once */
static void count_bone_select(TransInfo *t, bArmature *arm, ListBase *lb, int do_it)
{
Bone *bone;
int do_next;
for(bone= lb->first; bone; bone= bone->next) {
bone->flag &= ~BONE_TRANSFORM;
do_next= do_it;
if(do_it) {
if(bone->layer & arm->layer) {
if (bone->flag & BONE_SELECTED) {
/* We don't let connected children get "grabbed" */
if ( (t->mode!=TFM_TRANSLATION) || (bone->flag & BONE_CONNECTED)==0 ) {
bone->flag |= BONE_TRANSFORM;
t->total++;
do_next= 0; // no transform on children if one parent bone is selected
}
}
}
}
count_bone_select(t, arm, &bone->childbase, do_next);
}
}
/* centroid, boundbox, of selection */
/* returns total items selected */
int calc_manipulator_stats(const bContext *C)
{
TransInfo *t= BIF_GetTransInfo(); // XXX
ScrArea *sa= CTX_wm_area(C);
ARegion *ar= CTX_wm_region(C);
Scene *scene= CTX_data_scene(C);
@ -369,17 +342,12 @@ int calc_manipulator_stats(const bContext *C)
else if(ob && (ob->flag & OB_POSEMODE)) {
bArmature *arm = ob->data;
bPoseChannel *pchan;
int mode;
int mode = TFM_ROTATION; // mislead counting bones... bah. We don't know the manipulator mode, could be mixed
if((ob->lay & v3d->lay)==0) return 0;
mode = t->mode;
t->mode = TFM_ROTATION; // mislead counting bones... bah
totsel = count_set_pose_transflags(&mode, 0, ob);
/* count total, we use same method as transform will do */
t->total= 0;
count_bone_select(t, arm, &arm->bonebase, 1);
totsel = t->total;
if(totsel) {
/* use channels to get stats */
for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) {
@ -391,8 +359,6 @@ int calc_manipulator_stats(const bContext *C)
Mat4MulVecfl(ob->obmat, scene->twmin);
Mat4MulVecfl(ob->obmat, scene->twmax);
}
/* restore, mode can be TFM_INIT */
t->mode = mode;
}
else if(G.f & (G_VERTEXPAINT + G_TEXTUREPAINT + G_WEIGHTPAINT + G_SCULPTMODE)) {
;
@ -446,17 +412,12 @@ int calc_manipulator_stats(const bContext *C)
if(ob && totsel) {
switch(v3d->twmode) {
case V3D_MANIP_GLOBAL:
strcpy(t->spacename, "global");
break;
case V3D_MANIP_NORMAL:
if(obedit || ob->flag & OB_POSEMODE) {
float mat[3][3];
int type;
strcpy(t->spacename, "normal");
type = getTransformOrientation(C, normal, plane, (v3d->around == V3D_ACTIVE));
switch (type)
@ -499,7 +460,6 @@ int calc_manipulator_stats(const bContext *C)
}
/* no break we define 'normal' as 'local' in Object mode */
case V3D_MANIP_LOCAL:
strcpy(t->spacename, "local");
Mat4CpyMat4(rv3d->twmat, ob->obmat);
Mat4Ortho(rv3d->twmat);
break;
@ -507,14 +467,13 @@ int calc_manipulator_stats(const bContext *C)
case V3D_MANIP_VIEW:
{
float mat[3][3];
strcpy(t->spacename, "view");
Mat3CpyMat4(mat, rv3d->viewinv);
Mat3Ortho(mat);
Mat4CpyMat3(rv3d->twmat, mat);
}
break;
default: /* V3D_MANIP_CUSTOM */
applyTransformOrientation(C, t);
// XXX applyTransformOrientation(C, t);
break;
}
@ -710,7 +669,6 @@ static void draw_manipulator_axes(View3D *v3d, int colcode, int flagx, int flagy
/* only called while G.moving */
static void draw_manipulator_rotate_ghost(View3D *v3d, RegionView3D *rv3d, int drawflags)
{
TransInfo *t= BIF_GetTransInfo(); // XXX
GLUquadricObj *qobj;
float size, phi, startphi, vec[3], svec[3], matt[4][4], cross[3], tmat[3][3];
int arcs= (G.rt!=2);
@ -726,7 +684,7 @@ static void draw_manipulator_rotate_ghost(View3D *v3d, RegionView3D *rv3d, int d
/* we need both [4][4] transforms, t->mat seems to be premul, not post for mat[][4] */
Mat4CpyMat4(matt, rv3d->twmat); // to copy the parts outside of [3][3]
Mat4MulMat34(matt, t->mat, rv3d->twmat);
// XXX Mat4MulMat34(matt, t->mat, rv3d->twmat);
/* Screen aligned view rot circle */
if(drawflags & MAN_ROT_V) {
@ -735,15 +693,15 @@ static void draw_manipulator_rotate_ghost(View3D *v3d, RegionView3D *rv3d, int d
glPushMatrix();
size= screen_aligned(rv3d, rv3d->twmat);
vec[0]= (float)(t->con.imval[0] - t->center2d[0]);
vec[1]= (float)(t->con.imval[1] - t->center2d[1]);
vec[0]= 0; // XXX (float)(t->con.imval[0] - t->center2d[0]);
vec[1]= 0; // XXX (float)(t->con.imval[1] - t->center2d[1]);
vec[2]= 0.0f;
Normalize(vec);
startphi= saacos( vec[1] );
if(vec[0]<0.0) startphi= -startphi;
phi= (float)fmod(180.0*t->val/M_PI, 360.0);
phi= 0; // XXX (float)fmod(180.0*t->val/M_PI, 360.0);
if(phi > 180.0) phi-= 360.0;
else if(phi<-180.0) phi+= 360.0;
@ -755,8 +713,8 @@ static void draw_manipulator_rotate_ghost(View3D *v3d, RegionView3D *rv3d, int d
float imat[3][3], ivmat[3][3];
/* try to get the start rotation */
svec[0]= (float)(t->con.imval[0] - t->center2d[0]);
svec[1]= (float)(t->con.imval[1] - t->center2d[1]);
svec[0]= 0; // XXX (float)(t->con.imval[0] - t->center2d[0]);
svec[1]= 0; // XXX (float)(t->con.imval[1] - t->center2d[1]);
svec[2]= 0.0f;
/* screen aligned vec transform back to manipulator space */
@ -848,7 +806,6 @@ static void draw_manipulator_rotate_ghost(View3D *v3d, RegionView3D *rv3d, int d
static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving, int drawflags, int combo)
{
TransInfo *t= BIF_GetTransInfo(); // XXX
GLUquadricObj *qobj;
double plane[4];
float size, vec[3], unitmat[4][4];
@ -900,8 +857,8 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
if(moving) {
float vec[3];
vec[0]= (float)(t->imval[0] - t->center2d[0]);
vec[1]= (float)(t->imval[1] - t->center2d[1]);
vec[0]= 0; // XXX (float)(t->imval[0] - t->center2d[0]);
vec[1]= 0; // XXX (float)(t->imval[1] - t->center2d[1]);
vec[2]= 0.0f;
Normalize(vec);
VecMulf(vec, 1.2f*size);
@ -917,7 +874,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
if(moving) {
float matt[4][4];
Mat4CpyMat4(matt, rv3d->twmat); // to copy the parts outside of [3][3]
Mat4MulMat34(matt, t->mat, rv3d->twmat);
// XXX Mat4MulMat34(matt, t->mat, rv3d->twmat);
wmMultMatrix(matt);
glFrontFace( is_mat4_flipped(matt)?GL_CW:GL_CCW);
}
@ -1121,7 +1078,6 @@ static void drawsolidcube(float size)
static void draw_manipulator_scale(View3D *v3d, RegionView3D *rv3d, int moving, int drawflags, int combo, int colcode)
{
TransInfo *t= BIF_GetTransInfo(); // XXX
float cywid= 0.25f*0.01f*(float)U.tw_handlesize;
float cusize= cywid*0.75f, dz;
@ -1153,7 +1109,7 @@ static void draw_manipulator_scale(View3D *v3d, RegionView3D *rv3d, int moving,
float matt[4][4];
Mat4CpyMat4(matt, rv3d->twmat); // to copy the parts outside of [3][3]
Mat4MulMat34(matt, t->mat, rv3d->twmat);
// XXX Mat4MulMat34(matt, t->mat, rv3d->twmat);
wmMultMatrix(matt);
glFrontFace( is_mat4_flipped(matt)?GL_CW:GL_CCW);
}
@ -1238,7 +1194,6 @@ static void draw_cylinder(GLUquadricObj *qobj, float len, float width)
static void draw_manipulator_translate(View3D *v3d, RegionView3D *rv3d, int moving, int drawflags, int combo, int colcode)
{
TransInfo *t= BIF_GetTransInfo(); // XXX
GLUquadricObj *qobj;
float cylen= 0.01f*(float)U.tw_handlesize;
float cywid= 0.25f*cylen, dz, size;
@ -1248,7 +1203,7 @@ static void draw_manipulator_translate(View3D *v3d, RegionView3D *rv3d, int movi
/* when called while moving in mixed mode, do not draw when... */
if((drawflags & MAN_TRANS_C)==0) return;
if(moving) glTranslatef(t->vec[0], t->vec[1], t->vec[2]);
// XXX if(moving) glTranslatef(t->vec[0], t->vec[1], t->vec[2]);
glDisable(GL_DEPTH_TEST);
qobj= gluNewQuadric();
@ -1314,7 +1269,6 @@ static void draw_manipulator_translate(View3D *v3d, RegionView3D *rv3d, int movi
static void draw_manipulator_rotate_cyl(View3D *v3d, RegionView3D *rv3d, int moving, int drawflags, int combo, int colcode)
{
TransInfo *t= BIF_GetTransInfo(); // XXX
GLUquadricObj *qobj;
float size;
float cylen= 0.01f*(float)U.tw_handlesize;
@ -1342,8 +1296,8 @@ static void draw_manipulator_rotate_cyl(View3D *v3d, RegionView3D *rv3d, int mov
if(moving) {
float vec[3];
vec[0]= (float)(t->imval[0] - t->center2d[0]);
vec[1]= (float)(t->imval[1] - t->center2d[1]);
vec[0]= 0; // XXX (float)(t->imval[0] - t->center2d[0]);
vec[1]= 0; // XXX (float)(t->imval[1] - t->center2d[1]);
vec[2]= 0.0f;
Normalize(vec);
VecMulf(vec, 1.2f*size);
@ -1359,9 +1313,9 @@ static void draw_manipulator_rotate_cyl(View3D *v3d, RegionView3D *rv3d, int mov
if(moving) {
float matt[4][4];
Mat4CpyMat4(matt, rv3d->twmat); // to copy the parts outside of [3][3]
if (t->flag & T_USES_MANIPULATOR) {
Mat4MulMat34(matt, t->mat, rv3d->twmat);
}
// XXX if (t->flag & T_USES_MANIPULATOR) {
// XXX Mat4MulMat34(matt, t->mat, rv3d->twmat);
// XXX }
wmMultMatrix(matt);
}
else {