diff options
author | Johnny Matthews <johnny.matthews@gmail.com> | 2021-10-27 17:03:29 +0300 |
---|---|---|
committer | Johnny Matthews <johnny.matthews@gmail.com> | 2021-10-27 17:03:29 +0300 |
commit | dc37990e24eb801e3ff9f9f0f42d364a0af0389e (patch) | |
tree | 40ba431883e450832230beb754f9bbcde5dc871f /source | |
parent | 974002743e1fda0823a8101f92e8155a9baf1f21 (diff) |
Geometry Nodes: Add Image Socket to Switch Node
Add the image type to the switch node without field support.
Differential Revision: https://developer.blender.org/D13012
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 3 | ||||
-rw-r--r-- | source/blender/nodes/geometry/nodes/node_geo_switch.cc | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 8535d334f39..6a36ef07dee 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -2056,7 +2056,8 @@ static bool switch_type_supported(const EnumPropertyItem *item) SOCK_OBJECT, SOCK_COLLECTION, SOCK_TEXTURE, - SOCK_MATERIAL); + SOCK_MATERIAL, + SOCK_IMAGE); } static const EnumPropertyItem *rna_GeometryNodeSwitch_type_itemf(bContext *UNUSED(C), diff --git a/source/blender/nodes/geometry/nodes/node_geo_switch.cc b/source/blender/nodes/geometry/nodes/node_geo_switch.cc index c01fcf5bb5f..28faf217f64 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_switch.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_switch.cc @@ -60,6 +60,8 @@ static void geo_node_switch_declare(NodeDeclarationBuilder &b) b.add_input<decl::Texture>("True", "True_009"); b.add_input<decl::Material>("False", "False_010"); b.add_input<decl::Material>("True", "True_010"); + b.add_input<decl::Image>("False", "False_011"); + b.add_input<decl::Image>("True", "True_011"); b.add_output<decl::Float>("Output").dependent_field(); b.add_output<decl::Int>("Output", "Output_001").dependent_field(); @@ -72,6 +74,7 @@ static void geo_node_switch_declare(NodeDeclarationBuilder &b) b.add_output<decl::Collection>("Output", "Output_008"); b.add_output<decl::Texture>("Output", "Output_009"); b.add_output<decl::Material>("Output", "Output_010"); + b.add_output<decl::Image>("Output", "Output_011"); } static void geo_node_switch_layout(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) @@ -274,6 +277,10 @@ static void geo_node_switch_exec(GeoNodeExecParams params) switch_no_fields<Material *>(params, "_010"); break; } + case SOCK_IMAGE: { + switch_no_fields<Image *>(params, "_011"); + break; + } default: BLI_assert_unreachable(); break; |