[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [52007] trunk/blender/source/blender: Fix #33116: Blender Crashes when saving inside Sculpt Mode with with GLSL and textured view enabled .

Sergey Sharybin sergey.vfx at gmail.com
Thu Nov 8 15:01:55 CET 2012


Revision: 52007
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=52007
Author:   nazgul
Date:     2012-11-08 14:01:47 +0000 (Thu, 08 Nov 2012)
Log Message:
-----------
Fix #33116: Blender Crashes when saving inside Sculpt Mode with with GLSL and textured view enabled.

Issue was caused by call ED_sculpt_force_update from WM_file_write which frees
derived mesh and pBVH and forces them to be re-created. After this sculpt session
wasn't repairing properly.

Freeing data from WM_file_write is not nice by itself, but it exposed possible
real issue when sculpting on modifiers. Made it so BLI_pbvh_grids_update will
update pointers to material flags and hidden grids as well.

This isn't idea solution for particular circumstances from the report, since
pBVH would be rebuilt after save which ends up with small interface lags for
while pBVH is rebuilding.

Would be nice to have multires displacement propagation to higher levels
without freeing data.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/subsurf_ccg.c
    trunk/blender/source/blender/blenlib/BLI_pbvh.h
    trunk/blender/source/blender/blenlib/intern/pbvh.c

Modified: trunk/blender/source/blender/blenkernel/intern/subsurf_ccg.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/subsurf_ccg.c	2012-11-08 12:59:54 UTC (rev 52006)
+++ trunk/blender/source/blender/blenkernel/intern/subsurf_ccg.c	2012-11-08 14:01:47 UTC (rev 52007)
@@ -3025,7 +3025,8 @@
 			 * when the ccgdm gets remade, the assumption is that the topology
 			 * does not change. */
 			ccgdm_create_grids(dm);
-			BLI_pbvh_grids_update(ob->sculpt->pbvh, ccgdm->gridData, ccgdm->gridAdjacency, (void **)ccgdm->gridFaces);
+			BLI_pbvh_grids_update(ob->sculpt->pbvh, ccgdm->gridData, ccgdm->gridAdjacency, (void **)ccgdm->gridFaces,
+			                      ccgdm->gridFlagMats, ccgdm->gridHidden);
 		}
 
 		ccgdm->pbvh = ob->sculpt->pbvh;

Modified: trunk/blender/source/blender/blenlib/BLI_pbvh.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_pbvh.h	2012-11-08 12:59:54 UTC (rev 52006)
+++ trunk/blender/source/blender/blenlib/BLI_pbvh.h	2012-11-08 14:01:47 UTC (rev 52007)
@@ -28,6 +28,7 @@
 
 #include "BLI_bitmap.h"
 
+struct BLI_bitmap;
 struct CCGElem;
 struct CCGKey;
 struct CustomData;
@@ -153,7 +154,8 @@
 void BLI_pbvh_redraw_BB(PBVH * bvh, float bb_min[3], float bb_max[3]);
 void BLI_pbvh_get_grid_updates(PBVH *bvh, int clear, void ***gridfaces, int *totface);
 void BLI_pbvh_grids_update(PBVH *bvh, struct CCGElem **grid_elems,
-                           struct DMGridAdjacency *gridadj, void **gridfaces);
+                           struct DMGridAdjacency *gridadj, void **gridfaces,
+                           struct DMFlagMat *flagmats, struct BLI_bitmap *grid_hidden);
 
 /* vertex deformer */
 float (*BLI_pbvh_get_vertCos(struct PBVH *pbvh))[3];

Modified: trunk/blender/source/blender/blenlib/intern/pbvh.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/pbvh.c	2012-11-08 12:59:54 UTC (rev 52006)
+++ trunk/blender/source/blender/blenlib/intern/pbvh.c	2012-11-08 14:01:47 UTC (rev 52007)
@@ -1707,11 +1707,14 @@
 	}
 }
 
-void BLI_pbvh_grids_update(PBVH *bvh, CCGElem **grids, DMGridAdjacency *gridadj, void **gridfaces)
+void BLI_pbvh_grids_update(PBVH *bvh, CCGElem **grids, DMGridAdjacency *gridadj, void **gridfaces,
+                           DMFlagMat *flagmats, BLI_bitmap *grid_hidden)
 {
 	bvh->grids = grids;
 	bvh->gridadj = gridadj;
 	bvh->gridfaces = gridfaces;
+	bvh->grid_flag_mats = flagmats;
+	bvh->grid_hidden = grid_hidden;
 }
 
 float (*BLI_pbvh_get_vertCos(PBVH * pbvh))[3]




More information about the Bf-blender-cvs mailing list