Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Bishop <nicholasbishop@gmail.com>2010-12-16 06:39:51 +0300
committerNicholas Bishop <nicholasbishop@gmail.com>2010-12-16 06:39:51 +0300
commite15f34b35fce21c89fdff956402a3671caf18a8b (patch)
tree13b0d4b3bebb092df6d9b1d81cafb76b73d86455 /source/blender/blenkernel/intern/subsurf_ccg.c
parent3ae56ea1b3362d586bb2e7efdce887919ebd789d (diff)
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 :)
Diffstat (limited to 'source/blender/blenkernel/intern/subsurf_ccg.c')
-rw-r--r--source/blender/blenkernel/intern/subsurf_ccg.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c
index 6f6e6844f0b..874fd0fef17 100644
--- a/source/blender/blenkernel/intern/subsurf_ccg.c
+++ b/source/blender/blenkernel/intern/subsurf_ccg.c
@@ -1146,6 +1146,22 @@ static void ccgDM_drawVerts(DerivedMesh *dm) {
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 @@ static void ccgDM_drawEdges(DerivedMesh *dm, int drawLooseEdges, int UNUSED(draw
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 @@ static void ccgDM_glNormalFast(float *a, float *b, float *c, float *d)
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;