Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-04-23 23:20:45 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-04-23 23:20:45 +0400
commit3182c54da6fd2eb1b3b54781bb447a7bd51b553e (patch)
treea6f0efcb00eabe30d54b518790291d3b173e6b22
parentbba974241b3972f4399c79062f145fe693f42607 (diff)
Fix T39839: Applying the subsurf modifier deletes the freestyle edge marks
-rw-r--r--source/blender/blenkernel/intern/subsurf_ccg.c9
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;