From 12425588f2d33174e4a78873075b185ea51ebc3d Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Sat, 18 Aug 2012 19:54:21 +0000 Subject: Fix simple subsurf on wire edges Subsurf on wire edges gave smooth results even if set to simple subdiv. Added a field to the CCG meshIFC to flag simple subdivision, then when syncing vertices simply skip moving vertices if in simple-subdiv mode. This change affects two places, the level-1 build in sync and the subdivision up to other levels. Fixes bug [#32268] Simple Subsurf Modifier gives unexpected results on edges without faces projects.blender.org/tracker/index.php?func=detail&aid=32268&group_id=9&atid=498 --- source/blender/blenkernel/intern/CCGSubSurf.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'source/blender/blenkernel/intern/CCGSubSurf.c') diff --git a/source/blender/blenkernel/intern/CCGSubSurf.c b/source/blender/blenkernel/intern/CCGSubSurf.c index c456840637a..387d4775ad4 100644 --- a/source/blender/blenkernel/intern/CCGSubSurf.c +++ b/source/blender/blenkernel/intern/CCGSubSurf.c @@ -1798,7 +1798,7 @@ static void ccgSubSurf__calcSubdivLevel(CCGSubSurf *ss, if (seamEdges < 2 || seamEdges != v->numEdges) seam = 0; - if (!v->numEdges) { + if (!v->numEdges || ss->meshIFC.simpleSubdiv) { VertDataCopy(nCo, co, ss); } else if (_vert_isBoundary(v)) { @@ -2246,7 +2246,7 @@ static void ccgSubSurf__sync(CCGSubSurf *ss) if (seamEdges < 2 || seamEdges != v->numEdges) seam = 0; - if (!v->numEdges) { + if (!v->numEdges || ss->meshIFC.simpleSubdiv) { VertDataCopy(nCo, co, ss); } else if (_vert_isBoundary(v)) { @@ -2827,6 +2827,11 @@ int ccgSubSurf_getGridLevelSize(const CCGSubSurf *ss, int level) } } +int ccgSubSurf_getSimpleSubdiv(const CCGSubSurf *ss) +{ + return ss->meshIFC.simpleSubdiv; +} + /* Vert accessors */ CCGVertHDL ccgSubSurf_getVertVertHandle(CCGVert *v) -- cgit v1.2.3