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/lattice/editlattice_tools.c | |
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/lattice/editlattice_tools.c')
-rw-r--r-- | source/blender/editors/lattice/editlattice_tools.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/editors/lattice/editlattice_tools.c b/source/blender/editors/lattice/editlattice_tools.c index 01211a436a4..8cb3666c2af 100644 --- a/source/blender/editors/lattice/editlattice_tools.c +++ b/source/blender/editors/lattice/editlattice_tools.c @@ -73,11 +73,12 @@ static bool make_regular_poll(bContext *C) static int make_regular_exec(bContext *C, wmOperator *UNUSED(op)) { ViewLayer *view_layer = CTX_data_view_layer(C); + View3D *v3d = CTX_wm_view3d(C); const bool is_editmode = CTX_data_edit_object(C) != NULL; if (is_editmode) { uint objects_len; - Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, &objects_len); + Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, CTX_wm_view3d(C), &objects_len); for (uint ob_index = 0; ob_index < objects_len; ob_index++) { Object *ob = objects[ob_index]; Lattice *lt = ob->data; @@ -94,7 +95,7 @@ static int make_regular_exec(bContext *C, wmOperator *UNUSED(op)) MEM_freeN(objects); } else { - FOREACH_SELECTED_OBJECT_BEGIN(view_layer, ob) { + FOREACH_SELECTED_OBJECT_BEGIN(view_layer, v3d, ob) { if (ob->type != OB_LATTICE) { continue; } @@ -218,7 +219,7 @@ static int lattice_flip_exec(bContext *C, wmOperator *op) bool changed = false; const eLattice_FlipAxes axis = RNA_enum_get(op->ptr, "axis"); - Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, &objects_len); + Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, CTX_wm_view3d(C), &objects_len); for (uint ob_index = 0; ob_index < objects_len; ob_index++) { Object *obedit = objects[ob_index]; Lattice *lt; |