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
path: root/source
diff options
context:
space:
mode:
authorMike Erwin <significant.bit@gmail.com>2011-08-03 02:50:06 +0400
committerMike Erwin <significant.bit@gmail.com>2011-08-03 02:50:06 +0400
commit3af9651b903e05cea956f2358394fec3e0c81ef6 (patch)
tree2d1a11d0f4af38867a61690336915756ae09f1e9 /source
parent4fc56e39bdc381bc45af6da13df7d09d10e4156f (diff)
ndof changes: turned off 3D mouse during transform, removed timing bug in image/uv, added option for zoom axis (up/down vs. forward/backward)
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/space_image/image_ops.c9
-rw-r--r--source/blender/editors/transform/transform_ops.c6
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h3
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c25
4 files changed, 31 insertions, 12 deletions
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index 6e84c1a7f0c..1f37583b445 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -452,14 +452,9 @@ static int view_ndof_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event)
wmNDOFMotionData* ndof = (wmNDOFMotionData*) event->customdata;
- float dt = ndof->dt > 0.25f ? 0.0125f : ndof->dt;
- /* this is probably the first event for this motion, so set dt to something reasonable
- * TODO: replace such guesswork with a flag or field from the NDOF manager
- */
-
/* tune these until it feels right */
- const float zoom_sensitivity = 0.5f;
- const float pan_sensitivity = 300.f;
+ const float zoom_sensitivity = 0.5f; // 50% per second (I think)
+ const float pan_sensitivity = 300.f; // screen pixels per second
float pan_x = pan_sensitivity * dt * ndof->tvec[0] / sima->zoom;
float pan_y = pan_sensitivity * dt * ndof->tvec[1] / sima->zoom;
diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c
index 0efd25c4faa..fb40cee95fb 100644
--- a/source/blender/editors/transform/transform_ops.c
+++ b/source/blender/editors/transform/transform_ops.c
@@ -360,11 +360,17 @@ static int transform_modal(bContext *C, wmOperator *op, wmEvent *event)
TransInfo *t = op->customdata;
+ #if 0
+ // stable 2D mouse coords map to different 3D coords while the 3D mouse is active
+ // in other words, 2D deltas are no longer good enough!
+ // disable until individual 'transformers' behave better
+
if (event->type == NDOF_MOTION)
{
/* puts("transform_modal: passing through NDOF_MOTION"); */
return OPERATOR_PASS_THROUGH;
}
+ #endif
/* XXX insert keys are called here, and require context */
t->context= C;
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index 12f8cd656a0..0bf812f1ec2 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -600,6 +600,9 @@ extern UserDef U; /* from blenkernel blender.c */
/* actually... users probably don't care about what the mode
is called, just that it feels right */
#define NDOF_ORBIT_INVERT_AXES (1 << 6)
+/* zoom is up/down if this flag is set (otherwise forward/backward) */
+#define NDOF_ZOOM_UPDOWN (1 << 7)
+#define NDOF_INVERT_ZOOM (1 << 8)
#ifdef __cplusplus
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 0abae2e06b7..9a25c4b581d 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -2324,12 +2324,27 @@ static void attach_ndof_data(wmEvent* event, const GHOST_TEventNDOFMotionData* g
const float s = U.ndof_sensitivity;
data->tvec[0]= s * ghost->tx;
- data->tvec[1]= s * ghost->ty;
- data->tvec[2]= s * ghost->tz;
-
data->rvec[0]= s * ghost->rx;
- data->rvec[1]= s * ghost->ry;
- data->rvec[2]= s * ghost->rz;
+
+ if (U.ndof_flags & NDOF_ZOOM_UPDOWN)
+ {
+ // swap Y and Z
+ data->tvec[1]= s * ghost->tz;
+ data->tvec[2]= s * ghost->ty;
+
+ // should this affect rotation also?
+ // initial guess is 'yes', but get user feedback immediately!
+ data->rvec[1]= s * ghost->rz;
+ data->rvec[2]= s * ghost->ry;
+ }
+ else
+ {
+ data->tvec[1]= s * ghost->ty;
+ data->tvec[2]= s * ghost->tz;
+
+ data->rvec[1]= s * ghost->ry;
+ data->rvec[2]= s * ghost->rz;
+ }
data->dt = ghost->dt;