diff options
author | William Reynish <billrey@me.com> | 2019-12-14 20:48:18 +0300 |
---|---|---|
committer | William Reynish <billrey@me.com> | 2019-12-14 20:48:18 +0300 |
commit | fb74dcc5d69d07f641e318557f679b95e52297a0 (patch) | |
tree | afd4a692f720b85ce0ad010009c8cb4ed8430241 /source | |
parent | 16206b66a2594c286aaf2ce3983f946f1d3d39d3 (diff) |
UI: Brush Settings overhaul
This makes a number of changes to the tool settings brush UI:
- All brush-related controls are now grouped together, so you can see which items are brush settings are which are not. Previously it was all jumbled together.
- The brush picker is in a separate panel, so that you can switch brushes without worrying about the settings, or vice versa.
- Custom Icon settings moved from the Display settings(now known as Cursor) to the Brushes panel.
- UnifiedPaintSettings panels are removed and the contained options are now next to their relevant setting with a globe icon toggle. This is not displayed in the header.
- 2D Falloff and Absolute Jitter toggles were changed into enums, to make it clearer what happens when they are on or off.
- Adjust Strength for Spacing option was in the Options panel in some modes, but in the Stroke panel in others. It is now always under Stroke.
- Display (now Cursor) panel was reorganized, settings renamed.
- 2-option enums are annoying as a drop-down menu, so they are now drawn with expand=True.
- Smooth Stroke and Stabilizer options in grease pencil and other paint modes are now both called "Stabilize Stroke", for consistency and clarity.
- De-duplicated some drawing code between various painting modes' brush options. I tried to keep de-duplication reasonable and easy to follow.
- A few more tweaks - see D5928 for the extensive list.
Most of the patch is written by Demeter Dzadik, with some additions by myself
Differential Revision: https://developer.blender.org/D5928
Reviewers: Pablo Dobarro, Bastien Montagne, Matias Mendiola
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesrna/intern/rna_brush.c | 45 |
1 files changed, 30 insertions, 15 deletions
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index 2d70950ce7b..5b683ffd80e 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -1596,6 +1596,22 @@ static void rna_def_brush(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}, }; + static const EnumPropertyItem brush_jitter_unit_items[] = { + {BRUSH_ABSOLUTE_JITTER, "VIEW", 0, "View", "Jitterring happens in screen space, in pixels"}, + {0, "BRUSH", 0, "Brush", "Jitterring happens relative to the brush size"}, + {0, NULL, 0, NULL, NULL}, + }; + + static const EnumPropertyItem falloff_shape_unit_items[] = { + {0, "SPHERE", 0, "Sphere", "Apply brush influence in a Sphere, outwards from the center"}, + {PAINT_FALLOFF_SHAPE_TUBE, + "PROJECTED", + 0, + "Projected", + "Apply brush influence in a 2D circle, projected from the view"}, + {0, NULL, 0, NULL, NULL}, + }; + static const EnumPropertyItem brush_curve_preset_items[] = { {BRUSH_CURVE_CUSTOM, "CUSTOM", ICON_RNDCURVE, "Custom", ""}, {BRUSH_CURVE_SMOOTH, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", ""}, @@ -1704,6 +1720,19 @@ static void rna_def_brush(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Deformation", "Deformation type that is used in the brush"); RNA_def_property_update(prop, 0, "rna_Brush_update"); + prop = RNA_def_property(srna, "jitter_unit", PROP_ENUM, PROP_NONE); /* as an enum */ + RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); + RNA_def_property_enum_items(prop, brush_jitter_unit_items); + RNA_def_property_ui_text( + prop, "Jitter Unit", "Jitter in screen space or relative to brush size"); + RNA_def_property_update(prop, 0, "rna_Brush_update"); + + prop = RNA_def_property(srna, "falloff_shape", PROP_ENUM, PROP_NONE); /* as an enum */ + RNA_def_property_enum_bitflag_sdna(prop, NULL, "falloff_shape"); + RNA_def_property_enum_items(prop, falloff_shape_unit_items); + RNA_def_property_ui_text(prop, "Falloff Shape", "Use projected or spherical falloff"); + RNA_def_property_update(prop, 0, "rna_Brush_update"); + /* number values */ prop = RNA_def_property(srna, "size", PROP_INT, PROP_PIXEL); RNA_def_property_int_funcs(prop, NULL, "rna_Brush_set_size", NULL); @@ -1993,13 +2022,6 @@ static void rna_def_brush(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_Brush_update"); /* flag */ - /* This is an enum but its unlikely we add other shapes, so expose as a boolean. */ - prop = RNA_def_property(srna, "use_projected", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "falloff_shape", PAINT_FALLOFF_SHAPE_TUBE); - RNA_def_property_ui_text( - prop, "2D Falloff", "Apply brush influence in 2D circle instead of a sphere"); - RNA_def_property_update(prop, 0, "rna_Brush_update"); - prop = RNA_def_property(srna, "use_airbrush", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_AIRBRUSH); RNA_def_property_ui_text( @@ -2045,7 +2067,7 @@ static void rna_def_brush(BlenderRNA *brna) prop = RNA_def_property(srna, "use_paint_antialiasing", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "sampling_flag", BRUSH_PAINT_ANTIALIASING); - RNA_def_property_ui_text(prop, "Antialasing", "Smooths the edges of the strokes"); + RNA_def_property_ui_text(prop, "Anti-Aliasing", "Smooths the edges of the strokes"); prop = RNA_def_property(srna, "use_multiplane_scrape_dynamic", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag2", BRUSH_MULTIPLANE_SCRAPE_DYNAMIC); @@ -2117,13 +2139,6 @@ static void rna_def_brush(BlenderRNA *brna) prop, "Inverse Smooth Pressure", "Lighter pressure causes more smoothing to be applied"); RNA_def_property_update(prop, 0, "rna_Brush_update"); - prop = RNA_def_property(srna, "use_relative_jitter", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BRUSH_ABSOLUTE_JITTER); - RNA_def_property_ui_icon(prop, ICON_UNLOCKED, true); - RNA_def_property_ui_text( - prop, "Absolute Jitter", "Jittering happens in screen space, not relative to brush size"); - RNA_def_property_update(prop, 0, "rna_Brush_update"); - prop = RNA_def_property(srna, "use_plane_trim", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_PLANE_TRIM); RNA_def_property_ui_text(prop, "Use Plane Trim", "Enable Plane Trim"); |