From ea5670f4b597828bfb0170f9b659d19ebdb5ab33 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Sun, 24 Oct 2010 02:02:37 +0000 Subject: [PATCH] Fixed bug #24364, "subsurf modifier causes wire-only meshes to disappear in object mode." * Re-added code to draw loose edge --- .../blender/blenkernel/intern/subsurf_ccg.c | 42 ++++++++++++------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index 4b810059464..51cee333370 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -1151,8 +1151,10 @@ static void ccgDM_drawEdges(DerivedMesh *dm, int drawLooseEdges, int UNUSED(draw CCGDerivedMesh *ccgdm = (CCGDerivedMesh*) dm; CCGSubSurf *ss = ccgdm->ss; CCGFaceIterator *fi = ccgSubSurf_getFaceIterator(ss); + CCGEdgeIterator *ei = ccgSubSurf_getEdgeIterator(ss); int gridSize = ccgSubSurf_getGridSize(ss); - int start, end, step; + int edgeSize = ccgSubSurf_getEdgeSize(ss); + int step; int useAging; ccgSubSurf_getUseAgeCounts(ss, &useAging, NULL, NULL, NULL); @@ -1165,20 +1167,12 @@ static void ccgDM_drawEdges(DerivedMesh *dm, int drawLooseEdges, int UNUSED(draw glColor3ub(0, 0, 0); } - if(drawLooseEdges) { - start = 0; - end = gridSize; + if(ccgdm->drawInteriorEdges) + step = 1; + else step = gridSize - 1; - } - else if(ccgdm->drawInteriorEdges) { - start = 1; - end = gridSize - 1; - step = 1; - } - - if(drawLooseEdges && ccgdm->drawInteriorEdges) - step = 1; + /* draw edges using face grids */ for (; !ccgFaceIterator_isStopped(fi); ccgFaceIterator_next(fi)) { CCGFace *f = ccgFaceIterator_getCurrent(fi); int S, x, y, numVerts = ccgSubSurf_getFaceNumVerts(f); @@ -1186,13 +1180,13 @@ static void ccgDM_drawEdges(DerivedMesh *dm, int drawLooseEdges, int UNUSED(draw for (S=0; S