[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [29798] branches/soc-2010-jwilkins: commented out the cylinder test code - it is too buggy to be used right now , left the overlap and other changes.

Tom Musgrove LetterRip at gmail.com
Tue Jun 29 21:27:12 CEST 2010


Revision: 29798
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=29798
Author:   letterrip
Date:     2010-06-29 21:27:12 +0200 (Tue, 29 Jun 2010)

Log Message:
-----------
commented out the cylinder test code - it is too buggy to be used right now, left the overlap and other changes.

Modified Paths:
--------------
    branches/soc-2010-jwilkins/release/scripts/ui/space_userpref.py
    branches/soc-2010-jwilkins/release/scripts/ui/space_view3d_toolbar.py
    branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/paint_stroke.c
    branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/paint_vertex.c
    branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/sculpt.c
    branches/soc-2010-jwilkins/source/blender/makesdna/DNA_userdef_types.h
    branches/soc-2010-jwilkins/source/blender/makesrna/intern/rna_userdef.c

Modified: branches/soc-2010-jwilkins/release/scripts/ui/space_userpref.py
===================================================================
--- branches/soc-2010-jwilkins/release/scripts/ui/space_userpref.py	2010-06-29 17:23:48 UTC (rev 29797)
+++ branches/soc-2010-jwilkins/release/scripts/ui/space_userpref.py	2010-06-29 19:27:12 UTC (rev 29798)
@@ -331,7 +331,6 @@
         col.label(text="Paint and Sculpt:")
         col.prop(edit, "use_unified_radius_and_strength", text="Unified Size and Strength")
         col.prop(edit, "sculpt_paint_pixel_radius", text="Unified Pixel Radius")
-        col.prop(edit, "sculpt_paint_bu_radius", text="Unified BU Radius")
         col.prop(edit, "sculpt_paint_strength", text="Unified Strength")
         col.prop(sculpt, "use_openmp", text="Threaded Sculpt")
 	

Modified: branches/soc-2010-jwilkins/release/scripts/ui/space_view3d_toolbar.py
===================================================================
--- branches/soc-2010-jwilkins/release/scripts/ui/space_view3d_toolbar.py	2010-06-29 17:23:48 UTC (rev 29797)
+++ branches/soc-2010-jwilkins/release/scripts/ui/space_view3d_toolbar.py	2010-06-29 19:27:12 UTC (rev 29798)
@@ -555,10 +555,7 @@
 
             edit = context.user_preferences.edit
             if brush.lock_brush_size:
-                if edit.use_unified_radius_and_strength:
-                    row.prop(edit, "sculpt_paint_bu_radius", text ="Radius", slider=True)
-                else:
-                    row.prop(brush, "unprojected_radius", text="Radius", slider=True)
+                row.prop(brush, "unprojected_radius", text="Radius", slider=True)
             else:
                 if bpy.context.user_preferences.edit.use_unified_radius_and_strength:
                     row.prop(edit, "sculpt_paint_pixel_radius", text="Radius", slider=True)

Modified: branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/paint_stroke.c
===================================================================
--- branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/paint_stroke.c	2010-06-29 17:23:48 UTC (rev 29797)
+++ branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/paint_stroke.c	2010-06-29 19:27:12 UTC (rev 29798)
@@ -344,7 +344,11 @@
 
 static void sculpt_set_brush_radius(bContext* C, Brush *brush, int value)
 {
+	
 	brush->size = value;
+	//printf("resize radius \n");
+	//U.sculpt_paint_pixel_radius = value;
+
 	//PointerRNA brushptr;
 	//PropertyRNA *size;
 
@@ -360,6 +364,7 @@
 
 static void sculpt_set_brush_unprojected_radius(bContext* C, Brush *brush, float value)
 {
+	
 	brush->unprojected_radius = value;
 	//PointerRNA brushptr;
 	//PropertyRNA *unprojected_radius;
@@ -472,7 +477,7 @@
 			int flip;
 			int sign;
 			float visual_strength = brush->alpha * brush->alpha;
-
+			
 			const float min_alpha = 0.20f;
 			const float max_alpha = 0.80f;
 			float* col;

Modified: branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/paint_vertex.c
===================================================================
--- branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/paint_vertex.c	2010-06-29 17:23:48 UTC (rev 29797)
+++ branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/paint_vertex.c	2010-06-29 19:27:12 UTC (rev 29798)
@@ -748,7 +748,7 @@
 	fac = sqrtf(fac_2);
 	
 	alpha= brush->alpha * brush_curve_strength_clamp(brush, fac, size);
-	
+
 	if (brush->flag & BRUSH_ALPHA_PRESSURE)
 		alpha *= pressure;
 		
@@ -814,6 +814,9 @@
 		float testw=0.0f;
 		
 		alpha= brush->alpha;
+
+		CLAMP(alpha, 0.0f, 1.0f);
+		
 		if(tool==VP_MIX || tool==VP_BLUR)
 			testw = paintval*alpha + uw->weight*(1.0-alpha);
 		else if(tool==VP_ADD)

Modified: branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/sculpt.c
===================================================================
--- branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/sculpt.c	2010-06-29 17:23:48 UTC (rev 29797)
+++ branches/soc-2010-jwilkins/source/blender/editors/sculpt_paint/sculpt.c	2010-06-29 19:27:12 UTC (rev 29798)
@@ -1224,7 +1224,7 @@
 	mul_v3_v3(offset, ss->cache->scale);
 	mul_v3_fl(offset, bstrength);
 
-	add_v3_v3v3(p, ss->cache->location, area_normal);
+	//add_v3_v3v3(p, ss->cache->location, area_normal);
 
 	/* threaded loop over nodes */
 	#pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP)
@@ -1235,8 +1235,8 @@
 		sculpt_brush_test_init(ss, &test);
 
 		BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
-			//if(sculpt_brush_test(&test, vd.co)) {
-			if(sculpt_brush_test_cyl(&test, vd.co, ss->cache->location, p)) {
+			if(sculpt_brush_test(&test, vd.co)) {
+			//if(sculpt_brush_test_cyl(&test, vd.co, ss->cache->location, p)) {
 				/* offset vertex */
 				float fade = tex_strength(ss, brush, vd.co, test.dist);
 				float val[3];
@@ -1290,6 +1290,7 @@
 				float fade = tex_strength(ss, brush, vd.co, test.dist);
 				float val[3];
 				
+				/* first we pinch */
 				sub_v3_v3v3(val, test.location, vd.co);
 				mul_v3_fl(val, fade*flippedbstrength);
 				symmetry_feather(sd, ss, vd.co, val);
@@ -1297,6 +1298,7 @@
 				
 				sculpt_clip(sd, ss, vd.co, val);
 				
+				/* then we draw */
 				mul_v3_v3fl(val, offset, fade);
 				symmetry_feather(sd, ss, vd.co, val);
 				add_v3_v3(val, vd.co);
@@ -2017,7 +2019,7 @@
 	int n;
 
 	float temp[3];
-	float p[3];
+	//float p[3];
 
 	int flip;
 
@@ -2036,7 +2038,7 @@
 	mul_v3_fl(temp, displace);
 	add_v3_v3(fc, temp);
 
-	add_v3_v3v3(p, ss->cache->location, an);
+	//add_v3_v3v3(p, ss->cache->location, an);
 
 	#pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP)
 	for (n = 0; n < totnode; n++) {
@@ -2046,8 +2048,8 @@
 		sculpt_brush_test_init(ss, &test);
 
 		BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) {
-			//if (sculpt_brush_test(&test, vd.co)) {
-			if (sculpt_brush_test_cyl(&test, vd.co, ss->cache->location, p)) {
+			if (sculpt_brush_test(&test, vd.co)) {
+			//if (sculpt_brush_test_cyl(&test, vd.co, ss->cache->location, p)) {
 				float intr[3];
 				float val[3];
 
@@ -2623,6 +2625,12 @@
 	int i;
 	int mode;
 
+	//Hopefully it is as easy as this... but I doubt it
+	//if(U.sculpt_paint_settings & BRUSH_USE_UNIFIED_RADIUS_AND_STRENGTH) {
+	//	brush->size = U.sculpt_paint_pixel_radius;
+	//	brush->alpha = U.sculpt_paint_strength;
+	//}
+	
 	ss->cache = cache;
 
 	/* Set scaling adjustment */
@@ -2748,7 +2756,7 @@
 	Brush *brush = paint_brush(&sd->paint);
 
 	int dx, dy;
-
+	
 	if(!((brush->flag & BRUSH_ANCHORED) || (brush->sculpt_tool == SCULPT_TOOL_SNAKE_HOOK) || (brush->sculpt_tool == SCULPT_TOOL_ROTATE)) || cache->first_time)
 		RNA_float_get_array(ptr, "location", cache->true_location);
 	cache->pen_flip = RNA_boolean_get(ptr, "pen_flip");

Modified: branches/soc-2010-jwilkins/source/blender/makesdna/DNA_userdef_types.h
===================================================================
--- branches/soc-2010-jwilkins/source/blender/makesdna/DNA_userdef_types.h	2010-06-29 17:23:48 UTC (rev 29797)
+++ branches/soc-2010-jwilkins/source/blender/makesdna/DNA_userdef_types.h	2010-06-29 19:27:12 UTC (rev 29798)
@@ -375,7 +375,6 @@
 
 	struct ColorBand coba_weight;	/* from texture.h */
 	int sculpt_paint_pixel_radius; /* unified radius of brush in pixels */
-	float sculpt_paint_bu_radius; /* unified radius of brush in blender units */
 	float sculpt_paint_strength; /* unified strenght of brush scaled to brush radius */
 	float pad3;
 } UserDef;

Modified: branches/soc-2010-jwilkins/source/blender/makesrna/intern/rna_userdef.c
===================================================================
--- branches/soc-2010-jwilkins/source/blender/makesrna/intern/rna_userdef.c	2010-06-29 17:23:48 UTC (rev 29797)
+++ branches/soc-2010-jwilkins/source/blender/makesrna/intern/rna_userdef.c	2010-06-29 19:27:12 UTC (rev 29798)
@@ -2222,11 +2222,6 @@
 	RNA_def_property_range(prop, 0, 200);
 	RNA_def_property_ui_text(prop, "Pixels", "Unified Brush Radius in Pixels");
 
-	prop= RNA_def_property(srna, "sculpt_paint_bu_radius", PROP_FLOAT, PROP_NONE);
-	RNA_def_property_float_sdna(prop, NULL, "sculpt_paint_bu_radius");
-	RNA_def_property_range(prop, 0.0f, 1.0f);
-	RNA_def_property_ui_text(prop, "Units", "Unified Brush Radius in Blender Units");
-
 	prop= RNA_def_property(srna, "sculpt_paint_strength", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "sculpt_paint_strength");
 	RNA_def_property_range(prop, 0.0f, 1.0f);





More information about the Bf-blender-cvs mailing list