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_vertex.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index 46d71ad0c45..b395ac5c49d 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -814,7 +814,7 @@ static unsigned int vpaint_blend(VPaint *vp, unsigned int col, unsigned int colo
}
-static int sample_backbuf_area(ViewContext *vc, int *indexar, int totpoly, int x, int y, float size)
+static int sample_backbuf_area(const bContext *C, ViewContext *vc, int *indexar, int totpoly, int x, int y, float size)
{
struct ImBuf *ibuf;
int a, tot = 0, index;
@@ -823,7 +823,7 @@ static int sample_backbuf_area(ViewContext *vc, int *indexar, int totpoly, int x
* brushes with size > 64, why is this here? */
/*if (size > 64.0) size = 64.0;*/
- ibuf = ED_view3d_backbuf_read(vc, x - size, y - size, x + size, y + size);
+ ibuf = ED_view3d_backbuf_read(C, vc, x - size, y - size, x + size, y + size);
if (ibuf) {
unsigned int *rt = ibuf->rect;
@@ -2097,7 +2097,7 @@ static bool wpaint_stroke_test_start(bContext *C, wmOperator *op, const float UN
}
/* painting on subsurfs should give correct points too, this returns me->totvert amount */
- wpd->vp_handle = ED_vpaint_proj_handle_create(scene, ob, &wpd->vertexcosnos);
+ wpd->vp_handle = ED_vpaint_proj_handle_create(C, scene, ob, &wpd->vertexcosnos);
wpd->indexar = get_indexarray(me);
copy_wpaint_prev(wp, me->dvert, me->totvert);
@@ -2243,7 +2243,7 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
/* Ugly x2, we need this so hidden faces don't draw */
me->editflag |= ME_EDIT_PAINT_FACE_SEL;
}
- totindex = sample_backbuf_area(vc, indexar, me->totpoly, mval[0], mval[1], brush_size_pressure);
+ totindex = sample_backbuf_area(C, vc, indexar, me->totpoly, mval[0], mval[1], brush_size_pressure);
me->editflag = editflag_prev;
if (use_face_sel && me->totpoly) {
@@ -2264,7 +2264,7 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
}
/* incase we have modifiers */
- ED_vpaint_proj_handle_update(wpd->vp_handle, vc->ar, mval);
+ ED_vpaint_proj_handle_update(C, wpd->vp_handle, vc->ar, mval);
/* make sure each vertex gets treated only once */
/* and calculate filter weight */
@@ -2693,7 +2693,7 @@ static bool vpaint_stroke_test_start(bContext *C, struct wmOperator *op, const f
paint_stroke_set_mode_data(stroke, vpd);
view3d_set_viewcontext(C, &vpd->vc);
- vpd->vp_handle = ED_vpaint_proj_handle_create(vpd->vc.scene, ob, &vpd->vertexcosnos);
+ vpd->vp_handle = ED_vpaint_proj_handle_create(C, vpd->vc.scene, ob, &vpd->vertexcosnos);
vpd->indexar = get_indexarray(me);
vpd->paintcol = vpaint_get_current_col(scene, vp);
@@ -2827,7 +2827,7 @@ static void vpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
mul_m4_m4m4(mat, vc->rv3d->persmat, ob->obmat);
/* which faces are involved */
- totindex = sample_backbuf_area(vc, indexar, me->totpoly, mval[0], mval[1], brush_size_pressure);
+ totindex = sample_backbuf_area(C, vc, indexar, me->totpoly, mval[0], mval[1], brush_size_pressure);
if ((me->editflag & ME_EDIT_PAINT_FACE_SEL) && me->mpoly) {
for (index = 0; index < totindex; index++) {
@@ -2843,7 +2843,7 @@ static void vpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
swap_m4m4(vc->rv3d->persmat, mat);
/* incase we have modifiers */
- ED_vpaint_proj_handle_update(vpd->vp_handle, vc->ar, mval);
+ ED_vpaint_proj_handle_update(C, vpd->vp_handle, vc->ar, mval);
/* clear modified tag for blur tool */
if (vpd->mlooptag)
@@ -2980,7 +2980,7 @@ static int weight_from_bones_exec(bContext *C, wmOperator *op)
Mesh *me = ob->data;
int type = RNA_enum_get(op->ptr, "type");
- create_vgroups_from_armature(op->reports, scene, ob, armob, type, (me->editflag & ME_EDIT_MIRROR_X));
+ create_vgroups_from_armature(op->reports, C, scene, ob, armob, type, (me->editflag & ME_EDIT_MIRROR_X));
DEG_id_tag_update(&me->id, 0);
WM_event_add_notifier(C, NC_GEOM | ND_DATA, me);
@@ -3190,6 +3190,7 @@ static int paint_weight_gradient_exec(bContext *C, wmOperator *op)
struct ARegion *ar = CTX_wm_region(C);
Scene *scene = CTX_data_scene(C);
Object *ob = CTX_data_active_object(C);
+ EvaluationContext eval_ctx;
Mesh *me = ob->data;
int x_start = RNA_int_get(op->ptr, "xstart");
int y_start = RNA_int_get(op->ptr, "ystart");
@@ -3198,7 +3199,11 @@ static int paint_weight_gradient_exec(bContext *C, wmOperator *op)
float sco_start[2] = {x_start, y_start};
float sco_end[2] = {x_end, y_end};
const bool is_interactive = (gesture != NULL);
- DerivedMesh *dm = mesh_get_derived_final(scene, ob, scene->customdata_mask);
+ DerivedMesh *dm;
+
+ CTX_data_eval_ctx(C, &eval_ctx);
+
+ dm = mesh_get_derived_final(&eval_ctx, scene, ob, scene->customdata_mask);
DMGradient_userData data = {NULL};