diff options
author | Monique Dewanchand <mdewanchand> | 2022-09-14 22:30:20 +0300 |
---|---|---|
committer | Monique <mdewanchand@atmind.nl> | 2022-09-14 22:30:56 +0300 |
commit | 23276bcc37acc54f1e1814abdf482a432523c3a6 (patch) | |
tree | 8677bacc96fb953fb27625a6ae563aa1ae5e1769 /source/blender/editors/space_view3d/view3d_select.cc | |
parent | 1a4854898000661dd7cf57492a7a75cb60ea63ef (diff) |
Adding `const Scene*` parameter in many areas.
Related to {D15885} that requires scene parameter
to be added in many places. To speed up the review process
the adding of the scene parameter was added in a separate
patch.
Reviewed By: mont29
Maniphest Tasks: T73411
Differential Revision: https://developer.blender.org/D15930
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_select.cc')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_select.cc | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/source/blender/editors/space_view3d/view3d_select.cc b/source/blender/editors/space_view3d/view3d_select.cc index ad816f420fe..65631930d18 100644 --- a/source/blender/editors/space_view3d/view3d_select.cc +++ b/source/blender/editors/space_view3d/view3d_select.cc @@ -191,7 +191,7 @@ static void editselect_buf_cache_init(ViewContext *vc, short select_mode) if (vc->obedit) { uint bases_len = 0; Base **bases = BKE_view_layer_array_from_bases_in_edit_mode( - vc->view_layer, vc->v3d, &bases_len); + vc->scene, vc->view_layer, vc->v3d, &bases_len); DRW_select_buffer_context_create(bases, bases_len, select_mode); MEM_freeN(bases); @@ -594,7 +594,8 @@ static blender::Vector<Base *> do_pose_tag_select_op_prepare(ViewContext *vc) { blender::Vector<Base *> bases; - FOREACH_BASE_IN_MODE_BEGIN (vc->view_layer, vc->v3d, OB_ARMATURE, OB_MODE_POSE, base_iter) { + FOREACH_BASE_IN_MODE_BEGIN ( + vc->scene, vc->view_layer, vc->v3d, OB_ARMATURE, OB_MODE_POSE, base_iter) { Object *ob_iter = base_iter->object; bArmature *arm = static_cast<bArmature *>(ob_iter->data); LISTBASE_FOREACH (bPoseChannel *, pchan, &ob_iter->pose->chanbase) { @@ -1309,7 +1310,8 @@ static bool view3d_lasso_select(bContext *C, } } else { /* Edit Mode */ - FOREACH_OBJECT_IN_MODE_BEGIN (vc->view_layer, vc->v3d, ob->type, ob->mode, ob_iter) { + FOREACH_OBJECT_IN_MODE_BEGIN ( + vc->scene, vc->view_layer, vc->v3d, ob->type, ob->mode, ob_iter) { ED_view3d_viewcontext_init_object(vc, ob_iter); bool changed = false; @@ -1652,6 +1654,7 @@ static int bone_select_menu_exec(bContext *C, wmOperator *op) params.sel_op = ED_select_op_from_operator(op->ptr); View3D *v3d = CTX_wm_view3d(C); + Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); const Base *oldbasact = view_layer->basact; @@ -1669,7 +1672,8 @@ static int bone_select_menu_exec(bContext *C, wmOperator *op) } else { bPoseChannel *pchan = (bPoseChannel *)object_mouse_select_menu_data[name_index].item_ptr; - ED_armature_pose_select_pick_bone(view_layer, v3d, basact->object, pchan->bone, ¶ms); + ED_armature_pose_select_pick_bone( + scene, view_layer, v3d, basact->object, pchan->bone, ¶ms); } /* Weak but ensures we activate the menu again before using the enum. */ @@ -1693,7 +1697,7 @@ static int bone_select_menu_exec(bContext *C, wmOperator *op) * Selection causes this to be considered the 'active' pose in weight-paint mode. * Eventually this limitation may be removed. * For now, de-select all other pose objects deforming this mesh. */ - ED_armature_pose_select_in_wpaint_mode(view_layer, basact); + ED_armature_pose_select_in_wpaint_mode(scene, view_layer, basact); } else { if (oldbasact != basact) { @@ -1703,7 +1707,6 @@ static int bone_select_menu_exec(bContext *C, wmOperator *op) } /* Undo? */ - Scene *scene = CTX_data_scene(C); DEG_id_tag_update(&scene->id, ID_RECALC_SELECT); DEG_id_tag_update(&scene->id, ID_RECALC_BASE_FLAGS); WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); @@ -2611,7 +2614,8 @@ static bool ed_object_select_pick(bContext *C, } } } - else if (ED_armature_pose_select_pick_with_buffer(view_layer, + else if (ED_armature_pose_select_pick_with_buffer(scene, + view_layer, v3d, basact ? basact : (Base *)oldbasact, gpu->buffer, @@ -2642,7 +2646,7 @@ static bool ed_object_select_pick(bContext *C, * Selection causes this to be considered the 'active' pose in weight-paint mode. * Eventually this limitation may be removed. * For now, de-select all other pose objects deforming this mesh. */ - ED_armature_pose_select_in_wpaint_mode(view_layer, basact); + ED_armature_pose_select_in_wpaint_mode(scene, view_layer, basact); handled = true; } @@ -3558,7 +3562,7 @@ static bool do_armature_box_select(ViewContext *vc, const rcti *rect, const eSel uint bases_len = 0; Base **bases = BKE_view_layer_array_from_bases_in_edit_mode_unique_data( - vc->view_layer, vc->v3d, &bases_len); + vc->scene, vc->view_layer, vc->v3d, &bases_len); if (SEL_OP_USE_PRE_DESELECT(sel_op)) { changed |= ED_armature_edit_deselect_all_visible_multi_ex(bases, bases_len); @@ -3796,7 +3800,7 @@ static int view3d_box_select_exec(bContext *C, wmOperator *op) if (vc.obedit) { FOREACH_OBJECT_IN_MODE_BEGIN ( - vc.view_layer, vc.v3d, vc.obedit->type, vc.obedit->mode, ob_iter) { + vc.scene, vc.view_layer, vc.v3d, vc.obedit->type, vc.obedit->mode, ob_iter) { ED_view3d_viewcontext_init_object(&vc, ob_iter); bool changed = false; @@ -4642,7 +4646,7 @@ static void view3d_circle_select_recalc(void *user_data) switch (vc.obedit->type) { case OB_MESH: { FOREACH_OBJECT_IN_MODE_BEGIN ( - vc.view_layer, vc.v3d, vc.obact->type, vc.obact->mode, ob_iter) { + vc.scene, vc.view_layer, vc.v3d, vc.obact->type, vc.obact->mode, ob_iter) { ED_view3d_viewcontext_init_object(&vc, ob_iter); BM_mesh_select_mode_flush_ex( vc.em->bm, vc.em->selectmode, BM_SELECT_LEN_FLUSH_RECALC_ALL); @@ -4698,7 +4702,8 @@ static int view3d_circle_select_exec(bContext *C, wmOperator *op) BKE_object_update_select_id(CTX_data_main(C)); } - FOREACH_OBJECT_IN_MODE_BEGIN (vc.view_layer, vc.v3d, obact->type, obact->mode, ob_iter) { + FOREACH_OBJECT_IN_MODE_BEGIN ( + vc.scene, vc.view_layer, vc.v3d, obact->type, obact->mode, ob_iter) { ED_view3d_viewcontext_init_object(&vc, ob_iter); obact = vc.obact; |