diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-12-15 21:00:22 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-12-15 21:00:22 +0300 |
commit | fedea2eb5c4b5d414349cc460bedc4485af90d53 (patch) | |
tree | c5198942dae4e549e9f9108844800e1f1ab7677e /source | |
parent | 6ef7c3bb2bc4c59d000b3a8bacbfb0a27d2b5c55 (diff) |
Fix #20393: subsurfed objects only allow a single material.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/subsurf_ccg.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index 793ea26a602..072a665e0e9 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -931,8 +931,8 @@ static void ccgDM_copyFinalFaceArray(DerivedMesh *dm, MFace *mface) for(index = 0; index < totface; index++) { CCGFace *f = ccgdm->faceMap[index].face; int x, y, S, numVerts = ccgSubSurf_getFaceNumVerts(f); - int mat_nr = 0; - int flag = ME_SMOOTH; /* assume face is smooth by default */ + int flag = (faceFlags)? faceFlags[index*2]: ME_SMOOTH; + int mat_nr = (faceFlags)? faceFlags[index*2+1]: 0; for(S = 0; S < numVerts; S++) { for(y = 0; y < gridSize - 1; y++) { @@ -947,8 +947,7 @@ static void ccgDM_copyFinalFaceArray(DerivedMesh *dm, MFace *mface) mf->v4 = getFaceIndex(ss, f, S, x + 1, y + 0, edgeSize, gridSize); mf->mat_nr = mat_nr; - if(faceFlags) mf->flag = faceFlags[index*2]; - else mf->flag = flag; + mf->flag = flag; i++; } |