diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-02-18 01:29:54 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-02-18 01:31:08 +0400 |
commit | 787623e4a36cdabbf4cb0897fb3fd8446d7ce993 (patch) | |
tree | f99dddc5f34e3a001f08579c1dcf808ef6739dea /source | |
parent | 13870d51773a7d7799084e77b0700c362ddeb64c (diff) |
View3d: remove DEBUG_NDOF_MOTION, replaced by --debug-events option
also set rv3d->rot_angle = 0 on all ndof view3d operators
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_edit.c | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 757784cf32a..09d1416fbf9 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -82,9 +82,6 @@ #include "view3d_intern.h" /* own include */ -/* for ndof prints */ -// #define DEBUG_NDOF_MOTION - bool ED_view3d_offset_lock_check(struct View3D *v3d, struct RegionView3D *rv3d) { return (rv3d->persp != RV3D_CAMOB) && (v3d->ob_centre_cursor || v3d->ob_centre); @@ -1353,22 +1350,17 @@ static int ndof_orbit_invoke(bContext *C, wmOperator *op, const wmEvent *event) v3d = vod->v3d; rv3d = vod->rv3d; - ED_view3d_camera_lock_init(v3d, rv3d); - /* off by default, until changed later this function */ rv3d->rot_angle = 0.0f; + ED_view3d_camera_lock_init(v3d, rv3d); + if (ndof->progress != P_FINISHING) { const bool has_rotation = NDOF_HAS_ROTATE; /* if we can't rotate, fallback to translate (locked axis views) */ const bool has_translate = NDOF_HAS_TRANSLATE && (rv3d->viewlock & RV3D_LOCKED); const bool has_zoom = !rv3d->is_persp; -#ifdef DEBUG_NDOF_MOTION - printf("ndof: T=(%.2f,%.2f,%.2f) R=(%.2f,%.2f,%.2f) dt=%.3f delivered to 3D view\n", - ndof->tx, ndof->ty, ndof->tz, ndof->rx, ndof->ry, ndof->rz, ndof->dt); -#endif - if (has_translate || has_zoom) { view3d_ndof_pan_zoom(ndof, vod->sa, vod->ar, has_translate, has_zoom); } @@ -1423,11 +1415,11 @@ static int ndof_orbit_zoom_invoke(bContext *C, wmOperator *op, const wmEvent *ev v3d = vod->v3d; rv3d = vod->rv3d; - ED_view3d_camera_lock_init(v3d, rv3d); - /* off by default, until changed later this function */ rv3d->rot_angle = 0.0f; + ED_view3d_camera_lock_init(v3d, rv3d); + if (ndof->progress != P_FINISHING) { const bool has_rotation = NDOF_HAS_ROTATE && (RV3D_VIEW_IS_AXIS(rv3d->view) == false); /* if we can't rotate, fallback to translate (locked axis views) */ @@ -1435,10 +1427,6 @@ static int ndof_orbit_zoom_invoke(bContext *C, wmOperator *op, const wmEvent *ev /* always zoom since this is the main purpose of the function */ const bool has_zoom = true; -#ifdef DEBUG_NDOF_MOTION - printf("ndof: T=(%.2f,%.2f,%.2f) R=(%.2f,%.2f,%.2f) dt=%.3f delivered to 3D view\n", - ndof->tx, ndof->ty, ndof->tz, ndof->rx, ndof->ry, ndof->rz, ndof->dt); -#endif if (has_translate || has_zoom) { view3d_ndof_pan_zoom(ndof, vod->sa, vod->ar, has_translate, true); } @@ -1489,13 +1477,14 @@ static int ndof_pan_invoke(bContext *C, wmOperator *op, const wmEvent *event) const bool has_translate = NDOF_HAS_TRANSLATE; const bool has_zoom = !rv3d->is_persp; + /* we're panning here! so erase any leftover rotation from other operators */ + rv3d->rot_angle = 0.0f; + if (has_translate == false) return OPERATOR_CANCELLED; ED_view3d_camera_lock_init(v3d, rv3d); - rv3d->rot_angle = 0.f; /* we're panning here! so erase any leftover rotation from other operators */ - if (ndof->progress != P_FINISHING) { ScrArea *sa = CTX_wm_area(C); ARegion *ar = CTX_wm_region(C); @@ -1551,6 +1540,9 @@ static int ndof_all_invoke(bContext *C, wmOperator *op, const wmEvent *event) v3d = vod->v3d; rv3d = vod->rv3d; + /* off by default, until changed later this function */ + rv3d->rot_angle = 0.0f; + ED_view3d_camera_lock_init(v3d, rv3d); if (ndof->progress != P_FINISHING) { |