Revision: 38958
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38958
Author:   merwin
Date:     2011-08-02 22:50:06 +0000 (Tue, 02 Aug 2011)
Log Message:
-----------
ndof changes: turned off 3D mouse during transform, removed timing bug in 
image/uv, added option for zoom axis (up/down vs. forward/backward)

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_image/image_ops.c
    trunk/blender/source/blender/editors/transform/transform_ops.c
    trunk/blender/source/blender/makesdna/DNA_userdef_types.h
    trunk/blender/source/blender/windowmanager/intern/wm_event_system.c

Modified: trunk/blender/source/blender/editors/space_image/image_ops.c
===================================================================
--- trunk/blender/source/blender/editors/space_image/image_ops.c        
2011-08-02 21:29:33 UTC (rev 38957)
+++ trunk/blender/source/blender/editors/space_image/image_ops.c        
2011-08-02 22:50:06 UTC (rev 38958)
@@ -452,14 +452,9 @@
 
        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;

Modified: trunk/blender/source/blender/editors/transform/transform_ops.c
===================================================================
--- trunk/blender/source/blender/editors/transform/transform_ops.c      
2011-08-02 21:29:33 UTC (rev 38957)
+++ trunk/blender/source/blender/editors/transform/transform_ops.c      
2011-08-02 22:50:06 UTC (rev 38958)
@@ -360,11 +360,17 @@
 
        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;

Modified: trunk/blender/source/blender/makesdna/DNA_userdef_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_userdef_types.h   2011-08-02 
21:29:33 UTC (rev 38957)
+++ trunk/blender/source/blender/makesdna/DNA_userdef_types.h   2011-08-02 
22:50:06 UTC (rev 38958)
@@ -600,6 +600,9 @@
 /* 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

Modified: trunk/blender/source/blender/windowmanager/intern/wm_event_system.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_event_system.c 
2011-08-02 21:29:33 UTC (rev 38957)
+++ trunk/blender/source/blender/windowmanager/intern/wm_event_system.c 
2011-08-02 22:50:06 UTC (rev 38958)
@@ -2324,13 +2324,28 @@
        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;
 
        data->progress = (wmProgress) ghost->progress;

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to