diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-09-28 00:30:05 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-09-28 00:35:06 +0300 |
commit | 64de8c8f0de018f5d2b075db738d7b6322d6d21a (patch) | |
tree | ff53a72ce9481e477b7fafe60f44b7c774c6845f /source/blender/editors/sculpt_paint/paint_vertex_proj.c | |
parent | fcdc7acd8b5963fd4f9fb0a81317c54654d577de (diff) |
Missed in last merge from master
Local changes built, but merge-commit needed amending.
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_vertex_proj.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_vertex_proj.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_vertex_proj.c b/source/blender/editors/sculpt_paint/paint_vertex_proj.c index c9915a294ad..999c9dc7880 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex_proj.c +++ b/source/blender/editors/sculpt_paint/paint_vertex_proj.c @@ -100,16 +100,14 @@ static void vpaint_proj_dm_map_cosnos_init__map_cb(void *userData, int index, co } } -static void vpaint_proj_dm_map_cosnos_init(const bContext *C, Scene *scene, Object *ob, - struct VertProjHandle *vp_handle) +static void vpaint_proj_dm_map_cosnos_init( + const struct EvaluationContext *eval_ctx, Scene *scene, Object *ob, + struct VertProjHandle *vp_handle) { - EvaluationContext eval_ctx; Mesh *me = ob->data; DerivedMesh *dm; - CTX_data_eval_ctx(C, &eval_ctx); - - dm = mesh_get_derived_final(&eval_ctx, scene, ob, CD_MASK_BAREMESH | CD_MASK_ORIGINDEX); + dm = mesh_get_derived_final(eval_ctx, scene, ob, CD_MASK_BAREMESH | CD_MASK_ORIGINDEX); if (dm->foreachMappedVert) { memset(vp_handle->vcosnos, 0, sizeof(DMCoNo) * me->totvert); @@ -174,14 +172,12 @@ static void vpaint_proj_dm_map_cosnos_update__map_cb(void *userData, int index, } } -static void vpaint_proj_dm_map_cosnos_update(const bContext *C, struct VertProjHandle *vp_handle, - ARegion *ar, const float mval_fl[2]) +static void vpaint_proj_dm_map_cosnos_update( + const struct EvaluationContext *eval_ctx, struct VertProjHandle *vp_handle, + ARegion *ar, const float mval_fl[2]) { - EvaluationContext eval_ctx; struct VertProjUpdate vp_update = {vp_handle, ar, mval_fl}; - CTX_data_eval_ctx(C, &eval_ctx); - Scene *scene = vp_handle->scene; Object *ob = vp_handle->ob; Mesh *me = ob->data; @@ -190,7 +186,7 @@ static void vpaint_proj_dm_map_cosnos_update(const bContext *C, struct VertProjH /* quick sanity check - we shouldn't have to run this if there are no modifiers */ BLI_assert(BLI_listbase_is_empty(&ob->modifiers) == false); - dm = mesh_get_derived_final(&eval_ctx, scene, ob, CD_MASK_BAREMESH | CD_MASK_ORIGINDEX); + dm = mesh_get_derived_final(eval_ctx, scene, ob, CD_MASK_BAREMESH | CD_MASK_ORIGINDEX); /* highly unlikely this will become unavailable once painting starts (perhaps with animated modifiers) */ if (LIKELY(dm->foreachMappedVert)) { @@ -206,8 +202,9 @@ static void vpaint_proj_dm_map_cosnos_update(const bContext *C, struct VertProjH /* -------------------------------------------------------------------- */ /* Public Functions */ -struct VertProjHandle *ED_vpaint_proj_handle_create(const bContext *C, Scene *scene, Object *ob, - DMCoNo **r_vcosnos) +struct VertProjHandle *ED_vpaint_proj_handle_create( + const struct EvaluationContext *eval_ctx, Scene *scene, Object *ob, + DMCoNo **r_vcosnos) { struct VertProjHandle *vp_handle = MEM_mallocN(sizeof(struct VertProjHandle), __func__); Mesh *me = ob->data; @@ -217,7 +214,7 @@ struct VertProjHandle *ED_vpaint_proj_handle_create(const bContext *C, Scene *sc vp_handle->use_update = false; /* sets 'use_update' if needed */ - vpaint_proj_dm_map_cosnos_init(C, scene, ob, vp_handle); + vpaint_proj_dm_map_cosnos_init(eval_ctx, scene, ob, vp_handle); if (vp_handle->use_update) { vp_handle->dists_sq = MEM_mallocN(sizeof(float) * me->totvert, __func__); @@ -236,11 +233,12 @@ struct VertProjHandle *ED_vpaint_proj_handle_create(const bContext *C, Scene *sc return vp_handle; } -void ED_vpaint_proj_handle_update(const bContext *C, struct VertProjHandle *vp_handle, - ARegion *ar, const float mval_fl[2]) +void ED_vpaint_proj_handle_update( + const struct EvaluationContext *eval_ctx, struct VertProjHandle *vp_handle, + ARegion *ar, const float mval_fl[2]) { if (vp_handle->use_update) { - vpaint_proj_dm_map_cosnos_update(C, vp_handle, ar, mval_fl); + vpaint_proj_dm_map_cosnos_update(eval_ctx, vp_handle, ar, mval_fl); } } |