Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/composite/nodes/node_composite_mapValue.cc
| Show All 18 Lines | |||||
| /** \file | /** \file | ||||
| * \ingroup cmpnodes | * \ingroup cmpnodes | ||||
| */ | */ | ||||
| #include "node_composite_util.hh" | #include "node_composite_util.hh" | ||||
| /* **************** MAP VALUE ******************** */ | /* **************** MAP VALUE ******************** */ | ||||
| static bNodeSocketTemplate cmp_node_map_value_in[] = { | |||||
| {SOCK_FLOAT, N_("Value"), 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, PROP_NONE}, | namespace blender::nodes { | ||||
| {-1, ""}, | |||||
| }; | static void cmp_node_map_value_declare(NodeDeclarationBuilder &b) | ||||
| static bNodeSocketTemplate cmp_node_map_value_out[] = { | { | ||||
| {SOCK_FLOAT, N_("Value")}, | b.add_input<decl::Float>(N_("Value")).default_value(1.0f).min(0.0f).max(1.0f); | ||||
| {-1, ""}, | b.add_output<decl::Float>(N_("Value")); | ||||
| }; | } | ||||
| } // namespace blender::nodes | |||||
| static void node_composit_init_map_value(bNodeTree *UNUSED(ntree), bNode *node) | static void node_composit_init_map_value(bNodeTree *UNUSED(ntree), bNode *node) | ||||
| { | { | ||||
| node->storage = BKE_texture_mapping_add(TEXMAP_TYPE_POINT); | node->storage = BKE_texture_mapping_add(TEXMAP_TYPE_POINT); | ||||
| } | } | ||||
| void register_node_type_cmp_map_value(void) | void register_node_type_cmp_map_value() | ||||
| { | { | ||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| cmp_node_type_base(&ntype, CMP_NODE_MAP_VALUE, "Map Value", NODE_CLASS_OP_VECTOR, 0); | cmp_node_type_base(&ntype, CMP_NODE_MAP_VALUE, "Map Value", NODE_CLASS_OP_VECTOR, 0); | ||||
| node_type_socket_templates(&ntype, cmp_node_map_value_in, cmp_node_map_value_out); | ntype.declare = blender::nodes::cmp_node_map_value_declare; | ||||
| node_type_init(&ntype, node_composit_init_map_value); | node_type_init(&ntype, node_composit_init_map_value); | ||||
| node_type_storage(&ntype, "TexMapping", node_free_standard_storage, node_copy_standard_storage); | node_type_storage(&ntype, "TexMapping", node_free_standard_storage, node_copy_standard_storage); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||