Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/composite/nodes/node_composite_normalize.cc
| Show All 18 Lines | |||||
| /** \file | /** \file | ||||
| * \ingroup cmpnodes | * \ingroup cmpnodes | ||||
| */ | */ | ||||
| #include "node_composite_util.hh" | #include "node_composite_util.hh" | ||||
| /* **************** NORMALIZE single channel, useful for Z buffer ******************** */ | /* **************** NORMALIZE single channel, useful for Z buffer ******************** */ | ||||
| static bNodeSocketTemplate cmp_node_normalize_in[] = { | |||||
| {SOCK_FLOAT, N_("Value"), 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, PROP_NONE}, {-1, ""}}; | |||||
| static bNodeSocketTemplate cmp_node_normalize_out[] = {{SOCK_FLOAT, N_("Value")}, {-1, ""}}; | |||||
| void register_node_type_cmp_normalize(void) | namespace blender::nodes { | ||||
| static void cmp_node_normalize_declare(NodeDeclarationBuilder &b) | |||||
| { | |||||
| b.add_input<decl::Float>(N_("Value")).default_value(1.0f).min(0.0f).max(1.0f); | |||||
| b.add_output<decl::Float>(N_("Value")); | |||||
| } | |||||
| } // namespace blender::nodes | |||||
| void register_node_type_cmp_normalize() | |||||
| { | { | ||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| cmp_node_type_base(&ntype, CMP_NODE_NORMALIZE, "Normalize", NODE_CLASS_OP_VECTOR, 0); | cmp_node_type_base(&ntype, CMP_NODE_NORMALIZE, "Normalize", NODE_CLASS_OP_VECTOR, 0); | ||||
| node_type_socket_templates(&ntype, cmp_node_normalize_in, cmp_node_normalize_out); | ntype.declare = blender::nodes::cmp_node_normalize_declare; | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||