[Bf-blender-cvs] [3182c54] master: Fix T39839: Applying the subsurf modifier deletes the freestyle edge marks
Campbell Barton
noreply at git.blender.org
Wed Apr 23 21:21:44 CEST 2014
Commit: 3182c54da6fd2eb1b3b54781bb447a7bd51b553e
Author: Campbell Barton
Date: Thu Apr 24 05:20:45 2014 +1000
https://developer.blender.org/rB3182c54da6fd2eb1b3b54781bb447a7bd51b553e
Fix T39839: Applying the subsurf modifier deletes the freestyle edge marks
===================================================================
M source/blender/blenkernel/intern/subsurf_ccg.c
===================================================================
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c
index 482633c..108c611 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;
More information about the Bf-blender-cvs
mailing list