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
This commit is contained in:
parent
974002743e
commit
dc37990e24
|
@ -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),
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue