diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2021-02-08 18:28:42 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2021-02-09 18:00:36 +0300 |
commit | 1352d81b174726639bbfb6f7aa32dbadf188a8dd (patch) | |
tree | b7bc33114a93c86313b774d8fa05e1214c6844c3 /source/blender/makesrna | |
parent | 5213b18eb2d57153e0e394190af1624401fed74b (diff) |
GPencil: Fill tool refactor and Multiframe in Draw mode
This commit is a refactor of the fill tool to solve several problems we had since the first version of the tool.
Changes:
* The filling speed has been improved for each step of the process with the optimization of each algorithm/function.
* New `AutoFit` option to fill areas outside of the viewport. When enable, the total size of the frame is calculated to fit the filling area.
* New support multiframe filling. Now it is possible to fill multiple similar frames in one go.
* New `Stroke Extension` option to create temporary closing strokes. These strokes can be displayed and adjusted dynamically using wheel mouse or PageUp/Down keys.
* Parameter `Resolution` now is named `Precision` and has been moved to topbar.
* `Resolution` now has decimals and can be lower than 1 to allow quick filling in storyboarding workflows. Maximum value has been set as 5.
* Parameter `Simplify` has been moved to Advanced panel.
* Improved fill outline detection. In some cases, the outline penetrated the area to be filled with unexpected results.
* Fixes some corner case bugs with infinite loops.
As a result of this refactor, also these new functionalities has been added.
* New support for multiframe in `Draw` mode. Any drawing in active frame is duplicated to all selected frame.
* New multiframe display mode. Keyframes before or after of the active frame are displayed using onion colors. This can be disable using Onion overlay options.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_brush.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index 756841dd283..6e2e986ebf8 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -1466,7 +1466,7 @@ static void rna_def_gpencil_options(BlenderRNA *brna) /* fill factor size */ prop = RNA_def_property(srna, "fill_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "fill_factor"); - RNA_def_property_range(prop, GPENCIL_MIN_FILL_FAC, 8.0f); + RNA_def_property_range(prop, GPENCIL_MIN_FILL_FAC, GPENCIL_MAX_FILL_FAC); RNA_def_property_ui_text( prop, "Precision", @@ -1608,6 +1608,15 @@ static void rna_def_gpencil_options(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Value", "Random factor to modify original value"); RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); + /* Factor to extend stroke extremes in Fill tool. */ + prop = RNA_def_property(srna, "extend_stroke_factor", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "fill_extend_fac"); + RNA_def_property_range(prop, 0.0f, 10.0f); + RNA_def_property_float_default(prop, 0.0f); + RNA_def_property_ui_text( + prop, "Stroke Extension", "Strokes end extension for closing gaps, use zero to disable"); + RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0); + /* Flags */ prop = RNA_def_property(srna, "use_pressure", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSH_USE_PRESSURE); @@ -1827,6 +1836,12 @@ static void rna_def_gpencil_options(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Show Lines", "Show help lines for filling to see boundaries"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + prop = RNA_def_property(srna, "show_fill_extend", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSH_FILL_SHOW_EXTENDLINES); + RNA_def_property_boolean_default(prop, true); + RNA_def_property_ui_text(prop, "Show Extend Lines", "Show help lines for stroke extension"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + prop = RNA_def_property(srna, "show_fill", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GP_BRUSH_FILL_HIDE); RNA_def_property_boolean_default(prop, true); @@ -1834,6 +1849,15 @@ static void rna_def_gpencil_options(BlenderRNA *brna) prop, "Show Fill", "Show transparent lines to use as boundary for filling"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + prop = RNA_def_property(srna, "use_fill_autofit", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GP_BRUSH_FILL_FIT_DISABLE); + RNA_def_property_boolean_default(prop, true); + RNA_def_property_ui_text( + prop, + "Automatic Fit", + "Fit the shape of the stroke to try to fill areas outside visible viewport"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + prop = RNA_def_property(srna, "use_default_eraser", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSH_DEFAULT_ERASER); RNA_def_property_boolean_default(prop, true); |