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
diff options
context:
space:
mode:
authorAntonioya <blendergit@gmail.com>2018-11-26 20:12:39 +0300
committerAntonioya <blendergit@gmail.com>2018-11-26 20:12:39 +0300
commit99f7934e19ddf6796e866d2ddc0c3882ed8fcc2b (patch)
tree45e39dc690fd17f989bceac35e8ecf794417af34 /source/blender/makesrna/intern/rna_gpencil.c
parentc0816cd03b42399e75a285d5e5dd1319e5054f17 (diff)
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.
Diffstat (limited to 'source/blender/makesrna/intern/rna_gpencil.c')
-rw-r--r--source/blender/makesrna/intern/rna_gpencil.c22
1 files changed, 22 insertions, 0 deletions
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