diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-10-10 17:36:53 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-10-10 17:36:53 +0400 |
commit | 725cfab2dc8a505d16680c114b6b7c0e6d7326a5 (patch) | |
tree | 3fbb2ca29a99df757f63ee7648d239d7975c3f74 | |
parent | cb634b910010c04543cb3361f7a16a261e5b9f89 (diff) |
workaround for feedback loop when viewing-selected/all with a locked camera.
the camera could try include its own boundbox in its view.
now just skip the camera if 'All Regions' and lock view option is enabled.
-rw-r--r-- | source/blender/editors/space_view3d/view3d_edit.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 329286953d6..39f644489d2 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -2260,12 +2260,13 @@ static int view3d_all_exec(bContext *C, wmOperator *op) /* was view3d_home() in { ARegion *ar = CTX_wm_region(C); View3D *v3d = CTX_wm_view3d(C); - RegionView3D *rv3d = CTX_wm_region_view3d(C); Scene *scene = CTX_data_scene(C); Base *base; float *curs; - const short skip_camera = ED_view3d_camera_lock_check(v3d, rv3d); const short use_all_regions = RNA_boolean_get(op->ptr, "use_all_regions"); + const short skip_camera = (ED_view3d_camera_lock_check(v3d, ar->regiondata) || + /* any one of the regions may be locked */ + (use_all_regions && v3d->flag2 & V3D_LOCK_CAMERA)); int center = RNA_boolean_get(op->ptr, "center"); float min[3], max[3]; @@ -2351,8 +2352,10 @@ static int viewselected_exec(bContext *C, wmOperator *op) Object *obedit = CTX_data_edit_object(C); float min[3], max[3]; int ok = 0, ok_dist = 1; - const short skip_camera = ED_view3d_camera_lock_check(v3d, ar->regiondata); const short use_all_regions = RNA_boolean_get(op->ptr, "use_all_regions"); + const short skip_camera = (ED_view3d_camera_lock_check(v3d, ar->regiondata) || + /* any one of the regions may be locked */ + (use_all_regions && v3d->flag2 & V3D_LOCK_CAMERA)); INIT_MINMAX(min, max); |