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/armature/armature_select.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/armature/armature_select.c')
-rw-r--r-- | source/blender/editors/armature/armature_select.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/source/blender/editors/armature/armature_select.c b/source/blender/editors/armature/armature_select.c index 216d068558d..1c5219e94c8 100644 --- a/source/blender/editors/armature/armature_select.c +++ b/source/blender/editors/armature/armature_select.c @@ -268,11 +268,11 @@ void *get_nearest_bone( if (vc.obedit != NULL) { bases = BKE_view_layer_array_from_bases_in_mode( - vc.view_layer, &bases_len, { + vc.view_layer, vc.v3d, &bases_len, { .object_mode = OB_MODE_EDIT}); } else { - bases = BKE_object_pose_base_array_get(vc.view_layer, &bases_len); + bases = BKE_object_pose_base_array_get(vc.view_layer, vc.v3d, &bases_len); } void *bone = get_bone_from_selectbuffer( @@ -470,7 +470,7 @@ cache_end: view3d_opengl_select_cache_end(); uint bases_len; - Base **bases = BKE_view_layer_array_from_bases_in_edit_mode_unique_data(vc->view_layer, &bases_len); + Base **bases = BKE_view_layer_array_from_bases_in_edit_mode_unique_data(vc->view_layer, vc->v3d, &bases_len); /* See if there are any selected bones in this group */ if (hits > 0) { @@ -630,7 +630,7 @@ bool ED_armature_edit_select_pick(bContext *C, const int mval[2], bool extend, b if (!extend && !deselect && !toggle) { uint objects_len = 0; - Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(vc.view_layer, &objects_len); + Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(vc.view_layer, vc.v3d, &objects_len); ED_armature_edit_deselect_all_multi(objects, objects_len); MEM_freeN(objects); } @@ -886,7 +886,7 @@ static int armature_de_select_more_exec(bContext *C, wmOperator *UNUSED(op)) { ViewLayer *view_layer = CTX_data_view_layer(C); uint objects_len = 0; - 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]; armature_select_more_less(ob, true); @@ -915,7 +915,7 @@ static int armature_de_select_less_exec(bContext *C, wmOperator *UNUSED(op)) { ViewLayer *view_layer = CTX_data_view_layer(C); uint objects_len = 0; - 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]; armature_select_more_less(ob, false); @@ -987,7 +987,7 @@ static void select_similar_length(bContext *C, const float thresh) const float len_max = len * (1.0f + (thresh + FLT_EPSILON)); uint objects_len = 0; - 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]; bArmature *arm = ob->data; @@ -1035,7 +1035,7 @@ static void select_similar_direction(bContext *C, const float thresh) bone_direction_worldspace_get(ob_act, ebone_act, dir_act); uint objects_len = 0; - 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]; bArmature *arm = ob->data; @@ -1066,7 +1066,7 @@ static void select_similar_layer(bContext *C) EditBone *ebone_act = CTX_data_active_bone(C); uint objects_len = 0; - 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]; bArmature *arm = ob->data; @@ -1103,7 +1103,7 @@ static void select_similar_prefix(bContext *C) } uint objects_len = 0; - 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]; bArmature *arm = ob->data; @@ -1142,7 +1142,7 @@ static void select_similar_suffix(bContext *C) return; uint objects_len = 0; - 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]; bArmature *arm = ob->data; @@ -1452,7 +1452,7 @@ static int armature_select_mirror_exec(bContext *C, wmOperator *op) const bool extend = RNA_boolean_get(op->ptr, "extend"); uint objects_len = 0; - 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]; bArmature *arm = ob->data; |