diff options
Diffstat (limited to 'source/blender/blenkernel/intern/subsurf_ccg.c')
-rw-r--r-- | source/blender/blenkernel/intern/subsurf_ccg.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index 9280341b4e4..10792b7d579 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -85,6 +85,8 @@ #include "CCGSubSurf.h" +#include "DEG_depsgraph.h" + #ifdef WITH_OPENSUBDIV # include "opensubdiv_capi.h" #endif @@ -3788,12 +3790,14 @@ static void ccgDM_release(DerivedMesh *dm) { ccgdm->multires.mmd = NULL; } - if (ccgdm->multires.mmd) { - if (ccgdm->multires.modified_flags & MULTIRES_COORDS_MODIFIED) - multires_modifier_update_mdisps(dm); - if (ccgdm->multires.modified_flags & MULTIRES_HIDDEN_MODIFIED) + if (ccgdm->multires.modified_flags & MULTIRES_COORDS_MODIFIED) { + /* TODO/OBMODE, pass real mode? */ + multires_modifier_update_mdisps(dm, OB_MODE_OBJECT); + } + if (ccgdm->multires.modified_flags & MULTIRES_HIDDEN_MODIFIED) { multires_modifier_update_hidden(dm); + } } } @@ -4187,7 +4191,8 @@ static int ccgDM_use_grid_pbvh(CCGDerivedMesh *ccgdm) return 1; } -static struct PBVH *ccgDM_getPBVH(Object *ob, DerivedMesh *dm) +static struct PBVH *ccgDM_getPBVH( + Object *ob, DerivedMesh *dm, eObjectMode object_mode) { CCGDerivedMesh *ccgdm = (CCGDerivedMesh *)dm; CCGKey key; @@ -4204,7 +4209,7 @@ static struct PBVH *ccgDM_getPBVH(Object *ob, DerivedMesh *dm) return NULL; bool grid_pbvh = ccgDM_use_grid_pbvh(ccgdm); - if ((ob->mode & OB_MODE_SCULPT) == 0) { + if ((object_mode & OB_MODE_SCULPT) == 0) { /* In vwpaint, we may use a grid_pbvh for multires/subsurf, under certain conditions. * More complex cases break 'history' trail back to original vertices, in that case we fall back to * deformed cage only (i.e. original deformed mesh). */ |