Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/composite/nodes/node_composite_switch.cc
| Show All 18 Lines | |||||
| /** \file | /** \file | ||||
| * \ingroup cmpnodes | * \ingroup cmpnodes | ||||
| */ | */ | ||||
| #include "UI_interface.h" | #include "UI_interface.h" | ||||
| #include "UI_resources.h" | #include "UI_resources.h" | ||||
| #include "../node_composite_util.hh" | #include "node_composite_util.hh" | ||||
| /* **************** Switch ******************** */ | /* **************** Switch ******************** */ | ||||
| namespace blender::nodes { | namespace blender::nodes::node_composite_switch_cc { | ||||
| static void cmp_node_switch_declare(NodeDeclarationBuilder &b) | 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}); | b.add_input<decl::Color>(N_("Off")).default_value({0.8f, 0.8f, 0.8f, 1.0f}); | ||||
| b.add_input<decl::Color>(N_("On")).default_value({0.8f, 0.8f, 0.8f, 1.0f}); | b.add_input<decl::Color>(N_("On")).default_value({0.8f, 0.8f, 0.8f, 1.0f}); | ||||
| b.add_output<decl::Color>(N_("Image")); | b.add_output<decl::Color>(N_("Image")); | ||||
| } | } | ||||
| } // namespace blender::nodes | |||||
| static void node_composit_buts_switch(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) | static void node_composit_buts_switch(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) | ||||
| { | { | ||||
| uiItemR(layout, ptr, "check", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE); | uiItemR(layout, ptr, "check", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE); | ||||
| } | } | ||||
| /* custom1 = mix type */ | } // namespace blender::nodes::node_composite_switch_cc | ||||
| void register_node_type_cmp_switch() | void register_node_type_cmp_switch() | ||||
| { | { | ||||
| namespace file_ns = blender::nodes::node_composite_switch_cc; | |||||
| 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); | ||||
| ntype.declare = blender::nodes::cmp_node_switch_declare; | ntype.declare = file_ns::cmp_node_switch_declare; | ||||
| ntype.draw_buttons = node_composit_buts_switch; | ntype.draw_buttons = file_ns::node_composit_buts_switch; | ||||
| node_type_size_preset(&ntype, NODE_SIZE_SMALL); | node_type_size_preset(&ntype, NODE_SIZE_SMALL); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||