From 99f7934e19ddf6796e866d2ddc0c3882ed8fcc2b Mon Sep 17 00:00:00 2001 From: Antonioya Date: Mon, 26 Nov 2018 18:12:39 +0100 Subject: GP: New Blend Layers functionality Now it's possible define the blend mode between layers including the option to clamp the layer using underlying layers. Also a new Simplify option has been added to disable blend layers. --- source/blender/makesrna/intern/rna_gpencil.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'source/blender/makesrna/intern/rna_gpencil.c') diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c index 8c11909d022..d6257aa0c1b 100644 --- a/source/blender/makesrna/intern/rna_gpencil.c +++ b/source/blender/makesrna/intern/rna_gpencil.c @@ -78,6 +78,15 @@ const EnumPropertyItem rna_enum_gplayer_move_type_items[] = { {0, NULL, 0, NULL, NULL} }; +static const EnumPropertyItem rna_enum_layer_blend_modes_items[] = { + {eGplBlendMode_Normal, "NORMAL", 0, "Normal", "" }, + {eGplBlendMode_Overlay, "OVERLAY", 0, "Overlay", "" }, + {eGplBlendMode_Add, "ADD", 0, "Add", "" }, + {eGplBlendMode_Subtract, "SUBTRACT", 0, "Subtract", "" }, + {eGplBlendMode_Multiply, "MULTIPLY", 0, "Multiply", "" }, + {eGplBlendMode_Divide, "DIVIDE", 0, "Divide", "" }, + {0, NULL, 0, NULL, NULL } +}; #endif #ifdef RNA_RUNTIME @@ -1159,6 +1168,13 @@ static void rna_def_gpencil_layer(BlenderRNA *brna) RNA_def_property_ui_text(prop, "ViewLayer", "Only include Layer in this View Layer render output (leave blank to include always)"); + /* blend mode */ + prop = RNA_def_property(srna, "blend_mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "blend_mode"); + RNA_def_property_enum_items(prop, rna_enum_layer_blend_modes_items); + RNA_def_property_ui_text(prop, "Blend Mode", "Blend mode"); + RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update"); + /* Flags */ prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_HIDE); @@ -1184,6 +1200,12 @@ static void rna_def_gpencil_layer(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Lock Material", "Disable Material editing"); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); + prop = RNA_def_property(srna, "clamp_layer", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_USE_MASK); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_ui_text(prop, "Clamp Layer", + "Clamp any pixel outside underlying layers drawing"); + RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); /* exposed as layers.active */ #if 0 -- cgit v1.2.3