[Bf-blender-cvs] [fae7a8b] GPencil_Editing_Stage3: GPencil Sculpt: Expose setting for toggling whether to invert the way the brush works

Joshua Leung noreply at git.blender.org
Fri Dec 11 07:34:06 CET 2015


Commit: fae7a8b97a34421dfd97ebedaa8cdb531b75b710
Author: Joshua Leung
Date:   Fri Dec 11 19:25:50 2015 +1300
Branches: GPencil_Editing_Stage3
https://developer.blender.org/rBfae7a8b97a34421dfd97ebedaa8cdb531b75b710

GPencil Sculpt: Expose setting for toggling whether to invert the way the brush works

As in mesh sculptmode, there is now an Add/Subtract toggle to control whether the
brush applies the named effect or not  (e.g. Thickness = Thicker/Thinner, or
Pinch = Pinch/Inflate)

===================================================================

M	release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M	source/blender/makesrna/intern/rna_sculpt_paint.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
index f7d80ea..1f67507 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -205,12 +205,18 @@ class GreasePencilStrokeSculptPanel:
         row.prop(brush, "strength", slider=True)
         row.prop(brush, "use_pressure_strength", text="")
         col.prop(brush, "use_falloff")
-		
-        if settings.tool == 'SMOOTH':
-            col.prop(brush, "affect_pressure")
 
+        layout.separator()
+
+        if settings.tool in {'THICKNESS', 'PINCH', 'TWIST'}:
+            layout.row().prop(brush, "direction", expand=True)
+
+        layout.separator()
         layout.prop(settings, "use_select_mask")
 
+        if settings.tool == 'SMOOTH':
+            layout.prop(brush, "affect_pressure")
+
 
 ###############################
 
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c
index 24b96bc..c997d417 100644
--- a/source/blender/makesrna/intern/rna_sculpt_paint.c
+++ b/source/blender/makesrna/intern/rna_sculpt_paint.c
@@ -985,6 +985,11 @@ static void rna_def_particle_edit(BlenderRNA *brna)
 
 static void rna_def_gpencil_sculpt(BlenderRNA *brna)
 {
+	static EnumPropertyItem prop_direction_items[]= {
+		{0, "ADD", 0, "Add", "Add effect of brush"},
+		{GP_EDITBRUSH_FLAG_INVERT, "SUBTRACT", 0, "Subtract", "Subtract effect of brush"},
+		{0, NULL, 0, NULL, NULL}};
+	
 	StructRNA *srna;
 	PropertyRNA *prop;
 	
@@ -1038,6 +1043,11 @@ static void rna_def_gpencil_sculpt(BlenderRNA *brna)
 	prop = RNA_def_property(srna, "affect_pressure", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_EDITBRUSH_FLAG_SMOOTH_PRESSURE);
 	RNA_def_property_ui_text(prop, "Affect Pressure", "Affect pressure values as well when smoothing strokes");
+	
+	prop = RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE);
+	RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag");
+	RNA_def_property_enum_items(prop, prop_direction_items);
+	RNA_def_property_ui_text(prop, "Direction", "");
 }
 
 void RNA_def_sculpt_paint(BlenderRNA *brna)




More information about the Bf-blender-cvs mailing list