Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_switch.cc
| Show All 20 Lines | |||||
| #include "DNA_mesh_types.h" | #include "DNA_mesh_types.h" | ||||
| #include "DNA_meshdata_types.h" | #include "DNA_meshdata_types.h" | ||||
| #include "BKE_material.h" | #include "BKE_material.h" | ||||
| #include "FN_multi_function_signature.hh" | #include "FN_multi_function_signature.hh" | ||||
| namespace blender::nodes { | namespace blender::nodes::node_geo_switch_cc { | ||||
| static void geo_node_switch_declare(NodeDeclarationBuilder &b) | static void geo_node_switch_declare(NodeDeclarationBuilder &b) | ||||
| { | { | ||||
| b.add_input<decl::Bool>(N_("Switch")).default_value(false).supports_field(); | b.add_input<decl::Bool>(N_("Switch")).default_value(false).supports_field(); | ||||
| b.add_input<decl::Bool>(N_("Switch"), "Switch_001").default_value(false); | b.add_input<decl::Bool>(N_("Switch"), "Switch_001").default_value(false); | ||||
| b.add_input<decl::Float>(N_("False")).supports_field(); | b.add_input<decl::Float>(N_("False")).supports_field(); | ||||
| b.add_input<decl::Float>(N_("True")).supports_field(); | b.add_input<decl::Float>(N_("True")).supports_field(); | ||||
| ▲ Show 20 Lines • Show All 250 Lines • ▼ Show 20 Lines | case SOCK_IMAGE: { | ||||
| break; | break; | ||||
| } | } | ||||
| default: | default: | ||||
| BLI_assert_unreachable(); | BLI_assert_unreachable(); | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| } // namespace blender::nodes | } // namespace blender::nodes::node_geo_switch_cc | ||||
| void register_node_type_geo_switch() | void register_node_type_geo_switch() | ||||
| { | { | ||||
| namespace file_ns = blender::nodes::node_geo_switch_cc; | |||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| geo_node_type_base(&ntype, GEO_NODE_SWITCH, "Switch", NODE_CLASS_CONVERTER, 0); | geo_node_type_base(&ntype, GEO_NODE_SWITCH, "Switch", NODE_CLASS_CONVERTER, 0); | ||||
| ntype.declare = blender::nodes::geo_node_switch_declare; | ntype.declare = file_ns::geo_node_switch_declare; | ||||
| node_type_init(&ntype, blender::nodes::geo_node_switch_init); | node_type_init(&ntype, file_ns::geo_node_switch_init); | ||||
| node_type_update(&ntype, blender::nodes::geo_node_switch_update); | node_type_update(&ntype, file_ns::geo_node_switch_update); | ||||
| node_type_storage(&ntype, "NodeSwitch", node_free_standard_storage, node_copy_standard_storage); | node_type_storage(&ntype, "NodeSwitch", node_free_standard_storage, node_copy_standard_storage); | ||||
| ntype.geometry_node_execute = blender::nodes::geo_node_switch_exec; | ntype.geometry_node_execute = file_ns::geo_node_switch_exec; | ||||
| ntype.geometry_node_execute_supports_laziness = true; | ntype.geometry_node_execute_supports_laziness = true; | ||||
| ntype.draw_buttons = blender::nodes::geo_node_switch_layout; | ntype.draw_buttons = file_ns::geo_node_switch_layout; | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||