Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_mask.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_mask.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_mask.c b/source/blender/editors/sculpt_paint/paint_mask.c
index 162c067166c..f22e6f514e6 100644
--- a/source/blender/editors/sculpt_paint/paint_mask.c
+++ b/source/blender/editors/sculpt_paint/paint_mask.c
@@ -134,7 +134,7 @@ static int mask_flood_fill_exec(bContext *C, wmOperator *op)
ARegion *ar = CTX_wm_region(C);
struct Scene *scene = CTX_data_scene(C);
Object *ob = CTX_data_active_object(C);
- EvaluationContext eval_ctx;
+ Depsgraph *depsgraph = CTX_data_depsgraph(C);
PaintMaskFloodMode mode;
float value;
PBVH *pbvh;
@@ -143,12 +143,10 @@ static int mask_flood_fill_exec(bContext *C, wmOperator *op)
bool multires;
Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
- CTX_data_eval_ctx(C, &eval_ctx);
-
mode = RNA_enum_get(op->ptr, "mode");
value = RNA_float_get(op->ptr, "value");
- BKE_sculpt_update_mesh_elements(&eval_ctx, scene, sd, ob, false, true);
+ BKE_sculpt_update_mesh_elements(depsgraph, scene, sd, ob, false, true);
pbvh = ob->sculpt->pbvh;
multires = (BKE_pbvh_type(pbvh) == PBVH_GRIDS);
@@ -261,7 +259,7 @@ static void mask_box_select_task_cb(
int ED_sculpt_mask_box_select(struct bContext *C, ViewContext *vc, const rcti *rect, bool select, bool UNUSED(extend))
{
- EvaluationContext eval_ctx;
+ Depsgraph *depsgraph = CTX_data_depsgraph(C);
Sculpt *sd = vc->scene->toolsettings->sculpt;
BoundBox bb;
float clip_planes[4][4];
@@ -277,8 +275,6 @@ int ED_sculpt_mask_box_select(struct bContext *C, ViewContext *vc, const rcti *r
int totnode, symmpass;
int symm = sd->paint.symmetry_flags & PAINT_SYMM_AXIS_ALL;
- CTX_data_eval_ctx(C, &eval_ctx);
-
mode = PAINT_MASK_FLOOD_VALUE;
value = select ? 1.0 : 0.0;
@@ -286,7 +282,7 @@ int ED_sculpt_mask_box_select(struct bContext *C, ViewContext *vc, const rcti *r
ED_view3d_clipping_calc(&bb, clip_planes, vc->ar, vc->obact, rect);
negate_m4(clip_planes);
- BKE_sculpt_update_mesh_elements(&eval_ctx, scene, sd, ob, false, true);
+ BKE_sculpt_update_mesh_elements(depsgraph, scene, sd, ob, false, true);
pbvh = ob->sculpt->pbvh;
multires = (BKE_pbvh_type(pbvh) == PBVH_GRIDS);
@@ -428,7 +424,7 @@ static int paint_mask_gesture_lasso_exec(bContext *C, wmOperator *op)
const int (*mcords)[2] = WM_gesture_lasso_path_to_array(C, op, &mcords_tot);
if (mcords) {
- EvaluationContext eval_ctx;
+ Depsgraph *depsgraph = CTX_data_depsgraph(C);
float clip_planes[4][4], clip_planes_final[4][4];
BoundBox bb;
Object *ob;
@@ -444,8 +440,6 @@ static int paint_mask_gesture_lasso_exec(bContext *C, wmOperator *op)
PaintMaskFloodMode mode = RNA_enum_get(op->ptr, "mode");
float value = RNA_float_get(op->ptr, "value");
- CTX_data_eval_ctx(C, &eval_ctx);
-
/* 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 */
@@ -468,7 +462,7 @@ static int paint_mask_gesture_lasso_exec(bContext *C, wmOperator *op)
ED_view3d_clipping_calc(&bb, clip_planes, vc.ar, vc.obact, &data.rect);
negate_m4(clip_planes);
- BKE_sculpt_update_mesh_elements(&eval_ctx, scene, sd, ob, false, true);
+ BKE_sculpt_update_mesh_elements(depsgraph, scene, sd, ob, false, true);
pbvh = ob->sculpt->pbvh;
multires = (BKE_pbvh_type(pbvh) == PBVH_GRIDS);