diff options
Diffstat (limited to 'source/blender')
23 files changed, 36 insertions, 36 deletions
diff --git a/source/blender/editors/armature/armature_select.c b/source/blender/editors/armature/armature_select.c index f178ad640b6..397691a409b 100644 --- a/source/blender/editors/armature/armature_select.c +++ b/source/blender/editors/armature/armature_select.c @@ -174,7 +174,7 @@ void *get_nearest_bone(bContext *C, const int xy[2], bool findunsel) short hits; CTX_data_eval_ctx(C, &eval_ctx); - view3d_set_viewcontext(C, &vc); + ED_view3d_viewcontext_init(C, &vc); // rect.xmin = ... mouseco! rect.xmin = rect.xmax = xy[0]; @@ -491,7 +491,7 @@ bool ED_armature_select_pick(bContext *C, const int mval[2], bool extend, bool d int selmask; CTX_data_eval_ctx(C, &eval_ctx); - view3d_set_viewcontext(C, &vc); + ED_view3d_viewcontext_init(C, &vc); if (BIF_sk_selectStroke(C, mval, extend)) { return true; diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c index f17a83dec8f..f01eed21996 100644 --- a/source/blender/editors/armature/editarmature_sketch.c +++ b/source/blender/editors/armature/editarmature_sketch.c @@ -1932,7 +1932,7 @@ static bool sk_selectStroke(bContext *C, SK_Sketch *sketch, const int mval[2], c short hits; CTX_data_eval_ctx(C, &eval_ctx); - view3d_set_viewcontext(C, &vc); + ED_view3d_viewcontext_init(C, &vc); BLI_rcti_init_pt_radius(&rect, mval, 5); diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 94b090bff05..048ab9c937f 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -4312,7 +4312,7 @@ bool ED_curve_editnurb_select_pick(bContext *C, const int mval[2], bool extend, short hand; view3d_operator_needs_opengl(C); - view3d_set_viewcontext(C, &vc); + ED_view3d_viewcontext_init(C, &vc); location[0] = mval[0]; location[1] = mval[1]; @@ -4988,7 +4988,7 @@ static int add_vertex_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ViewContext vc; - view3d_set_viewcontext(C, &vc); + ED_view3d_viewcontext_init(C, &vc); if (vc.rv3d && !RNA_struct_property_is_set(op->ptr, "location")) { Curve *cu; diff --git a/source/blender/editors/curve/editcurve_paint.c b/source/blender/editors/curve/editcurve_paint.c index 169afb140fb..36eb4c6c5bc 100644 --- a/source/blender/editors/curve/editcurve_paint.c +++ b/source/blender/editors/curve/editcurve_paint.c @@ -608,7 +608,7 @@ static bool curve_draw_init(bContext *C, wmOperator *op, bool is_invoke) cdd->depsgraph = CTX_data_depsgraph(C); if (is_invoke) { - view3d_set_viewcontext(C, &cdd->vc); + ED_view3d_viewcontext_init(C, &cdd->vc); if (ELEM(NULL, cdd->vc.ar, cdd->vc.rv3d, cdd->vc.v3d, cdd->vc.win, cdd->vc.scene)) { MEM_freeN(cdd); BKE_report(op->reports, RPT_ERROR, "Unable to access 3D viewport"); diff --git a/source/blender/editors/curve/editcurve_select.c b/source/blender/editors/curve/editcurve_select.c index 4a4b13d0d1b..673faa37f2a 100644 --- a/source/blender/editors/curve/editcurve_select.c +++ b/source/blender/editors/curve/editcurve_select.c @@ -559,7 +559,7 @@ static int select_linked_pick_invoke(bContext *C, wmOperator *op, const wmEvent const bool select = !RNA_boolean_get(op->ptr, "deselect"); view3d_operator_needs_opengl(C); - view3d_set_viewcontext(C, &vc); + ED_view3d_viewcontext_init(C, &vc); if (!ED_curve_pick_vert(&vc, 1, event->mval, &nu, &bezt, &bp, NULL)) { return OPERATOR_CANCELLED; @@ -1677,7 +1677,7 @@ static int edcu_shortest_path_pick_invoke(bContext *C, wmOperator *op, const wmE } view3d_operator_needs_opengl(C); - view3d_set_viewcontext(C, &vc); + ED_view3d_viewcontext_init(C, &vc); if (!ED_curve_pick_vert(&vc, 1, event->mval, &nu_dst, &bezt_dst, &bp_dst, NULL)) { return OPERATOR_PASS_THROUGH; diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c index cbb5abf1309..b72ac8c63c8 100644 --- a/source/blender/editors/curve/editfont.c +++ b/source/blender/editors/curve/editfont.c @@ -1857,7 +1857,7 @@ bool ED_curve_editfont_select_pick(bContext *C, const int mval[2], bool extend, const float dist = ED_view3d_select_dist_px(); float dist_sq_best = dist * dist; - view3d_set_viewcontext(C, &vc); + ED_view3d_viewcontext_init(C, &vc); ED_view3d_init_mats_rv3d(vc.obedit, vc.rv3d); diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index e3eb4c7ac97..64d749dc7a7 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -351,7 +351,7 @@ int view3d_opengl_select( /* view3d_select.c */ float ED_view3d_select_dist_px(void); -void view3d_set_viewcontext(struct bContext *C, struct ViewContext *vc); +void ED_view3d_viewcontext_init(struct bContext *C, struct ViewContext *vc); void view3d_operator_needs_opengl(const struct bContext *C); void view3d_region_operator_needs_opengl(struct wmWindow *win, struct ARegion *ar); void view3d_opengl_read_pixels(struct ARegion *ar, int x, int y, int w, int h, int format, int type, void *data); diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c index 1d732f74b8d..97936820c18 100644 --- a/source/blender/editors/mesh/editmesh_select.c +++ b/source/blender/editors/mesh/editmesh_select.c @@ -3413,7 +3413,7 @@ void MESH_OT_select_nth(wmOperatorType *ot) void em_setup_viewcontext(bContext *C, ViewContext *vc) { - view3d_set_viewcontext(C, vc); + ED_view3d_viewcontext_init(C, vc); if (vc->obedit) { vc->em = BKE_editmesh_from_object(vc->obedit); diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c index 4daa4a23470..aebfd46a554 100644 --- a/source/blender/editors/mesh/meshtools.c +++ b/source/blender/editors/mesh/meshtools.c @@ -1102,7 +1102,7 @@ bool ED_mesh_pick_face(bContext *C, Object *ob, const int mval[2], unsigned int return false; CTX_data_eval_ctx(C, &eval_ctx); - view3d_set_viewcontext(C, &vc); + ED_view3d_viewcontext_init(C, &vc); if (size) { /* sample rect to increase chances of selecting, so that when clicking @@ -1273,7 +1273,7 @@ bool ED_mesh_pick_vert(bContext *C, Object *ob, const int mval[2], unsigned int if (!me || me->totvert == 0) return false; - view3d_set_viewcontext(C, &vc); + ED_view3d_viewcontext_init(C, &vc); if (use_zbuf) { if (size > 0) { diff --git a/source/blender/editors/metaball/mball_edit.c b/source/blender/editors/metaball/mball_edit.c index 935f1a5ea4a..310325ee143 100644 --- a/source/blender/editors/metaball/mball_edit.c +++ b/source/blender/editors/metaball/mball_edit.c @@ -598,7 +598,7 @@ bool ED_mball_select_pick(bContext *C, const int mval[2], bool extend, bool dese rcti rect; CTX_data_eval_ctx(C, &eval_ctx); - view3d_set_viewcontext(C, &vc); + ED_view3d_viewcontext_init(C, &vc); BLI_rcti_init_pt_radius(&rect, mval, 12); diff --git a/source/blender/editors/object/object_lattice.c b/source/blender/editors/object/object_lattice.c index b2f9bee27ff..1653c246974 100644 --- a/source/blender/editors/object/object_lattice.c +++ b/source/blender/editors/object/object_lattice.c @@ -883,7 +883,7 @@ bool ED_lattice_select_pick(bContext *C, const int mval[2], bool extend, bool de BPoint *bp = NULL; Lattice *lt; - view3d_set_viewcontext(C, &vc); + ED_view3d_viewcontext_init(C, &vc); lt = ((Lattice *)vc.obedit->data)->editlatt->latt; bp = findnearestLattvert(&vc, mval, true); diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index b336b560ef2..033f9d190b7 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -1286,7 +1286,7 @@ static void object_transform_axis_target_cancel(bContext *C, wmOperator *op) static int object_transform_axis_target_invoke(bContext *C, wmOperator *op, const wmEvent *event) { ViewContext vc; - view3d_set_viewcontext(C, &vc); + ED_view3d_viewcontext_init(C, &vc); if (!object_is_target_compat(vc.obact)) { /* Falls back to texture space transform. */ diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index 850ef0ad958..597cdf08c76 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -412,7 +412,7 @@ static void PE_set_view3d_data(bContext *C, PEData *data) { PE_set_data(C, data); - view3d_set_viewcontext(C, &data->vc); + ED_view3d_viewcontext_init(C, &data->vc); if (V3D_IS_ZBUF(data->vc.v3d)) { if (data->vc.v3d->flag & V3D_INVALID_BACKBUF) { diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c index 3a43c7a6585..d2063d15ddf 100644 --- a/source/blender/editors/sculpt_paint/paint_cursor.c +++ b/source/blender/editors/sculpt_paint/paint_cursor.c @@ -1033,7 +1033,7 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused)) /* can't use stroke vc here because this will be called during * mouse over too, not just during a stroke */ ViewContext vc; - view3d_set_viewcontext(C, &vc); + ED_view3d_viewcontext_init(C, &vc); if (vc.rv3d && (vc.rv3d->rflag & RV3D_NAVIGATING)) { return; diff --git a/source/blender/editors/sculpt_paint/paint_hide.c b/source/blender/editors/sculpt_paint/paint_hide.c index b175a33934a..5d4451dd3d8 100644 --- a/source/blender/editors/sculpt_paint/paint_hide.c +++ b/source/blender/editors/sculpt_paint/paint_hide.c @@ -325,7 +325,7 @@ static void clip_planes_from_rect(bContext *C, BoundBox bb; view3d_operator_needs_opengl(C); - view3d_set_viewcontext(C, &vc); + ED_view3d_viewcontext_init(C, &vc); ED_view3d_clipping_calc(&bb, clip_planes, vc.ar, vc.obact, rect); negate_m4(clip_planes); } diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 5595f81dd4e..969bf8f37b1 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -760,7 +760,7 @@ static PaintOperation *texture_paint_init(bContext *C, wmOperator *op, const flo PaintOperation *pop = MEM_callocN(sizeof(PaintOperation), "PaintOperation"); /* caller frees */ Brush *brush = BKE_paint_brush(&settings->imapaint.paint); int mode = RNA_enum_get(op->ptr, "mode"); - view3d_set_viewcontext(C, &pop->vc); + ED_view3d_viewcontext_init(C, &pop->vc); copy_v2_v2(pop->prevmouse, mouse); copy_v2_v2(pop->startmouse, mouse); diff --git a/source/blender/editors/sculpt_paint/paint_mask.c b/source/blender/editors/sculpt_paint/paint_mask.c index 64969075d89..162c067166c 100644 --- a/source/blender/editors/sculpt_paint/paint_mask.c +++ b/source/blender/editors/sculpt_paint/paint_mask.c @@ -449,7 +449,7 @@ static int paint_mask_gesture_lasso_exec(bContext *C, wmOperator *op) /* Calculations of individual vertices are done in 2D screen space to diminish the amount of * calculations done. Bounding box PBVH collision is not computed against enclosing rectangle * of lasso */ - view3d_set_viewcontext(C, &vc); + ED_view3d_viewcontext_init(C, &vc); /* lasso data calculations */ data.vc = &vc; diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index 3982c9a3c30..861015375cb 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -698,7 +698,7 @@ PaintStroke *paint_stroke_new(bContext *C, Brush *br = stroke->brush = BKE_paint_brush(p); float zoomx, zoomy; - view3d_set_viewcontext(C, &stroke->vc); + ED_view3d_viewcontext_init(C, &stroke->vc); stroke->get_location = get_location; stroke->test_start = test_start; diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c index 6b14f97d80c..a45e33e4654 100644 --- a/source/blender/editors/sculpt_paint/paint_utils.c +++ b/source/blender/editors/sculpt_paint/paint_utils.c @@ -468,7 +468,7 @@ void paint_sample_color(bContext *C, ARegion *ar, int x, int y, bool texpaint_pr unsigned int totpoly = me->totpoly; if (dm->getLoopDataArray(dm, CD_MLOOPUV)) { - view3d_set_viewcontext(C, &vc); + ED_view3d_viewcontext_init(C, &vc); view3d_operator_needs_opengl(C); diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 5ecd530f5b7..f8ad943ffef 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -1481,7 +1481,7 @@ static bool wpaint_stroke_test_start(bContext *C, wmOperator *op, const float mo /* make mode data storage */ wpd = MEM_callocN(sizeof(struct WPaintData), "WPaintData"); paint_stroke_set_mode_data(stroke, wpd); - view3d_set_viewcontext(C, &wpd->vc); + ED_view3d_viewcontext_init(C, &wpd->vc); view_angle_limits_init(&wpd->normal_angle_precalc, vp->paint.brush->falloff_angle, (vp->paint.brush->flag & BRUSH_FRONTFACE_FALLOFF) != 0); @@ -2481,7 +2481,7 @@ static bool vpaint_stroke_test_start(bContext *C, struct wmOperator *op, const f /* make mode data storage */ vpd = MEM_callocN(sizeof(*vpd), "VPaintData"); paint_stroke_set_mode_data(stroke, vpd); - view3d_set_viewcontext(C, &vpd->vc); + ED_view3d_viewcontext_init(C, &vpd->vc); view_angle_limits_init(&vpd->normal_angle_precalc, vp->paint.brush->falloff_angle, (vp->paint.brush->flag & BRUSH_FRONTFACE_FALLOFF) != 0); diff --git a/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c b/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c index 72e2e7b323d..7ff9c3851ac 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c +++ b/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c @@ -183,7 +183,7 @@ static int weight_sample_invoke(bContext *C, wmOperator *op, const wmEvent *even Mesh *me; bool changed = false; - view3d_set_viewcontext(C, &vc); + ED_view3d_viewcontext_init(C, &vc); me = BKE_mesh_from_object(vc.obact); if (me && me->dvert && vc.v3d && vc.rv3d && (vc.obact->actdef != 0)) { @@ -298,7 +298,7 @@ static const EnumPropertyItem *weight_paint_sample_enum_itemf( ViewContext vc; Mesh *me; - view3d_set_viewcontext(C, &vc); + ED_view3d_viewcontext_init(C, &vc); me = BKE_mesh_from_object(vc.obact); if (me && me->dvert && vc.v3d && vc.rv3d && vc.obact->defbase.first) { @@ -367,7 +367,7 @@ static int weight_sample_group_exec(bContext *C, wmOperator *op) { int type = RNA_enum_get(op->ptr, "group"); ViewContext vc; - view3d_set_viewcontext(C, &vc); + ED_view3d_viewcontext_init(C, &vc); BLI_assert(type + 1 >= 0); vc.obact->actdef = type + 1; diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 5333436f34f..2d847d53877 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -4728,7 +4728,7 @@ bool sculpt_stroke_get_location(bContext *C, float out[3], const float mouse[2]) bool original; ViewContext vc; - view3d_set_viewcontext(C, &vc); + ED_view3d_viewcontext_init(C, &vc); ob = vc.obact; @@ -5940,7 +5940,7 @@ static void sample_detail(bContext *C, int ss_co[2]) float ray_start[3], ray_end[3], ray_normal[3], depth; SculptDetailRaycastData srd; float mouse[2] = {ss_co[0], ss_co[1]}; - view3d_set_viewcontext(C, &vc); + ED_view3d_viewcontext_init(C, &vc); sd = CTX_data_tool_settings(C)->sculpt; ob = vc.obact; diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 8c3ee6da012..a90a719b556 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -106,7 +106,7 @@ float ED_view3d_select_dist_px(void) } /* TODO: should return whether there is valid context to continue */ -void view3d_set_viewcontext(bContext *C, ViewContext *vc) +void ED_view3d_viewcontext_init(bContext *C, ViewContext *vc) { memset(vc, 0, sizeof(ViewContext)); vc->ar = CTX_wm_region(C); @@ -872,7 +872,7 @@ static int view3d_lasso_select_exec(bContext *C, wmOperator *op) view3d_operator_needs_opengl(C); /* setup view context for argument to callbacks */ - view3d_set_viewcontext(C, &vc); + ED_view3d_viewcontext_init(C, &vc); extend = RNA_boolean_get(op->ptr, "extend"); select = !RNA_boolean_get(op->ptr, "deselect"); @@ -1320,7 +1320,7 @@ Base *ED_view3d_give_base_under_cursor(bContext *C, const int mval[2]) view3d_operator_needs_opengl(C); CTX_data_eval_ctx(C, &eval_ctx); - view3d_set_viewcontext(C, &vc); + ED_view3d_viewcontext_init(C, &vc); hits = mixed_bones_object_selectbuffer(&eval_ctx, &vc, buffer, mval, false, false, &do_nearest); @@ -1371,7 +1371,7 @@ static bool ed_object_select_pick( /* setup view context for argument to callbacks */ CTX_data_eval_ctx(C, &eval_ctx); - view3d_set_viewcontext(C, &vc); + ED_view3d_viewcontext_init(C, &vc); is_obedit = (vc.obedit != NULL); if (object) { @@ -2113,7 +2113,7 @@ static int view3d_borderselect_exec(bContext *C, wmOperator *op) /* setup view context for argument to callbacks */ CTX_data_eval_ctx(C, &eval_ctx); - view3d_set_viewcontext(C, &vc); + ED_view3d_viewcontext_init(C, &vc); select = !RNA_boolean_get(op->ptr, "deselect"); extend = RNA_boolean_get(op->ptr, "extend"); @@ -2813,7 +2813,7 @@ static bool object_circle_select(ViewContext *vc, const bool select, const int m static int view3d_circle_select_exec(bContext *C, wmOperator *op) { ViewContext vc; - view3d_set_viewcontext(C, &vc); + ED_view3d_viewcontext_init(C, &vc); Object *obact = vc.obact; Object *obedit = vc.obedit; EvaluationContext eval_ctx; |