[Bf-blender-cvs] [2c0f02dd0a8] blender2.8: GP: Add Shift+F to change Drawing Brush strength
Antonioya
noreply at git.blender.org
Tue Oct 9 19:07:25 CEST 2018
Commit: 2c0f02dd0a886ee0e6869a35ab901c0fa8d822eb
Author: Antonioya
Date: Tue Oct 9 19:07:02 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB2c0f02dd0a886ee0e6869a35ab901c0fa8d822eb
GP: Add Shift+F to change Drawing Brush strength
===================================================================
M source/blender/editors/gpencil/gpencil_ops.c
M source/blender/makesrna/intern/rna_brush.c
===================================================================
diff --git a/source/blender/editors/gpencil/gpencil_ops.c b/source/blender/editors/gpencil/gpencil_ops.c
index eec059a59d1..ed3eab7b642 100644
--- a/source/blender/editors/gpencil/gpencil_ops.c
+++ b/source/blender/editors/gpencil/gpencil_ops.c
@@ -590,6 +590,10 @@ static void ed_keymap_gpencil_painting(wmKeyConfig *keyconf)
/* set poll callback - so that this keymap only gets enabled when stroke paintmode is enabled */
keymap->poll = gp_stroke_paintmode_poll;
+ /* Shift-FKEY = Brush Strength */
+ kmi = WM_keymap_add_item(keymap, "WM_OT_radial_control", FKEY, KM_PRESS, KM_SHIFT, 0);
+ RNA_string_set(kmi->ptr, "data_path_primary", "tool_settings.gpencil_paint.brush.gpencil_settings.pen_strength");
+
/* FKEY = Brush Size */
kmi = WM_keymap_add_item(keymap, "WM_OT_radial_control", FKEY, KM_PRESS, 0, 0);
RNA_string_set(kmi->ptr, "data_path_primary", "tool_settings.gpencil_paint.brush.size");
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index ef8db267412..665a694653c 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -994,9 +994,10 @@ static void rna_def_gpencil_options(BlenderRNA *brna)
RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
/* Strength factor for new strokes */
- prop = RNA_def_property(srna, "pen_strength", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "pen_strength", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "draw_strength");
RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.001, 3);
RNA_def_property_ui_text(prop, "Strength", "Color strength for new strokes (affect alpha factor of color)");
RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL);
More information about the Bf-blender-cvs
mailing list