Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2020-06-21 16:51:50 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-06-21 16:51:50 +0300
commit3fc5826f7c6c7606a6bc7e01970321c4e5b41751 (patch)
tree5bea184f2d703a1cad5453994eb172e7abf4f8cc /source
parent91117cad0f42914ceb01b07ee5c3948a97c7a059 (diff)
GPencil: Fix unreported missing material onion filter
This feature was removed by error during the refactor done in draw engine. Differential Revision: https://developer.blender.org/D8082
Diffstat (limited to 'source')
-rw-r--r--source/blender/draw/engines/gpencil/gpencil_engine.c4
-rw-r--r--source/blender/editors/gpencil/drawgpencil.c2
-rw-r--r--source/blender/makesdna/DNA_material_types.h2
-rw-r--r--source/blender/makesrna/intern/rna_material.c2
4 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c
index 16416596784..f658356c1b4 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -493,8 +493,10 @@ static void gpencil_stroke_cache_populate(bGPDlayer *gpl,
(!iter->pd->simplify_fill) && ((gps->flag & GP_STROKE_NOFILL) == 0);
bool only_lines = gpl && gpf && gpl->actframe != gpf && iter->pd->use_multiedit_lines_only;
+ bool hide_onion = gpl && gpf && gpf->runtime.onion_id != 0 &&
+ ((gp_style->flag & GP_MATERIAL_HIDE_ONIONSKIN) != 0);
- if (hide_material || (!show_stroke && !show_fill) || only_lines) {
+ if (hide_material || (!show_stroke && !show_fill) || only_lines || hide_onion) {
return;
}
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index 6d41e9bddbe..3aff943a093 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -316,7 +316,7 @@ static void gp_draw_strokes(tGPDdraw *tgpw)
if ((gp_style == NULL) || (gp_style->flag & GP_MATERIAL_HIDE) ||
/* if onion and ghost flag do not draw*/
- (tgpw->onion && (gp_style->flag & GP_MATERIAL_ONIONSKIN))) {
+ (tgpw->onion && (gp_style->flag & GP_MATERIAL_HIDE_ONIONSKIN))) {
continue;
}
diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h
index 357c3260121..6a4ec65318b 100644
--- a/source/blender/makesdna/DNA_material_types.h
+++ b/source/blender/makesdna/DNA_material_types.h
@@ -112,7 +112,7 @@ typedef enum eMaterialGPencilStyle_Flag {
/* protected from further editing */
GP_MATERIAL_LOCKED = (1 << 2),
/* do onion skinning */
- GP_MATERIAL_ONIONSKIN = (1 << 3),
+ GP_MATERIAL_HIDE_ONIONSKIN = (1 << 3),
/* clamp texture */
GP_MATERIAL_TEX_CLAMP = (1 << 4),
/* mix fill texture */
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c
index 5191869be3a..5d57a7b58f6 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -542,7 +542,7 @@ static void rna_def_material_greasepencil(BlenderRNA *brna)
RNA_def_property_update(prop, NC_GPENCIL | ND_SHADING, "rna_MaterialGpencil_update");
prop = RNA_def_property(srna, "ghost", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_MATERIAL_ONIONSKIN);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_MATERIAL_HIDE_ONIONSKIN);
RNA_def_property_ui_icon(prop, ICON_GHOST_ENABLED, 0);
RNA_def_property_ui_text(
prop, "Show in Ghosts", "Display strokes using this color when showing onion skins");