diff options
-rw-r--r-- | source/blender/blenkernel/intern/subsurf_ccg.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index 482633c524d..108c6110a87 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -3411,6 +3411,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss, MEdge *medge = NULL; /* MFace *mface = NULL; */ MPoly *mpoly = NULL; + bool has_edge_cd; DM_from_template(&ccgdm->dm, dm, DM_TYPE_CCGDM, ccgSubSurf_getNumFinalVerts(ss), @@ -3571,6 +3572,8 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss, faceOrigIndex = DM_get_tessface_data_layer(&ccgdm->dm, CD_ORIGINDEX); polyOrigIndex = DM_get_poly_data_layer(&ccgdm->dm, CD_ORIGINDEX); + has_edge_cd = ((ccgdm->dm.edgeData.totlayer - (edgeOrigIndex ? 1 : 0)) != 0); + #if 0 /* this is not in trunk, can gives problems because colors initialize * as black, just don't do it!, it works fine - campbell */ @@ -3765,6 +3768,12 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss, vertNum++; } + if (has_edge_cd) { + for (i = 0; i < numFinalEdges; ++i) { + CustomData_copy_data(&dm->edgeData, &ccgdm->dm.edgeData, mapIndex, edgeNum + i, 1); + } + } + if (edgeOrigIndex) { for (i = 0; i < numFinalEdges; ++i) { edgeOrigIndex[edgeNum + i] = mapIndex; |