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:
authorJeroen Bakker <jeroen@blender.org>2021-01-05 18:16:18 +0300
committerJeroen Bakker <jeroen@blender.org>2021-01-05 18:34:55 +0300
commit9dbea1db66da5e277e8279811d66096751f38d29 (patch)
tree4fe64c2cb671e0c08f91a37d80c180689c9dec1d /source/blender/makesrna/intern/rna_nodetree.c
parent357e519575411cc338acfe899fde6e5ea3476801 (diff)
Compositor: Alpha Mode
{D9211} introduced pre-multiplying the color for the keying node. This pre-multiplication should also be done by other keying nodes and should be the default operation for alpha node. This patch will change the logic of keying nodes (Cryptomatte Node, Channel Matte, Chroma Matte, Color Matte, Difference Matte, Distance Matte, Luminance Matte) and breaks old files. The Set alpha node has a mode parameter. This parameter changes the logic to `Apply Mask` the alpha on the RGBA channels of the input color or only replace the alpha channel (old behavior). The replace mode is automatically set for older files. When adding new files the the multiply mode is set. Reviewed By: Sergey Sharybin Differential Revision: https://developer.blender.org/D9630
Diffstat (limited to 'source/blender/makesrna/intern/rna_nodetree.c')
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 0e9e22532dc..b1ecce23732 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -6035,6 +6035,32 @@ static void def_cmp_vector_blur(StructRNA *srna)
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
}
+static void def_cmp_set_alpha(StructRNA *srna)
+{
+ PropertyRNA *prop;
+
+ static const EnumPropertyItem mode_items[] = {
+ {CMP_NODE_SETALPHA_MODE_APPLY,
+ "APPLY",
+ 0,
+ "Apply Mask",
+ "Multiply the input image's RGBA channels by the alpha input value"},
+ {CMP_NODE_SETALPHA_MODE_REPLACE_ALPHA,
+ "REPLACE_ALPHA",
+ 0,
+ "Replace Alpha",
+ "Replace the input image's alpha channels by the alpha input value"},
+ {0, NULL, 0, NULL, NULL},
+ };
+
+ RNA_def_struct_sdna_from(srna, "NodeSetAlpha", "storage");
+
+ prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, mode_items);
+ RNA_def_property_ui_text(prop, "Mode", "");
+ RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
+}
+
static void def_cmp_levels(StructRNA *srna)
{
PropertyRNA *prop;