GP: Add Shift+F to change Drawing Brush strength
authorAntonioya <blendergit@gmail.com>
Tue, 9 Oct 2018 17:07:02 +0000 (19:07 +0200)
committerAntonioya <blendergit@gmail.com>
Tue, 9 Oct 2018 17:07:20 +0000 (19:07 +0200)
source/blender/editors/gpencil/gpencil_ops.c
source/blender/makesrna/intern/rna_brush.c

index eec059a59d1d42214d30a8d03a530412456a4642..ed3eab7b64218564888945ad7e4c7647dec9472b 100644 (file)
@@ -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");
index ef8db267412359f6999d6fe27710d65f3ee772b2..665a694653c20fd967caed1d5d42774501d043e2 100644 (file)
@@ -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);