Fix #20398: smooth brush + multires could still give problems at inner
face edges.
This commit is contained in:
@@ -2297,9 +2297,8 @@ CCGError ccgSubSurf_stitchFaces(CCGSubSurf *ss, int lvl, CCGFace **effectedF, in
|
||||
VertDataZero(FACE_getCenterData(f));
|
||||
|
||||
for (S=0; S<f->numVerts; S++)
|
||||
if (FACE_getEdges(f)[S]->flags&Edge_eEffected)
|
||||
for (x=0; x<gridSize; x++)
|
||||
VertDataZero(FACE_getIECo(f, lvl, S, x));
|
||||
for (x=0; x<gridSize; x++)
|
||||
VertDataZero(FACE_getIECo(f, lvl, S, x));
|
||||
|
||||
for (S=0; S<f->numVerts; S++) {
|
||||
int prevS = (S+f->numVerts-1)%f->numVerts;
|
||||
@@ -2311,10 +2310,8 @@ CCGError ccgSubSurf_stitchFaces(CCGSubSurf *ss, int lvl, CCGFace **effectedF, in
|
||||
VertDataAdd(VERT_getCo(FACE_getVerts(f)[S], lvl), FACE_getIFCo(f, lvl, S, cornerIdx, cornerIdx));
|
||||
|
||||
for (x=1; x<gridSize-1; x++) {
|
||||
if (FACE_getEdges(f)[S]->flags&Edge_eEffected)
|
||||
VertDataAdd(FACE_getIECo(f, lvl, S, x), FACE_getIFCo(f, lvl, S, x, 0));
|
||||
if (FACE_getEdges(f)[prevS]->flags&Edge_eEffected)
|
||||
VertDataAdd(FACE_getIECo(f, lvl, prevS, x), FACE_getIFCo(f, lvl, S, 0, x));
|
||||
VertDataAdd(FACE_getIECo(f, lvl, S, x), FACE_getIFCo(f, lvl, S, x, 0));
|
||||
VertDataAdd(FACE_getIECo(f, lvl, prevS, x), FACE_getIFCo(f, lvl, S, 0, x));
|
||||
}
|
||||
|
||||
for (x=0; x<gridSize-1; x++) {
|
||||
@@ -2351,9 +2348,8 @@ CCGError ccgSubSurf_stitchFaces(CCGSubSurf *ss, int lvl, CCGFace **effectedF, in
|
||||
VertDataMulN(FACE_getCenterData(f), 1.0f/f->numVerts);
|
||||
|
||||
for (S=0; S<f->numVerts; S++)
|
||||
if (FACE_getEdges(f)[S]->flags&Edge_eEffected)
|
||||
for (x=1; x<gridSize-1; x++)
|
||||
VertDataMulN(FACE_getIECo(f, lvl, S, x), 0.5f);
|
||||
for (x=1; x<gridSize-1; x++)
|
||||
VertDataMulN(FACE_getIECo(f, lvl, S, x), 0.5f);
|
||||
|
||||
for (S=0; S<f->numVerts; S++) {
|
||||
int prevS = (S+f->numVerts-1)%f->numVerts;
|
||||
|
||||
@@ -96,16 +96,11 @@ static void multires_set_tot_level(Object *ob, MultiresModifierData *mmd, int lv
|
||||
{
|
||||
mmd->totlvl = lvl;
|
||||
|
||||
if(ob->mode != OB_MODE_SCULPT) {
|
||||
mmd->lvl = MAX2(mmd->lvl, lvl);
|
||||
CLAMP(mmd->lvl, 0, mmd->totlvl);
|
||||
}
|
||||
if(ob->mode != OB_MODE_SCULPT)
|
||||
mmd->lvl = CLAMPIS(MAX2(mmd->lvl, lvl), 0, mmd->totlvl);
|
||||
|
||||
mmd->sculptlvl = MAX2(mmd->sculptlvl, lvl);
|
||||
CLAMP(mmd->sculptlvl, 0, mmd->totlvl);
|
||||
|
||||
mmd->renderlvl = MAX2(mmd->renderlvl, lvl);
|
||||
CLAMP(mmd->renderlvl, 0, mmd->totlvl);
|
||||
mmd->sculptlvl = CLAMPIS(MAX2(mmd->sculptlvl, lvl), 0, mmd->totlvl);
|
||||
mmd->renderlvl = CLAMPIS(MAX2(mmd->renderlvl, lvl), 0, mmd->totlvl);
|
||||
}
|
||||
|
||||
static void multires_dm_mark_as_modified(DerivedMesh *dm)
|
||||
|
||||
@@ -1242,7 +1242,7 @@ static void ccgDM_drawFacesSolid(DerivedMesh *dm, float (*partial_redraw_planes)
|
||||
|
||||
if(dm->numFaceData) {
|
||||
/* should be per face */
|
||||
if(!setMaterial(faceFlags[1], NULL))
|
||||
if(!setMaterial(faceFlags[1]+1, NULL))
|
||||
return;
|
||||
|
||||
glShadeModel((faceFlags[0] & ME_SMOOTH)? GL_SMOOTH: GL_FLAT);
|
||||
|
||||
Reference in New Issue
Block a user