diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-11-25 14:50:34 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-11-25 14:50:34 +0300 |
commit | 4c3ed98ca27667c3403361199096e31eaa93cce2 (patch) | |
tree | 653c568d9d0547f7ac4beb847a590912d97102c0 /source/blender/editors/transform | |
parent | e60c49ecf06815039137c98f86a7198d6ee81e14 (diff) |
Local View
Bring back per-viewport localview. This is based on Blender 2.79.
We have a limit of 16 different local view viewports.
We are using both the numpad /, as well as the regular /.
Missing features:
* Hack to make sure lights are always visible.
* Make rendered mode with external engines to support this as well
(probably just need to support this in the RNA iterators).
* Support over 16 viewports by taking existing viewports out of local view.
The code can use a cleanup pass in the future to unify the test to see
if an object is visible (or we can use TESTBASE in more places).
Diffstat (limited to 'source/blender/editors/transform')
4 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index adf4d5bec4b..4ef84f3f493 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -1213,7 +1213,7 @@ void initTransDataContainers_FromObjectData(TransInfo *t, Object *obact, Object bool free_objects = false; if (objects == NULL) { objects = BKE_view_layer_array_from_objects_in_mode( - t->view_layer, &objects_len, { + t->view_layer, t->view, &objects_len, { .object_mode = object_mode, .no_dup_data = true}); free_objects = true; diff --git a/source/blender/editors/transform/transform_gizmo_2d.c b/source/blender/editors/transform/transform_gizmo_2d.c index 48c18ef2d8a..6a6764e7a0b 100644 --- a/source/blender/editors/transform/transform_gizmo_2d.c +++ b/source/blender/editors/transform/transform_gizmo_2d.c @@ -165,10 +165,11 @@ static void gizmo2d_calc_bounds(const bContext *C, float *r_center, float *r_min if (sa->spacetype == SPACE_IMAGE) { SpaceImage *sima = sa->spacedata.first; ViewLayer *view_layer = CTX_data_view_layer(C); + View3D *v3d = CTX_wm_view3d(C); Image *ima = ED_space_image(sima); uint objects_len = 0; Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data_with_uvs( - view_layer, &objects_len); + view_layer, v3d, &objects_len); if (!ED_uvedit_minmax_multi(CTX_data_scene(C), ima, objects, objects_len, r_min, r_max)) { zero_v2(r_min); zero_v2(r_max); diff --git a/source/blender/editors/transform/transform_gizmo_3d.c b/source/blender/editors/transform/transform_gizmo_3d.c index 8872fe91ae3..5c3d8c0c791 100644 --- a/source/blender/editors/transform/transform_gizmo_3d.c +++ b/source/blender/editors/transform/transform_gizmo_3d.c @@ -816,7 +816,7 @@ int ED_transform_calc_gizmo_stats( { \ invert_m4_m4(obedit->imat, obedit->obmat); \ uint objects_len = 0; \ - Object **objects = BKE_view_layer_array_from_objects_in_edit_mode(view_layer, &objects_len); \ + Object **objects = BKE_view_layer_array_from_objects_in_edit_mode(view_layer, CTX_wm_view3d(C), &objects_len); \ for (uint ob_index = 0; ob_index < objects_len; ob_index++) { \ Object *ob_iter = objects[ob_index]; \ const bool use_mat_local = (ob_iter != obedit); diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index 22eb817c2b1..c2aacafa589 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -994,7 +994,7 @@ static void CalcSnapGeometry(TransInfo *t, float *UNUSED(vec)) uint objects_len = 0; Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data_with_uvs( - t->view_layer, &objects_len); + t->view_layer, t->view, &objects_len); float dist_sq = FLT_MAX; if (ED_uvedit_nearest_uv_multi(t->scene, ima, objects, objects_len, co, &dist_sq, t->tsnap.snapPoint)) { |