diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-01-17 12:46:46 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-01-17 12:46:46 +0400 |
commit | 146d1b9cab47378734dcc61562336f4582d68b0b (patch) | |
tree | 5af18afd723af1aae6af955af4b6a2910a9b07fc /source/blender/editors/space_view3d/view3d_view.c | |
parent | d9855243d25b22c0e7dd8cba1591220fa35c9098 (diff) |
minor changes to view3d
- BKE_camera_params_from_object now sets the lens to 35 if the object isnt a camera/lamp, without this the view3d lens would be used in camera view.
- running smooth-view multiple times now stores the initial user view rather then over-writing from the current state each time re-smoothview runs.
- redraw panels after smoothview finishes.
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_view.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_view.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index e9ef24873ca..087ca960bd3 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -163,9 +163,17 @@ void view3d_smooth_view(bContext *C, View3D *v3d, ARegion *ar, Object *oldcamera /* initialize sms */ view3d_smooth_view_state_backup(&sms.dst, v3d, rv3d); - view3d_smooth_view_state_backup(&sms.org, v3d, rv3d); view3d_smooth_view_state_backup(&sms.src, v3d, rv3d); - sms.to_camera = false; + /* if smoothview runs multiple times... */ + if (rv3d->sms == NULL) { + view3d_smooth_view_state_backup(&sms.org, v3d, rv3d); + sms.org_view = rv3d->view; + } + else { + sms.org = rv3d->sms->org; + sms.org_view = rv3d->sms->org_view; + } + /* sms.to_camera = false; */ /* initizlized to zero anyway */ /* note on camera locking, this is a little confusing but works ok. * we may be changing the view 'as if' there is no active camera, but in fact @@ -217,7 +225,6 @@ void view3d_smooth_view(bContext *C, View3D *v3d, ARegion *ar, Object *oldcamera /* grid draw as floor */ if ((rv3d->viewlock & RV3D_LOCKED) == 0) { /* use existing if exists, means multiple calls to smooth view wont loose the original 'view' setting */ - sms.org_view = rv3d->sms ? rv3d->sms->org_view : rv3d->view; rv3d->view = RV3D_VIEW_USER; } @@ -347,12 +354,16 @@ static int view3d_smoothview_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent view3d_boxview_copy(CTX_wm_area(C), CTX_wm_region(C)); /* note: this doesn't work right because the v3d->lens is now used in ortho mode r51636, - * when switching camera in quad-view the other ortho views would zoom & reset. */ -#if 0 - WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, v3d); -#else - ED_region_tag_redraw(CTX_wm_region(C)); -#endif + * when switching camera in quad-view the other ortho views would zoom & reset. + * + * For now only redraw all regions when smoothview finishes. + */ + if (step >= 1.0f) { + WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, v3d); + } + else { + ED_region_tag_redraw(CTX_wm_region(C)); + } return OPERATOR_FINISHED; } |