Fix T39839: Applying the subsurf modifier deletes the freestyle edge marks

This commit is contained in:
Campbell Barton 2014-04-24 05:20:45 +10:00
parent bba974241b
commit 3182c54da6
Notes: blender-bot 2023-02-14 10:46:05 +01:00
Referenced by issue #40315, Boolean modifier with Freestyle edges
Referenced by issue #39882, global transform values for vertices are limited to 10Km
Referenced by issue #39864, Fix T39839: Applying the subsurf modifier deletes the freestyle edge marks.
Referenced by issue #39839, Applying the subsurf modifier deletes the freestyle edge marks.
1 changed files with 9 additions and 0 deletions

View File

@ -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;