mask data is no longer automatically added when sculpting (except when there is a multi-res modifier).
This commit is contained in:
@@ -895,15 +895,16 @@ static void multires_subdivide(MultiresModifierData *mmd, Object *ob, int totlvl
|
||||
CCGKey highGridKey, lowGridKey;
|
||||
CCGSubSurf *ss;
|
||||
int i, numGrids, highGridSize;
|
||||
int has_mask = CustomData_has_layer(&me->ldata, CD_GRID_PAINT_MASK);
|
||||
|
||||
/* create subsurf DM from original mesh at high level */
|
||||
cddm = CDDM_from_mesh(me, NULL);
|
||||
DM_set_only_copy(cddm, CD_MASK_BAREMESH);
|
||||
highdm = subsurf_dm_create_local(ob, cddm, totlvl, simple, 0, mmd->flags & eMultiresModifierFlag_PlainUv, TRUE);
|
||||
highdm = subsurf_dm_create_local(ob, cddm, totlvl, simple, 0, mmd->flags & eMultiresModifierFlag_PlainUv, has_mask);
|
||||
ss = ((CCGDerivedMesh *)highdm)->ss;
|
||||
|
||||
/* create multires DM from original mesh at low level */
|
||||
lowdm = multires_dm_create_local(ob, cddm, lvl, lvl, simple, TRUE);
|
||||
lowdm = multires_dm_create_local(ob, cddm, lvl, lvl, simple, has_mask);
|
||||
cddm->release(cddm);
|
||||
|
||||
/* copy subsurf grids and replace them with low displaced grids */
|
||||
@@ -1166,17 +1167,18 @@ void multires_modifier_update_mdisps(struct DerivedMesh *dm)
|
||||
CCGKey highGridKey, lowGridKey;
|
||||
CCGSubSurf *ss;
|
||||
int i, j, numGrids, highGridSize, lowGridSize;
|
||||
int has_mask = CustomData_has_layer(&me->ldata, CD_GRID_PAINT_MASK);
|
||||
|
||||
/* create subsurf DM from original mesh at high level */
|
||||
if (ob->derivedDeform) cddm = CDDM_copy(ob->derivedDeform);
|
||||
else cddm = CDDM_from_mesh(me, NULL);
|
||||
DM_set_only_copy(cddm, CD_MASK_BAREMESH);
|
||||
|
||||
highdm = subsurf_dm_create_local(ob, cddm, totlvl, mmd->simple, 0, mmd->flags & eMultiresModifierFlag_PlainUv, TRUE);
|
||||
highdm = subsurf_dm_create_local(ob, cddm, totlvl, mmd->simple, 0, mmd->flags & eMultiresModifierFlag_PlainUv, has_mask);
|
||||
ss = ((CCGDerivedMesh *)highdm)->ss;
|
||||
|
||||
/* create multires DM from original mesh and displacements */
|
||||
lowdm = multires_dm_create_local(ob, cddm, lvl, totlvl, mmd->simple, TRUE);
|
||||
lowdm = multires_dm_create_local(ob, cddm, lvl, totlvl, mmd->simple, has_mask);
|
||||
cddm->release(cddm);
|
||||
|
||||
/* gather grid data */
|
||||
@@ -1228,12 +1230,13 @@ void multires_modifier_update_mdisps(struct DerivedMesh *dm)
|
||||
}
|
||||
else {
|
||||
DerivedMesh *cddm, *subdm;
|
||||
int has_mask = CustomData_has_layer(&me->ldata, CD_GRID_PAINT_MASK);
|
||||
|
||||
if (ob->derivedDeform) cddm = CDDM_copy(ob->derivedDeform);
|
||||
else cddm = CDDM_from_mesh(me, NULL);
|
||||
DM_set_only_copy(cddm, CD_MASK_BAREMESH);
|
||||
|
||||
subdm = subsurf_dm_create_local(ob, cddm, mmd->totlvl, mmd->simple, 0, mmd->flags & eMultiresModifierFlag_PlainUv, TRUE);
|
||||
subdm = subsurf_dm_create_local(ob, cddm, mmd->totlvl, mmd->simple, 0, mmd->flags & eMultiresModifierFlag_PlainUv, has_mask);
|
||||
cddm->release(cddm);
|
||||
|
||||
multiresModifier_disp_run(dm, me, NULL, CALC_DISPLACEMENTS, subdm->getGridData(subdm), mmd->totlvl);
|
||||
@@ -2109,7 +2112,7 @@ void multires_load_old(Object *ob, Mesh *me)
|
||||
* reference subsurfed dm with this option, before calling multiresModifier_disp_run(),
|
||||
* which implicitly expects both subsurfs from its first dm and oldGridData parameters to
|
||||
* be of the same "format"! */
|
||||
dm = multires_make_derived_from_derived(orig, mmd, ob, MULTIRES_ALLOC_PAINT_MASK);
|
||||
dm = multires_make_derived_from_derived(orig, mmd, ob, 0);
|
||||
|
||||
multires_load_old_dm(dm, me, mmd->totlvl + 1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user