diff options
author | Antonioya <blendergit@gmail.com> | 2019-08-09 12:04:14 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2019-08-09 12:37:02 +0300 |
commit | 8aa2f3b6ce89065151e37a9922296582c8ea7c8e (patch) | |
tree | 605848dba36e6d2da32002fd1883bfa2c1feb3e4 | |
parent | 533e48520e8639854df91593cc1be435c53f5357 (diff) |
GPencil: Add "Self Overlap" parameter to materials to disable Stencil
This parameter was removed in 2.80 and we decided to back again, but now is inverted.
4 files changed, 12 insertions, 1 deletions
diff --git a/release/scripts/startup/bl_ui/properties_material_gpencil.py b/release/scripts/startup/bl_ui/properties_material_gpencil.py index 8db0f8182ab..a9e68ecc502 100644 --- a/release/scripts/startup/bl_ui/properties_material_gpencil.py +++ b/release/scripts/startup/bl_ui/properties_material_gpencil.py @@ -162,6 +162,8 @@ class MATERIAL_PT_gpencil_strokecolor(GPMaterialButtonsPanel, Panel): if gpcolor.mode in {'DOTS', 'BOX'}: col.prop(gpcolor, "alignment_mode") + if gpcolor.mode == 'LINE': + col.prop(gpcolor, "use_overlap_strokes") class MATERIAL_PT_gpencil_fillcolor(GPMaterialButtonsPanel, Panel): bl_label = "Fill" diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c index 9b755217946..2892d0dbbaa 100644 --- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c +++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c @@ -1456,7 +1456,8 @@ void gpencil_triangulate_stroke_fill(Object *ob, bGPDstroke *gps) /* Check if stencil is required */ static bool gpencil_is_stencil_required(MaterialGPencilStyle *gp_style) { - return (bool)(gp_style->stroke_style == GP_STYLE_STROKE_STYLE_SOLID); + return (bool)((gp_style->stroke_style == GP_STYLE_STROKE_STYLE_SOLID) && + ((gp_style->flag & GP_STYLE_DISABLE_STENCIL) == 0)); } /* draw stroke in drawing buffer */ diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h index 42308f54d7a..152ecb85991 100644 --- a/source/blender/makesdna/DNA_material_types.h +++ b/source/blender/makesdna/DNA_material_types.h @@ -128,6 +128,8 @@ typedef enum eMaterialGPencilStyle_Flag { GP_STYLE_FILL_SHOW = (1 << 9), /* mix stroke texture */ GP_STYLE_STROKE_TEX_MIX = (1 << 11), + /* disable stencil clipping (overlap) */ + GP_STYLE_DISABLE_STENCIL = (1 << 12), } eMaterialGPencilStyle_Flag; typedef enum eMaterialGPencilStyle_Mode { diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index 162ba6be834..04fe53821e4 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -610,8 +610,14 @@ static void rna_def_material_greasepencil(BlenderRNA *brna) prop = RNA_def_property(srna, "use_fill_pattern", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_STYLE_FILL_PATTERN); RNA_def_property_ui_text(prop, "Pattern", "Use Fill Texture as a pattern to apply color"); + RNA_def_property_update(prop, NC_GPENCIL | ND_SHADING, "rna_MaterialGpencil_update"); + prop = RNA_def_property(srna, "use_overlap_strokes", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_STYLE_DISABLE_STENCIL); + RNA_def_property_ui_text( + prop, "Self Overlap", "Disable stencil and overlap self intersections with alpha materials"); + RNA_def_property_update(prop, NC_GPENCIL | ND_SHADING, "rna_MaterialGpencil_update"); prop = RNA_def_property(srna, "show_stroke", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_STYLE_STROKE_SHOW); RNA_def_property_ui_text(prop, "Show Stroke", "Show stroke lines of this material"); |