diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2018-12-01 19:06:44 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2018-12-01 19:09:09 +0300 |
commit | 9ed522db735b1d798a5d68c6bf547e8123d33a4b (patch) | |
tree | b8e08f92ea02f1a6e73c2883e5f55d296cd3cadf /source/blender/editors/sculpt_paint | |
parent | dbb479b998a63bec22ebc3173b22420c955892dd (diff) |
Fix more cases of evaluated mesh being built for non-COW objects.
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_vertex_proj.c | 12 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c | 6 |
2 files changed, 13 insertions, 5 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_vertex_proj.c b/source/blender/editors/sculpt_paint/paint_vertex_proj.c index 31ae12c112a..5fe96483044 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex_proj.c +++ b/source/blender/editors/sculpt_paint/paint_vertex_proj.c @@ -44,6 +44,7 @@ #include "BKE_mesh_runtime.h" #include "DEG_depsgraph.h" +#include "DEG_depsgraph_query.h" #include "ED_screen.h" #include "ED_view3d.h" @@ -103,11 +104,13 @@ static void vpaint_proj_dm_map_cosnos_init__map_cb( } static void vpaint_proj_dm_map_cosnos_init( - struct Depsgraph *depsgraph, Scene *scene, Object *ob, + struct Depsgraph *depsgraph, Scene *UNUSED(scene), Object *ob, struct VertProjHandle *vp_handle) { + Scene *scene_eval = DEG_get_evaluated_scene(depsgraph); + Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob); Mesh *me = ob->data; - Mesh *me_eval = mesh_get_eval_final(depsgraph, scene, ob, CD_MASK_BAREMESH | CD_MASK_ORIGINDEX); + Mesh *me_eval = mesh_get_eval_final(depsgraph, scene_eval, ob_eval, CD_MASK_BAREMESH | CD_MASK_ORIGINDEX); memset(vp_handle->vcosnos, 0, sizeof(*vp_handle->vcosnos) * me->totvert); BKE_mesh_foreach_mapped_vert(me_eval, vpaint_proj_dm_map_cosnos_init__map_cb, vp_handle, MESH_FOREACH_USE_NORMAL); @@ -168,10 +171,11 @@ static void vpaint_proj_dm_map_cosnos_update( { struct VertProjUpdate vp_update = {vp_handle, ar, mval_fl}; - Scene *scene = vp_handle->scene; Object *ob = vp_handle->ob; + Scene *scene_eval = DEG_get_evaluated_scene(depsgraph); + Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob); Mesh *me = ob->data; - Mesh *me_eval = mesh_get_eval_final(depsgraph, scene, ob, CD_MASK_BAREMESH | CD_MASK_ORIGINDEX); + Mesh *me_eval = mesh_get_eval_final(depsgraph, scene_eval, ob_eval, CD_MASK_BAREMESH | CD_MASK_ORIGINDEX); /* quick sanity check - we shouldn't have to run this if there are no modifiers */ BLI_assert(BLI_listbase_is_empty(&ob->modifiers) == false); 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 46eb3995ea3..464b7b8ad2e 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c +++ b/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c @@ -60,6 +60,7 @@ #include "BKE_colortools.h" #include "DEG_depsgraph.h" +#include "DEG_depsgraph_query.h" #include "WM_api.h" #include "WM_types.h" @@ -786,7 +787,10 @@ static int paint_weight_gradient_exec(bContext *C, wmOperator *op) ED_view3d_init_mats_rv3d(ob, ar->regiondata); - Mesh *me_eval = mesh_get_eval_final(depsgraph, scene, ob, scene->customdata_mask | CD_MASK_ORIGINDEX); + Scene *scene_eval = DEG_get_evaluated_scene(depsgraph); + Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob); + + Mesh *me_eval = mesh_get_eval_final(depsgraph, scene_eval, ob_eval, scene->customdata_mask | CD_MASK_ORIGINDEX); if (data.is_init) { data.vert_visit = BLI_BITMAP_NEW(me->totvert, __func__); |