diff options
Diffstat (limited to 'source/blender/blenkernel/intern/paint.c')
-rw-r--r-- | source/blender/blenkernel/intern/paint.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c index 404a1a656d9..07aa21f44ff 100644 --- a/source/blender/blenkernel/intern/paint.c +++ b/source/blender/blenkernel/intern/paint.c @@ -68,6 +68,7 @@ #include "BKE_subsurf.h" #include "DEG_depsgraph.h" +#include "DEG_depsgraph_query.h" #include "bmesh.h" @@ -857,21 +858,12 @@ static bool sculpt_modifiers_active(Scene *scene, Sculpt *sd, Object *ob) } /** - * \param need_mask So taht the evaluated mesh that is returned has mask data. + * \param need_mask So that the evaluated mesh that is returned has mask data. */ void BKE_sculpt_update_mesh_elements( Depsgraph *depsgraph, Scene *scene, Sculpt *sd, Object *ob, bool need_pmap, bool need_mask) { - if (depsgraph == NULL) { - /* Happens on file load. - * - * We do nothing in this case, it will be taken care about on depsgraph - * evaluation. - */ - return; - } - SculptSession *ss = ob->sculpt; Mesh *me = BKE_object_get_original_mesh(ob); MultiresModifierData *mmd = BKE_sculpt_multires_active(scene, ob); @@ -947,13 +939,14 @@ void BKE_sculpt_update_mesh_elements( if (ss->modifiers_active) { if (!ss->orig_cos) { + Object *object_orig = DEG_get_original_object(ob); int a; BKE_sculptsession_free_deformMats(ss); ss->orig_cos = (ss->kb) ? BKE_keyblock_convert_to_vertcos(ob, ss->kb) : BKE_mesh_vertexCos_get(me, NULL); - BKE_crazyspace_build_sculpt(depsgraph, scene, ob, &ss->deform_imats, &ss->deform_cos); + BKE_crazyspace_build_sculpt(depsgraph, scene, object_orig, &ss->deform_imats, &ss->deform_cos); BKE_pbvh_apply_vertCos(ss->pbvh, ss->deform_cos, me->totvert); for (a = 0; a < me->totvert; ++a) { |