[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37189] branches/soc-2011-onion: Revision: 29887

Jason Wilkins Jason.A.Wilkins at gmail.com
Sat Jun 4 20:20:13 CEST 2011


Revision: 37189
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37189
Author:   jwilkins
Date:     2011-06-04 18:20:13 +0000 (Sat, 04 Jun 2011)
Log Message:
-----------
Revision: 29887
Author: nicholasbishop
Date: 12:31:06 AM, Saturday, July 03, 2010
Message:
* Fixed masks not updating after undo

** jwilkins:
** fixed some merge cruft in BLI_pbvh.h
** missing decl for intptr_t in non-MSVC builds in bke/paint.c, added BLO_sys_types.h, is that ok?

Modified Paths:
--------------
    branches/soc-2011-onion/source/blender/blenkernel/intern/paint.c
    branches/soc-2011-onion/source/blender/blenlib/BLI_pbvh.h
    branches/soc-2011-onion/source/blender/editors/sculpt_paint/sculpt.c
    branches/soc-2011-onion/source/blender/editors/sculpt_paint/sculpt_undo.c

Property Changed:
----------------
    branches/soc-2011-onion/


Property changes on: branches/soc-2011-onion
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/soc-2010-jwilkins:28499-37009
/branches/soc-2010-nicolasbishop:28448-29796,29832,29860,29862,29878
/trunk/blender:36833-37054
   + /branches/soc-2010-jwilkins:28499-37009
/branches/soc-2010-nicolasbishop:28448-29796,29832,29860,29862,29878,29887
/trunk/blender:36833-37054

Modified: branches/soc-2011-onion/source/blender/blenkernel/intern/paint.c
===================================================================
--- branches/soc-2011-onion/source/blender/blenkernel/intern/paint.c	2011-06-04 17:48:22 UTC (rev 37188)
+++ branches/soc-2011-onion/source/blender/blenkernel/intern/paint.c	2011-06-04 18:20:13 UTC (rev 37189)
@@ -40,6 +40,7 @@
 
 #include "BLI_utildefines.h"
 
+#include "BLO_sys_types.h" // XXX: for intptr_t
 
 #include "BKE_brush.h"
 #include "BKE_library.h"

Modified: branches/soc-2011-onion/source/blender/blenlib/BLI_pbvh.h
===================================================================
--- branches/soc-2011-onion/source/blender/blenlib/BLI_pbvh.h	2011-06-04 17:48:22 UTC (rev 37188)
+++ branches/soc-2011-onion/source/blender/blenlib/BLI_pbvh.h	2011-06-04 18:20:13 UTC (rev 37189)
@@ -1,6 +1,3 @@
-/**
- * A BVH for high poly meshes.
- * 
 /*
  * $Id$
  *
@@ -124,7 +121,14 @@
 	/* Update color data (used for masks) */
 	PBVH_UpdateColorBuffers = 32,
 
-	PBVH_UpdateRedraw = 64
+	PBVH_UpdateRedraw = 64,
+
+	PBVH_UpdateAll = PBVH_UpdateNormals |
+	                 PBVH_UpdateBB |
+	                 PBVH_UpdateOriginalBB |
+	                 PBVH_UpdateVertBuffers |
+	                 PBVH_UpdateColorBuffers |
+	                 PBVH_UpdateRedraw
 } PBVHNodeFlags;
 
 void BLI_pbvh_node_mark_update(PBVHNode *node);
@@ -272,10 +276,8 @@
 					if(vi.gridkey->mask) { \
 						int j; \
 						vi.mask_combined= 0; \
-						for(j=0; j<vi.gridkey->mask; ++j) { \
-							CustomDataLayer *cdl= vi.vdata->layers + vi.pmask_first_layer + j; \
-							vi.mask_combined+= GRIDELEM_MASK(vi.grid, vi.gridkey)[j] * cdl->strength; \
-						} \
+						for(j=0; j<vi.gridkey->mask; ++j) \
+							vi.mask_combined+= GRIDELEM_MASK(vi.grid, vi.gridkey)[j]; \
 						CLAMP(vi.mask_combined, 0, 1); \
 						if(vi.pmask_active_layer != -1) \
 							vi.mask_active= &GRIDELEM_MASK(vi.grid, \
@@ -292,11 +294,9 @@
 					if(vi.pmask_layer_count) { \
 						int j; \
 						vi.mask_combined= 0; \
-						for(j=0; j<vi.pmask_layer_count; ++j) { \
-							CustomDataLayer *cdl= vi.vdata->layers + vi.pmask_first_layer + j; \
+						for(j=0; j<vi.pmask_layer_count; ++j) \
 							vi.mask_combined+= \
-								((float*)cdl->data)[vi.vert_indices[vi.gx]] * cdl->strength; \
-						} \
+								((float*)vi.vdata->layers[vi.pmask_first_layer + j].data)[vi.vert_indices[vi.gx]]; \
 						CLAMP(vi.mask_combined, 0, 1); \
 						if(vi.pmask_active_layer != -1) \
 							vi.mask_active = &((float*)vi.vdata->layers[vi.pmask_active_layer].data)[vi.vert_indices[vi.gx]]; \

Modified: branches/soc-2011-onion/source/blender/editors/sculpt_paint/sculpt.c
===================================================================
--- branches/soc-2011-onion/source/blender/editors/sculpt_paint/sculpt.c	2011-06-04 17:48:22 UTC (rev 37188)
+++ branches/soc-2011-onion/source/blender/editors/sculpt_paint/sculpt.c	2011-06-04 18:20:13 UTC (rev 37189)
@@ -4417,11 +4417,6 @@
 	sculpt_update_mesh_elements(scene, sd, ob, 0);
 }
 
-static void update_cb(PBVHNode *node, void *UNUSED(data))
-{
-	BLI_pbvh_node_mark_update(node);
-}
-
 static int sculpt_area_hide_invoke(bContext *C, wmOperator *op, wmEvent *event)
 {
 	Object *ob = CTX_data_active_object(C);
@@ -4439,7 +4434,8 @@
 			/* Avoid cracks in multires */
 			if(ss->multires) {
 				BLI_pbvh_search_callback(ss->pbvh, NULL, NULL,
-							 update_cb, NULL);
+							 BLI_pbvh_node_set_flags,
+							 SET_INT_IN_POINTER(PBVH_UpdateAll));
 				multires_stitch_grids(ob);
 			}
 

Modified: branches/soc-2011-onion/source/blender/editors/sculpt_paint/sculpt_undo.c
===================================================================
--- branches/soc-2011-onion/source/blender/editors/sculpt_paint/sculpt_undo.c	2011-06-04 17:48:22 UTC (rev 37188)
+++ branches/soc-2011-onion/source/blender/editors/sculpt_paint/sculpt_undo.c	2011-06-04 18:20:13 UTC (rev 37189)
@@ -66,12 +66,6 @@
 #include "paint_intern.h"
 #include "sculpt_intern.h"
 
-static void update_cb(PBVHNode *node, void *unused)
-{
-	(void)unused;
-	BLI_pbvh_node_mark_update(node);
-}
-
 static void sculpt_restore_deformed(SculptSession *ss, SculptUndoNode *unode, int uindex, int oindex, float coord[3])
 {
 	if(unode->orig_co) {
@@ -227,7 +221,8 @@
 		/* we update all nodes still, should be more clever, but also
 		   needs to work correct when exiting/entering sculpt mode and
 		   the nodes get recreated, though in that case it could do all */
-		BLI_pbvh_search_callback(ss->pbvh, NULL, NULL, update_cb, NULL);
+		BLI_pbvh_search_callback(ss->pbvh, NULL, NULL, BLI_pbvh_node_set_flags,
+					 SET_INT_IN_POINTER(PBVH_UpdateAll));
 		BLI_pbvh_update(ss->pbvh, PBVH_UpdateBB|PBVH_UpdateOriginalBB|PBVH_UpdateRedraw, NULL);
 
 		if((mmd=paint_multires_active(scene, ob)))




More information about the Bf-blender-cvs mailing list