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:
authorJacques Lucke <jacques@blender.org>2020-12-11 14:00:48 +0300
committerJacques Lucke <jacques@blender.org>2020-12-11 14:00:48 +0300
commitd72ec16e70721408c875040325c984941687b4a2 (patch)
tree9227d298f9ac7b2eb96d1e0b5fed8ba30cb50cf0 /source/blender/editors/space_node
parent150a1d158a79582802bb17dacdd790f0f88aeedb (diff)
Geometry Nodes: add Attribute Mix node
This node can be used to mix two attributes in various ways. The blend modes are the same as in the MixRGB shader node. Differential Revision: https://developer.blender.org/D9737 Ref T82374.
Diffstat (limited to 'source/blender/editors/space_node')
-rw-r--r--source/blender/editors/space_node/drawnode.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index 2ff32a4a82e..0d371915316 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -3190,6 +3190,17 @@ static void node_geometry_buts_attribute_fill(uiLayout *layout,
// uiItemR(layout, ptr, "domain", DEFAULT_FLAGS, "", ICON_NONE);
}
+static void node_geometry_buts_attribute_mix(uiLayout *layout,
+ bContext *UNUSED(C),
+ PointerRNA *ptr)
+{
+ uiItemR(layout, ptr, "blend_type", DEFAULT_FLAGS, "", ICON_NONE);
+ uiLayout *col = uiLayoutColumn(layout, false);
+ uiItemR(col, ptr, "input_type_factor", DEFAULT_FLAGS, IFACE_("Factor"), ICON_NONE);
+ uiItemR(col, ptr, "input_type_a", DEFAULT_FLAGS, IFACE_("A"), ICON_NONE);
+ uiItemR(col, ptr, "input_type_b", DEFAULT_FLAGS, IFACE_("B"), ICON_NONE);
+}
+
static void node_geometry_set_butfunc(bNodeType *ntype)
{
switch (ntype->type) {
@@ -3211,6 +3222,9 @@ static void node_geometry_set_butfunc(bNodeType *ntype)
case GEO_NODE_ATTRIBUTE_FILL:
ntype->draw_buttons = node_geometry_buts_attribute_fill;
break;
+ case GEO_NODE_ATTRIBUTE_MIX:
+ ntype->draw_buttons = node_geometry_buts_attribute_mix;
+ break;
}
}