Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/composite/nodes/node_composite_switch.cc
| Show All 17 Lines | |||||
| */ | */ | ||||
| /** \file | /** \file | ||||
| * \ingroup cmpnodes | * \ingroup cmpnodes | ||||
| */ | */ | ||||
| #include "../node_composite_util.hh" | #include "../node_composite_util.hh" | ||||
| /* **************** MIX RGB ******************** */ | /* **************** Switch ******************** */ | ||||
| static bNodeSocketTemplate cmp_node_switch_in[] = { | |||||
| {SOCK_RGBA, N_("Off"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f}, | namespace blender::nodes { | ||||
| {SOCK_RGBA, N_("On"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f}, | |||||
| {-1, ""}, | static void cmp_node_switch_declare(NodeDeclarationBuilder &b) | ||||
| }; | { | ||||
| b.add_input<decl::Color>(N_("Off")).default_value({0.8f, 0.8f, 0.8f, 1.0f}); | |||||
| static bNodeSocketTemplate cmp_node_switch_out[] = { | b.add_input<decl::Color>(N_("On")).default_value({0.8f, 0.8f, 0.8f, 1.0f}); | ||||
| {SOCK_RGBA, N_("Image"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f}, | b.add_output<decl::Color>(N_("Image")); | ||||
| {-1, ""}, | } | ||||
| }; | |||||
| } // namespace blender::nodes | |||||
| /* custom1 = mix type */ | /* custom1 = mix type */ | ||||
| void register_node_type_cmp_switch(void) | void register_node_type_cmp_switch() | ||||
| { | { | ||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| cmp_node_type_base(&ntype, CMP_NODE_SWITCH, "Switch", NODE_CLASS_LAYOUT, 0); | cmp_node_type_base(&ntype, CMP_NODE_SWITCH, "Switch", NODE_CLASS_LAYOUT, 0); | ||||
| node_type_socket_templates(&ntype, cmp_node_switch_in, cmp_node_switch_out); | ntype.declare = blender::nodes::cmp_node_switch_declare; | ||||
| node_type_size_preset(&ntype, NODE_SIZE_SMALL); | node_type_size_preset(&ntype, NODE_SIZE_SMALL); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||