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

Jason Wilkins Jason.A.Wilkins at gmail.com
Sat Jun 11 21:36:15 CEST 2011


Revision: 37417
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37417
Author:   jwilkins
Date:     2011-06-11 19:36:14 +0000 (Sat, 11 Jun 2011)
Log Message:
-----------
Revision: 30793
Author: nicholasbishop
Date: 12:53:28 AM, Tuesday, July 27, 2010
Message:
== Sculpt ==

* Removed the mask brush, replaced with a BRUSH_MASK flag
* Added RNA/UI for that (UI is a checkbox in the brush panel)

TODO:
* For now, all brushes behave the same in mask mode; some brushes should have special behavior (e.g. smooth should smooth the mask)

**jwilkins:
**commented out things instead of deleting
**not sure if this is the way I want to go with masking
**all brush flags are now taken, need to refactor

Modified Paths:
--------------
    branches/soc-2011-onion/release/scripts/startup/bl_ui/space_view3d_toolbar.py
    branches/soc-2011-onion/source/blender/blenkernel/intern/brush.c
    branches/soc-2011-onion/source/blender/editors/sculpt_paint/sculpt.c
    branches/soc-2011-onion/source/blender/makesdna/DNA_brush_types.h
    branches/soc-2011-onion/source/blender/makesrna/intern/rna_brush.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-30783,30792
/trunk/blender:36833-37386
   + /branches/soc-2010-jwilkins:28499-37009
/branches/soc-2010-nicolasbishop:28448-30783,30792-30793
/trunk/blender:36833-37386

Modified: branches/soc-2011-onion/release/scripts/startup/bl_ui/space_view3d_toolbar.py
===================================================================
--- branches/soc-2011-onion/release/scripts/startup/bl_ui/space_view3d_toolbar.py	2011-06-11 19:10:55 UTC (rev 37416)
+++ branches/soc-2011-onion/release/scripts/startup/bl_ui/space_view3d_toolbar.py	2011-06-11 19:36:14 UTC (rev 37417)
@@ -602,6 +602,8 @@
 
                 col.prop(brush, "use_accumulate")
 
+            col.prop(brush, "mask")
+
             if brush.sculpt_tool not in ('MASK', 'LAYER', 'GRAB', 'ROTATE', 'THUMB', 'SMOOTH'):
                 col.separator()
 

Modified: branches/soc-2011-onion/source/blender/blenkernel/intern/brush.c
===================================================================
--- branches/soc-2011-onion/source/blender/blenkernel/intern/brush.c	2011-06-11 19:10:55 UTC (rev 37416)
+++ branches/soc-2011-onion/source/blender/blenkernel/intern/brush.c	2011-06-11 19:36:14 UTC (rev 37417)
@@ -366,7 +366,7 @@
 		br->sub_col[0] = 0.25;
 		br->sub_col[1] = 1;
 		break;
-	case SCULPT_TOOL_MASK:
+	/*case SCULPT_TOOL_MASK: temporarily removed (maybe)
 		br->flag |= BRUSH_FRONTFACE;
 		br->add_col[0] = 0.750000;
 		br->add_col[1] = 0.750000;
@@ -374,7 +374,7 @@
 		br->sub_col[0] = 0.250000;
 		br->sub_col[1] = 0.250000;
 		br->sub_col[2] = 0.250000;
-		break;
+		break;*/
 	case SCULPT_TOOL_INFLATE:
 		br->add_col[0] = 0.750000;
 		br->add_col[1] = 0.750000;

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-11 19:10:55 UTC (rev 37416)
+++ branches/soc-2011-onion/source/blender/editors/sculpt_paint/sculpt.c	2011-06-11 19:36:14 UTC (rev 37417)
@@ -582,7 +582,7 @@
 		case SCULPT_TOOL_DRAW:
 		case SCULPT_TOOL_GRAVITY:
 		case SCULPT_TOOL_LAYER:
-		case SCULPT_TOOL_MASK:
+		/*case SCULPT_TOOL_MASK: temporarily removed (maybe) */
 			return alpha * flip * pressure * overlap * feather;
 
 		case SCULPT_TOOL_CREASE:
@@ -2792,65 +2792,66 @@
 		}
 
 		/* Apply one type of brush action */
-		switch(brush->sculpt_tool){
-		case SCULPT_TOOL_DRAW:
-			do_draw_brush(sd, ob, nodes, totnode);
-			break;
-		case SCULPT_TOOL_GRAVITY:
-			do_gravity_brush(sd, ob, nodes, totnode);
-			break;
-		case SCULPT_TOOL_SMOOTH:
-			do_smooth_brush(sd, ob, nodes, totnode);
-			break;
-		case SCULPT_TOOL_CREASE:
-			do_crease_brush(sd, ob, nodes, totnode);
-			break;
-		case SCULPT_TOOL_BLOB:
-			do_crease_brush(sd, ob, nodes, totnode);
-			break;
-		case SCULPT_TOOL_PINCH:
-			do_pinch_brush(sd, ob, nodes, totnode);
-			break;
-		case SCULPT_TOOL_INFLATE:
-			do_inflate_brush(sd, ob, nodes, totnode);
-			break;
-		case SCULPT_TOOL_GRAB:
-			do_grab_brush(sd, ob, nodes, totnode);
-			break;
-		case SCULPT_TOOL_ROTATE:
-			do_rotate_brush(sd, ob, nodes, totnode);
-			break;
-		case SCULPT_TOOL_SNAKE_HOOK:
-			do_snake_hook_brush(sd, ob, nodes, totnode);
-			break;
-		case SCULPT_TOOL_NUDGE:
-			do_nudge_brush(sd, ob, nodes, totnode);
-			break;
-		case SCULPT_TOOL_THUMB:
-			do_thumb_brush(sd, ob, nodes, totnode);
-			break;
-		case SCULPT_TOOL_LAYER:
-			//do_layer_brush(sd, ob, nodes, totnode);
-			do_draw_brush(sd, ob, nodes, totnode);
-			break;
-		case SCULPT_TOOL_FLATTEN:
-			do_flatten_brush(sd, ob, nodes, totnode);
-			break;
-		case SCULPT_TOOL_CLAY:
-			do_clay_brush(sd, ob, nodes, totnode);
-			break;
-		case SCULPT_TOOL_CLAY_STRIPS:
-			do_clay_strips_brush(sd, ob, nodes, totnode);
-			break;
-		case SCULPT_TOOL_FILL:
-			do_fill_brush(sd, ob, nodes, totnode);
-			break;
-		case SCULPT_TOOL_SCRAPE:
-			do_scrape_brush(sd, ob, nodes, totnode);
-			break;
-		case SCULPT_TOOL_MASK:
+		if(brush->flag & BRUSH_MASK)
 			do_mask_brush(sd, ob, nodes, totnode);
-			break;
+		else {
+			switch(brush->sculpt_tool){
+			case SCULPT_TOOL_DRAW:
+				do_draw_brush(sd, ob, nodes, totnode);
+				break;
+			case SCULPT_TOOL_GRAVITY:
+				do_gravity_brush(sd, ob, nodes, totnode);
+				break;
+			case SCULPT_TOOL_SMOOTH:
+				do_smooth_brush(sd, ob, nodes, totnode);
+				break;
+			case SCULPT_TOOL_CREASE:
+				do_crease_brush(sd, ob, nodes, totnode);
+				break;
+			case SCULPT_TOOL_BLOB:
+				do_crease_brush(sd, ob, nodes, totnode);
+				break;
+			case SCULPT_TOOL_PINCH:
+				do_pinch_brush(sd, ob, nodes, totnode);
+				break;
+			case SCULPT_TOOL_INFLATE:
+				do_inflate_brush(sd, ob, nodes, totnode);
+				break;
+			case SCULPT_TOOL_GRAB:
+				do_grab_brush(sd, ob, nodes, totnode);
+				break;
+			case SCULPT_TOOL_ROTATE:
+				do_rotate_brush(sd, ob, nodes, totnode);
+				break;
+			case SCULPT_TOOL_SNAKE_HOOK:
+				do_snake_hook_brush(sd, ob, nodes, totnode);
+				break;
+			case SCULPT_TOOL_NUDGE:
+				do_nudge_brush(sd, ob, nodes, totnode);
+				break;
+			case SCULPT_TOOL_THUMB:
+				do_thumb_brush(sd, ob, nodes, totnode);
+				break;
+			case SCULPT_TOOL_LAYER:
+				//do_layer_brush(sd, ob, nodes, totnode);
+				do_draw_brush(sd, ob, nodes, totnode);
+				break;
+			case SCULPT_TOOL_FLATTEN:
+				do_flatten_brush(sd, ob, nodes, totnode);
+				break;
+			case SCULPT_TOOL_CLAY:
+				do_clay_brush(sd, ob, nodes, totnode);
+				break;
+			case SCULPT_TOOL_CLAY_STRIPS:
+				do_clay_strips_brush(sd, ob, nodes, totnode);
+				break;
+			case SCULPT_TOOL_FILL:
+				do_fill_brush(sd, ob, nodes, totnode);
+				break;
+			case SCULPT_TOOL_SCRAPE:
+				do_scrape_brush(sd, ob, nodes, totnode);
+				break;
+			}
 		}
 
 		if (brush->sculpt_tool != SCULPT_TOOL_SMOOTH && brush->autosmooth_factor > 0) {
@@ -3279,6 +3280,8 @@
 		return "Fill Brush";
 	case SCULPT_TOOL_SCRAPE:
 		return "Scrape Brush";
+	/*case SCULPT_TOOL_MASK: temporarily removed (maybe)
+		return "Mask Brush"; */
 	default:
 		return "Sculpting";
 	}

Modified: branches/soc-2011-onion/source/blender/makesdna/DNA_brush_types.h
===================================================================
--- branches/soc-2011-onion/source/blender/makesdna/DNA_brush_types.h	2011-06-11 19:10:55 UTC (rev 37416)
+++ branches/soc-2011-onion/source/blender/makesdna/DNA_brush_types.h	2011-06-11 19:36:14 UTC (rev 37417)
@@ -142,6 +142,7 @@
 #define BRUSH_CUSTOM_ICON (1<<28)
 #define BRUSH_SYMMETRY_FEATHER (1<<29)
 #define BRUSH_LAYER (1<<30)
+#define BRUSH_MASK (1<<31) /* last flag! */
 
 /* temporary flag which sets up autmatically for correct
    brush drawing when inverted modal operator is running */
@@ -168,7 +169,7 @@
 	SCULPT_TOOL_BLOB        = 17,
 	SCULPT_TOOL_CLAY_STRIPS = 18,
 	SCULPT_TOOL_GRAVITY     = 19,
-	SCULPT_TOOL_MASK        = 20,
+	/*SCULPT_TOOL_MASK        = 20, temporarily removed (maybe) */
 } SculptTool;
 
 /* Brush.vertexpaint_tool */

Modified: branches/soc-2011-onion/source/blender/makesrna/intern/rna_brush.c
===================================================================
--- branches/soc-2011-onion/source/blender/makesrna/intern/rna_brush.c	2011-06-11 19:10:55 UTC (rev 37416)
+++ branches/soc-2011-onion/source/blender/makesrna/intern/rna_brush.c	2011-06-11 19:36:14 UTC (rev 37417)
@@ -75,7 +75,7 @@
 	{SCULPT_TOOL_SMOOTH, "SMOOTH", ICON_BRUSH_SMOOTH, "Smooth", ""},
 	{SCULPT_TOOL_SNAKE_HOOK, "SNAKE_HOOK", ICON_BRUSH_SNAKE_HOOK, "Snake Hook", ""},
 	{SCULPT_TOOL_THUMB, "THUMB", ICON_BRUSH_THUMB, "Thumb", ""},
-	{SCULPT_TOOL_MASK, "MASK", ICON_BRUSH_SUBTRACT, "Mask", ""},
+	/*{SCULPT_TOOL_MASK, "MASK", ICON_BRUSH_SUBTRACT, "Mask", ""}, temporarily removed */
 	{0, NULL, 0, NULL, NULL}};
 
 EnumPropertyItem brush_vertex_tool_items[] = {
@@ -312,7 +312,7 @@
 		case SCULPT_TOOL_BLOB:
 		case SCULPT_TOOL_LAYER:
 		case SCULPT_TOOL_CLAY:
-		case SCULPT_TOOL_MASK:
+		/*case SCULPT_TOOL_MASK: temporarily removed (maybe) */
 			return prop_direction_items;
 
 		case SCULPT_TOOL_FLATTEN:
@@ -713,6 +713,11 @@
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_ACCUMULATE);
 	RNA_def_property_ui_text(prop, "Accumulate", "Accumulate stroke dabs on top of each other");
 	RNA_def_property_update(prop, 0, "rna_Brush_update");
+
+	prop= RNA_def_property(srna, "mask", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_MASK);
+	RNA_def_property_ui_text(prop, "Mask", "Mark areas as protected from brush editing");
+	RNA_def_property_update(prop, 0, "rna_Brush_update");
 	
 	prop= RNA_def_property(srna, "use_space_atten", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_SPACE_ATTEN);




More information about the Bf-blender-cvs mailing list