GP: New option to disable lasso while drawing

Now it's possible to disable the lasso effect of the fill color while drawing with a fill color.

This sometimes is required to see the lines and it's the first step to implement a new lasso brush.
This commit is contained in:
Antonio Vazquez 2018-09-30 16:21:28 +02:00
parent 60935cb9d8
commit ec06532cef
4 changed files with 15 additions and 3 deletions

View File

@ -341,6 +341,9 @@ class GreasePencilAppearancePanel:
layout.prop(gp_settings, "use_cursor", text="Show Brush")
if gp_settings.gpencil_brush_type == 'DRAW':
layout.prop(gp_settings, "disable_lasso", text="Hide fill color while drawing")
if gp_settings.gpencil_brush_type == 'FILL':
layout.prop(brush, "cursor_color_add", text="Color")

View File

@ -969,8 +969,10 @@ void DRW_gpencil_populate_buffer_strokes(GPENCIL_e_data *e_data, void *vedata, T
e_data->batch_buffer_stroke,
stl->storage->unit_matrix);
if ((gpd->runtime.sbuffer_size >= 3) && (gpd->runtime.sfill[3] > GPENCIL_ALPHA_OPACITY_THRESH) &&
((gpd->runtime.sbuffer_sflag & GP_STROKE_NOFILL) == 0))
if ((gpd->runtime.sbuffer_size >= 3) &&
(gpd->runtime.sfill[3] > GPENCIL_ALPHA_OPACITY_THRESH) &&
((gpd->runtime.sbuffer_sflag & GP_STROKE_NOFILL) == 0) &&
((brush->gpencil_settings->flag & GP_BRUSH_DISSABLE_LASSO) == 0))
{
/* if not solid, fill is simulated with solid color */
if (gpd->runtime.bfill_style > 0) {

View File

@ -121,7 +121,9 @@ typedef enum eGPDbrush_Flag {
/* Random settings group */
GP_BRUSH_GROUP_RANDOM = (1 << 12),
/* Keep material assigned to brush */
GP_BRUSH_MATERIAL_PINNED = (1 << 13)
GP_BRUSH_MATERIAL_PINNED = (1 << 13),
/* Do not show fill color while drawing (no lasso mode) */
GP_BRUSH_DISSABLE_LASSO = (1 << 14),
} eGPDbrush_Flag;
/* BrushGpencilSettings->gp_fill_draw_mode */

View File

@ -1286,6 +1286,11 @@ static void rna_def_gpencil_options(BlenderRNA *brna)
RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1);
RNA_def_property_ui_text(prop, "Pin Material", "Keep material assigned to brush");
RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
prop = RNA_def_property(srna, "disable_lasso", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSH_DISSABLE_LASSO);
RNA_def_property_ui_text(prop, "Disable Lasso", "Do not draw fill color while drawing the stroke");
RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
}
static void rna_def_brush(BlenderRNA *brna)