Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Erwin <significant.bit@gmail.com>2011-07-25 04:00:53 +0400
committerMike Erwin <significant.bit@gmail.com>2011-07-25 04:00:53 +0400
commitabf658d36785e3fb0fe458ba7ee9b22987a9c036 (patch)
treeaccc66b0605d01c17cc150f1a1dbd5f28f340ba0 /source/blender/editors/transform
parent6149526aac7a10034ce369147c8c7962f8ed4e35 (diff)
removed old ndof transform stuff, added experimental ndof nav during transform (might disable for release)
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r--source/blender/editors/transform/transform.c127
-rw-r--r--source/blender/editors/transform/transform_ops.c6
2 files changed, 11 insertions, 122 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index d3a30991aa6..81aade5ca64 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -1006,9 +1006,11 @@ int transformEvent(TransInfo *t, wmEvent *event)
else view_editmove(event->type);
t->redraw= 1;
break;
-// case NDOFMOTION:
-// viewmoveNDOF(1);
- // break;
+#if 0
+ case NDOF_MOTION:
+ // should have been caught by tranform_modal
+ return OPERATOR_PASS_THROUGH;
+#endif
default:
handled = 0;
break;
@@ -1017,43 +1019,6 @@ int transformEvent(TransInfo *t, wmEvent *event)
// Numerical input events
t->redraw |= handleNumInput(&(t->num), event);
- // NDof input events
- switch(handleNDofInput(&(t->ndof), event))
- {
- case NDOF_CONFIRM:
- if ((t->options & CTX_NDOF) == 0)
- {
- /* Confirm on normal transform only */
- t->state = TRANS_CONFIRM;
- }
- break;
- case NDOF_CANCEL:
- if (t->options & CTX_NDOF)
- {
- /* Cancel on pure NDOF transform */
- t->state = TRANS_CANCEL;
- }
- else
- {
- /* Otherwise, just redraw, NDof input was cancelled */
- t->redraw |= TREDRAW_HARD;
- }
- break;
- case NDOF_NOMOVE:
- if (t->options & CTX_NDOF)
- {
- /* Confirm on pure NDOF transform */
- t->state = TRANS_CONFIRM;
- }
- break;
- case NDOF_REFRESH:
- t->redraw |= TREDRAW_HARD;
- break;
- default:
- handled = 0;
- break;
- }
-
// Snapping events
t->redraw |= handleSnapping(t, event);
@@ -2886,10 +2851,6 @@ void initRotation(TransInfo *t)
setInputPostFct(&t->mouse, postInputRotation);
initMouseInputMode(t, &t->mouse, INPUT_ANGLE);
- t->ndof.axis = 16;
- /* Scale down and flip input for rotation */
- t->ndof.factor[0] = -0.2f;
-
t->idx_max = 0;
t->num.idx_max = 0;
t->snap[0] = 0.0f;
@@ -3161,8 +3122,6 @@ int Rotation(TransInfo *t, const int UNUSED(mval[2]))
final = t->values[0];
- applyNDofInput(&t->ndof, &final);
-
snapGrid(t, &final);
if ((t->con.mode & CON_APPLY) && t->con.applyRot) {
@@ -3216,11 +3175,6 @@ void initTrackball(TransInfo *t)
initMouseInputMode(t, &t->mouse, INPUT_TRACKBALL);
- t->ndof.axis = 40;
- /* Scale down input for rotation */
- t->ndof.factor[0] = 0.2f;
- t->ndof.factor[1] = 0.2f;
-
t->idx_max = 1;
t->num.idx_max = 1;
t->snap[0] = 0.0f;
@@ -3276,8 +3230,6 @@ int Trackball(TransInfo *t, const int UNUSED(mval[2]))
phi[0] = t->values[0];
phi[1] = t->values[1];
- applyNDofInput(&t->ndof, phi);
-
snapGrid(t, phi);
if (hasNumInput(&t->num)) {
@@ -3331,8 +3283,6 @@ void initTranslation(TransInfo *t)
t->num.flag = 0;
t->num.idx_max = t->idx_max;
- t->ndof.axis = (t->flag & T_2D_EDIT)? 1|2: 1|2|4;
-
if(t->spacetype == SPACE_VIEW3D) {
RegionView3D *rv3d = t->ar->regiondata;
@@ -3507,7 +3457,6 @@ int Translation(TransInfo *t, const int UNUSED(mval[2]))
headerTranslation(t, pvec, str);
}
else {
- applyNDofInput(&t->ndof, t->values);
snapGrid(t, t->values);
applyNumInput(&t->num, t->values);
if (hasNumInput(&t->num)) {
@@ -3616,10 +3565,6 @@ void initTilt(TransInfo *t)
initMouseInputMode(t, &t->mouse, INPUT_ANGLE);
- t->ndof.axis = 16;
- /* Scale down and flip input for rotation */
- t->ndof.factor[0] = -0.2f;
-
t->idx_max = 0;
t->num.idx_max = 0;
t->snap[0] = 0.0f;
@@ -3643,8 +3588,6 @@ int Tilt(TransInfo *t, const int UNUSED(mval[2]))
final = t->values[0];
- applyNDofInput(&t->ndof, &final);
-
snapGrid(t, &final);
if (hasNumInput(&t->num)) {
@@ -3759,10 +3702,6 @@ void initPushPull(TransInfo *t)
initMouseInputMode(t, &t->mouse, INPUT_VERTICAL_ABSOLUTE);
- t->ndof.axis = 4;
- /* Flip direction */
- t->ndof.factor[0] = -1.0f;
-
t->idx_max = 0;
t->num.idx_max = 0;
t->snap[0] = 0.0f;
@@ -3783,8 +3722,6 @@ int PushPull(TransInfo *t, const int UNUSED(mval[2]))
distance = t->values[0];
- applyNDofInput(&t->ndof, &distance);
-
snapGrid(t, &distance);
applyNumInput(&t->num, &distance);
@@ -5309,8 +5246,6 @@ void initSeqSlide(TransInfo *t)
t->num.flag = 0;
t->num.idx_max = t->idx_max;
- t->ndof.axis = 1|2;
-
t->snap[0] = 0.0f;
t->snap[1] = floor(t->scene->r.frs_sec / t->scene->r.frs_sec_base);
t->snap[2] = 10.0f;
@@ -5365,7 +5300,6 @@ int SeqSlide(TransInfo *t, const int UNUSED(mval[2]))
VECCOPY(t->values, tvec);
}
else {
- applyNDofInput(&t->ndof, t->values);
snapGrid(t, t->values);
applyNumInput(&t->num, t->values);
}
@@ -5925,54 +5859,3 @@ void BIF_TransformSetUndo(char *UNUSED(str))
// TRANSFORM_FIX_ME
//Trans.undostr= str;
}
-
-
-#if 0 // TRANSFORM_FIX_ME
-static void NDofTransform(void)
-{
- float fval[7];
- float maxval = 50.0f; // also serves as threshold
- int axis = -1;
- int mode = 0;
- int i;
-
- getndof(fval);
-
- for(i = 0; i < 6; i++)
- {
- float val = fabs(fval[i]);
- if (val > maxval)
- {
- axis = i;
- maxval = val;
- }
- }
-
- switch(axis)
- {
- case -1:
- /* No proper axis found */
- break;
- case 0:
- case 1:
- case 2:
- mode = TFM_TRANSLATION;
- break;
- case 4:
- mode = TFM_ROTATION;
- break;
- case 3:
- case 5:
- mode = TFM_TRACKBALL;
- break;
- default:
- printf("ndof: what we are doing here ?");
- }
-
- if (mode != 0)
- {
- initTransform(mode, CTX_NDOF);
- Transform();
- }
-}
-#endif
diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c
index 7bdf6c909d9..0b0b22fb689 100644
--- a/source/blender/editors/transform/transform_ops.c
+++ b/source/blender/editors/transform/transform_ops.c
@@ -360,6 +360,12 @@ static int transform_modal(bContext *C, wmOperator *op, wmEvent *event)
TransInfo *t = op->customdata;
+ if (event->type == NDOF_MOTION)
+ {
+ // puts("transform_modal: passing through NDOF_MOTION");
+ return OPERATOR_PASS_THROUGH;
+ }
+
/* XXX insert keys are called here, and require context */
t->context= C;
exit_code = transformEvent(t, event);