[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [33701] trunk/blender/source/blender/ blenkernel/intern/subsurf_ccg.c: Fixed bug [#22634] sculpting/ multires and wireframe display mode glitches

Nicholas Bishop nicholasbishop at gmail.com
Thu Dec 16 04:39:52 CET 2010


Revision: 33701
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=33701
Author:   nicholasbishop
Date:     2010-12-16 04:39:51 +0100 (Thu, 16 Dec 2010)

Log Message:
-----------
Fixed bug [#22634] sculpting/multires and wireframe display mode glitches

Added a call to flush sculpting face grid changes out to ccgsubsurf's
other data (in particular, to edge grids)

Hopefully correct fix this time :)

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/subsurf_ccg.c

Modified: trunk/blender/source/blender/blenkernel/intern/subsurf_ccg.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/subsurf_ccg.c	2010-12-16 03:39:49 UTC (rev 33700)
+++ trunk/blender/source/blender/blenkernel/intern/subsurf_ccg.c	2010-12-16 03:39:51 UTC (rev 33701)
@@ -1146,6 +1146,22 @@
 	ccgFaceIterator_free(fi);
 	glEnd();
 }
+
+static void ccgdm_pbvh_update(CCGDerivedMesh *ccgdm)
+{
+	if(ccgdm->pbvh && ccgDM_use_grid_pbvh(ccgdm)) {
+		CCGFace **faces;
+		int totface;
+
+		BLI_pbvh_get_grid_updates(ccgdm->pbvh, 1, (void***)&faces, &totface);
+		if(totface) {
+			ccgSubSurf_updateFromFaces(ccgdm->ss, 0, faces, totface);
+			ccgSubSurf_updateNormals(ccgdm->ss, faces, totface);
+			MEM_freeN(faces);
+		}
+	}
+}
+
 static void ccgDM_drawEdges(DerivedMesh *dm, int drawLooseEdges, int UNUSED(drawAllEdges)) {
 	CCGDerivedMesh *ccgdm = (CCGDerivedMesh*) dm;
 	CCGSubSurf *ss = ccgdm->ss;
@@ -1155,6 +1171,8 @@
 	int gridSize = ccgSubSurf_getGridSize(ss);
 	int useAging;
 
+	ccgdm_pbvh_update(ccgdm);
+
 	ccgSubSurf_getUseAgeCounts(ss, &useAging, NULL, NULL, NULL);
 
 	for (; !ccgEdgeIterator_isStopped(ei); ccgEdgeIterator_next(ei)) {
@@ -1249,21 +1267,6 @@
 	glNormal3fv(no);
 }
 
-static void ccgdm_pbvh_update(CCGDerivedMesh *ccgdm)
-{
-	if(ccgdm->pbvh && ccgDM_use_grid_pbvh(ccgdm)) {
-		CCGFace **faces;
-		int totface;
-
-		BLI_pbvh_get_grid_updates(ccgdm->pbvh, 1, (void***)&faces, &totface);
-		if(totface) {
-			ccgSubSurf_updateFromFaces(ccgdm->ss, 0, faces, totface);
-			ccgSubSurf_updateNormals(ccgdm->ss, faces, totface);
-			MEM_freeN(faces);
-		}
-	}
-}
-
 	/* Only used by non-editmesh types */
 static void ccgDM_drawFacesSolid(DerivedMesh *dm, float (*partial_redraw_planes)[4], int fast, int (*setMaterial)(int, void *attribs)) {
 	CCGDerivedMesh *ccgdm = (CCGDerivedMesh*) dm;





More information about the Bf-blender-cvs mailing list