diff options
author | Hans Goudey <h.goudey@me.com> | 2022-09-06 05:17:28 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-09-06 05:17:28 +0300 |
commit | cfe35802aaa22b6aaf78b840c8b7410e8bef0376 (patch) | |
tree | 49bbea7d7d173784aa80dc4297af976a5f248bb6 /source/blender/blenkernel/intern/subsurf_ccg.c | |
parent | 250f174ce3de776faa9940a1e68542199d26378a (diff) | |
parent | 1fcc673230bf585b2b0239d4476b94523bd0ec21 (diff) |
Merge branch 'master' into refactor-mesh-uv-map-generic
Diffstat (limited to 'source/blender/blenkernel/intern/subsurf_ccg.c')
-rw-r--r-- | source/blender/blenkernel/intern/subsurf_ccg.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index aae060889e9..3574e4fac5e 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -1134,14 +1134,12 @@ static void ccgDM_copyFinalPolyArray(DerivedMesh *dm, MPoly *mpoly) CCGFace *f = ccgdm->faceMap[index].face; int x, y, S, numVerts = ccgSubSurf_getFaceNumVerts(f); int flag = (faceFlags) ? faceFlags[index].flag : ME_SMOOTH; - int mat_nr = (faceFlags) ? faceFlags[index].mat_nr : 0; for (S = 0; S < numVerts; S++) { for (y = 0; y < gridSize - 1; y++) { for (x = 0; x < gridSize - 1; x++) { MPoly *mp = &mpoly[i]; - mp->mat_nr = mat_nr; mp->flag = flag; mp->loopstart = k; mp->totloop = 4; @@ -1607,6 +1605,8 @@ static void set_ccgdm_all_geometry(CCGDerivedMesh *ccgdm, medge = dm->getEdgeArray(dm); const MPoly *mpoly = CustomData_get_layer(&dm->polyData, CD_MPOLY); + const int *material_indices = CustomData_get_layer_named( + &dm->polyData, CD_MPOLY, "material_index"); const int *base_polyOrigIndex = CustomData_get_layer(&dm->polyData, CD_ORIGINDEX); int *vertOrigIndex = DM_get_vert_data_layer(&ccgdm->dm, CD_ORIGINDEX); @@ -1635,7 +1635,7 @@ static void set_ccgdm_all_geometry(CCGDerivedMesh *ccgdm, ccgdm->faceMap[index].startFace = faceNum; faceFlags->flag = mpoly ? mpoly[origIndex].flag : 0; - faceFlags->mat_nr = mpoly ? mpoly[origIndex].mat_nr : 0; + faceFlags->mat_nr = material_indices ? material_indices[origIndex] : 0; faceFlags++; /* set the face base vert */ |