diff options
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/DerivedMesh.c | 30 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/mesh.c | 10 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/subsurf_ccg.c | 31 |
3 files changed, 30 insertions, 41 deletions
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index cc0770cd186..f53743ea06e 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -1840,6 +1840,36 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos } } +#ifdef WITH_FREESTYLE + /* This Freestyle-specific code still needs to get the Subdivision Surface modifier working */ + if (CustomData_has_layer(&me->edata, CD_FREESTYLE_EDGE)) { + FreestyleEdge *fed = DM_get_edge_data_layer(finaldm, CD_FREESTYLE_EDGE); + if (fed) { + FreestyleEdge *source = CustomData_get_layer(&me->edata, CD_FREESTYLE_EDGE); + int a; + for (a = 0; a < me->totedge; a++) { + fed[a].flag = source[a].flag; + } + for (; a < finaldm->numEdgeData; a++) { + fed[a].flag = 0; + } + } + } + if (CustomData_has_layer(&me->pdata, CD_FREESTYLE_FACE)) { + FreestyleFace *ffa = DM_get_poly_data_layer(finaldm, CD_FREESTYLE_FACE); + if (ffa) { + FreestyleFace *source = CustomData_get_layer(&me->pdata, CD_FREESTYLE_FACE); + int a; + for (a = 0; a < me->totpoly; a++) { + ffa[a].flag = source[a].flag; + } + for (; a < finaldm->numPolyData; a++) { + ffa[a].flag = 0; + } + } + } +#endif + #ifdef WITH_GAMEENGINE /* NavMesh - this is a hack but saves having a NavMesh modifier */ if ((ob->gameflag & OB_NAVMESH) && (finaldm->type == DM_TYPE_CDDM)) { diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 4c963969797..408fadde564 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -2636,16 +2636,6 @@ int BKE_mesh_recalc_tessellation(CustomData *fdata, } } -#ifdef WITH_FREESTYLE - if (CustomData_has_layer(pdata, CD_FREESTYLE_FACE)) { - FreestyleEdge *poly_ffa = CustomData_get_layer(pdata, CD_FREESTYLE_FACE); - FreestyleEdge *face_ffa = CustomData_add_layer(fdata, CD_FREESTYLE_FACE, CD_CALLOC, NULL, totface); - for (mface_index = 0; mface_index < totface; mface_index++) { - face_ffa[mface_index] = poly_ffa[mface_to_poly_map[mface_index]]; - } - } -#endif - mf = mface; for (mface_index = 0; mface_index < totface; mface_index++, mf++) { diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index d3ffde33f0d..025ea909e05 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -3108,10 +3108,6 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss, MEdge *medge = NULL; /* MFace *mface = NULL; */ MPoly *mpoly = NULL; -#ifdef WITH_FREESTYLE - FreestyleEdge *fed = NULL, *ccgdm_fed = NULL; - FreestyleFace *ffa = NULL, *ccgdm_ffa = NULL; -#endif DM_from_template(&ccgdm->dm, dm, DM_TYPE_CCGDM, ccgSubSurf_getNumFinalVerts(ss), @@ -3286,19 +3282,6 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss, has_edge_origindex = CustomData_has_layer(&ccgdm->dm.edgeData, CD_ORIGINDEX); -#ifdef WITH_FREESTYLE - fed = DM_get_edge_data_layer(dm, CD_FREESTYLE_EDGE); - if (fed) { - ccgdm_fed = CustomData_add_layer(&ccgdm->dm.edgeData, CD_FREESTYLE_EDGE, CD_CALLOC, NULL, - ccgSubSurf_getNumFinalEdges(ss)); - } - ffa = DM_get_poly_data_layer(dm, CD_FREESTYLE_FACE); - if (ffa) { - ccgdm_ffa = CustomData_add_layer(&ccgdm->dm.faceData, CD_FREESTYLE_FACE, CD_CALLOC, NULL, - ccgSubSurf_getNumFinalFaces(ss)); - } -#endif - loopindex = loopindex2 = 0; /* current loop index */ for (index = 0; index < totface; index++) { CCGFace *f = ccgdm->faceMap[index].face; @@ -3435,12 +3418,6 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss, /* This is a simple one to one mapping, here... */ polyidx[faceNum] = faceNum; -#ifdef WITH_FREESTYLE - if (ffa && ffa[index].flag & FREESTYLE_FACE_MARK) { - ccgdm_ffa[faceNum].flag |= FREESTYLE_FACE_MARK; - } -#endif - faceNum++; } } @@ -3490,14 +3467,6 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss, } } -#ifdef WITH_FREESTYLE - if (fed && fed[index].flag & FREESTYLE_EDGE_MARK) { - for (i = 0; i < numFinalEdges; ++i) { - ccgdm_fed[edgeNum + i].flag |= FREESTYLE_EDGE_MARK; - } - } -#endif - edgeNum += numFinalEdges; } |