[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [22569] branches/blender2.5/blender/source /blender: 2.5/Sculpt:

Nicholas Bishop nicholasbishop at gmail.com
Mon Aug 17 18:08:09 CEST 2009


Revision: 22569
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=22569
Author:   nicholasbishop
Date:     2009-08-17 18:08:09 +0200 (Mon, 17 Aug 2009)

Log Message:
-----------
2.5/Sculpt:

* Hopefully fixed the tablet pressure in sculpt mode? Can't test because Blender isn't seeing my tablet.

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/blenkernel/intern/paint.c
    branches/blender2.5/blender/source/blender/editors/sculpt_paint/sculpt.c

Modified: branches/blender2.5/blender/source/blender/blenkernel/intern/paint.c
===================================================================
--- branches/blender2.5/blender/source/blender/blenkernel/intern/paint.c	2009-08-17 15:17:45 UTC (rev 22568)
+++ branches/blender2.5/blender/source/blender/blenkernel/intern/paint.c	2009-08-17 16:08:09 UTC (rev 22569)
@@ -87,8 +87,10 @@
 			
 		}
 		
-		if(!found)
+		if(!found) {
 			paint_brush_slot_add(p);
+			id_us_plus(&br->id);
+		}
 		
 		/* Make sure the current slot is the new brush */
 		p->brushes[p->active_brush_index] = br;

Modified: branches/blender2.5/blender/source/blender/editors/sculpt_paint/sculpt.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/sculpt_paint/sculpt.c	2009-08-17 15:17:45 UTC (rev 22568)
+++ branches/blender2.5/blender/source/blender/editors/sculpt_paint/sculpt.c	2009-08-17 16:08:09 UTC (rev 22569)
@@ -1272,6 +1272,7 @@
 		RNA_float_get_array(ptr, "location", cache->true_location);
 	cache->flip = RNA_boolean_get(ptr, "flip");
 	RNA_int_get_array(ptr, "mouse", cache->mouse);
+	cache->pressure = RNA_float_get(ptr, "pressure");
 	
 	/* Truly temporary data that isn't stored in properties */
 
@@ -1467,17 +1468,25 @@
 	SculptSession *ss = CTX_data_active_object(C)->sculpt;
 	StrokeCache *cache = ss->cache;
 	PointerRNA itemptr;
-	float cur_depth;
+	float cur_depth, pressure = 1;
 	float center[3];
 
 	cur_depth = read_cached_depth(&cache->vc, mouse[0], mouse[1]);
 	unproject(ss->cache->mats, center, mouse[0], mouse[1], cur_depth);
+
+	/* Tablet */
+	if(event->custom == EVT_DATA_TABLET) {
+		wmTabletData *wmtab= event->customdata;
+		if(wmtab->Active != EVT_TABLET_NONE)
+			pressure= wmtab->Pressure;
+	}
 				
 	/* Add to stroke */
 	RNA_collection_add(op->ptr, "stroke", &itemptr);
 	RNA_float_set_array(&itemptr, "location", center);
 	RNA_int_set_array(&itemptr, "mouse", mouse);
 	RNA_boolean_set(&itemptr, "flip", event->shift);
+	RNA_float_set(&itemptr, "pressure", pressure);
 	sculpt_update_cache_variants(sd, ss, &itemptr);
 				
 	sculpt_restore_mesh(sd, ss);





More information about the Bf-blender-cvs mailing list