Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/composite/nodes/node_composite_boxmask.cc
| Show All 19 Lines | |||||
| /** \file | /** \file | ||||
| * \ingroup cmpnodes | * \ingroup cmpnodes | ||||
| */ | */ | ||||
| #include "../node_composite_util.hh" | #include "../node_composite_util.hh" | ||||
| /* **************** SCALAR MATH ******************** */ | /* **************** SCALAR MATH ******************** */ | ||||
| namespace blender::nodes { | namespace blender::nodes::node_composite_boxmask_cc { | ||||
| static void cmp_node_boxmask_declare(NodeDeclarationBuilder &b) | static void cmp_node_boxmask_declare(NodeDeclarationBuilder &b) | ||||
| { | { | ||||
| b.add_input<decl::Float>(N_("Mask")).default_value(0.0f).min(0.0f).max(1.0f); | b.add_input<decl::Float>(N_("Mask")).default_value(0.0f).min(0.0f).max(1.0f); | ||||
| b.add_input<decl::Float>(N_("Value")).default_value(1.0f).min(0.0f).max(1.0f); | b.add_input<decl::Float>(N_("Value")).default_value(1.0f).min(0.0f).max(1.0f); | ||||
| b.add_output<decl::Float>(N_("Mask")); | b.add_output<decl::Float>(N_("Mask")); | ||||
| } | } | ||||
| } // namespace blender::nodes | |||||
| static void node_composit_init_boxmask(bNodeTree *UNUSED(ntree), bNode *node) | static void node_composit_init_boxmask(bNodeTree *UNUSED(ntree), bNode *node) | ||||
| { | { | ||||
| NodeBoxMask *data = (NodeBoxMask *)MEM_callocN(sizeof(NodeBoxMask), "NodeBoxMask"); | NodeBoxMask *data = (NodeBoxMask *)MEM_callocN(sizeof(NodeBoxMask), "NodeBoxMask"); | ||||
| data->x = 0.5; | data->x = 0.5; | ||||
| data->y = 0.5; | data->y = 0.5; | ||||
| data->width = 0.2; | data->width = 0.2; | ||||
| data->height = 0.1; | data->height = 0.1; | ||||
| data->rotation = 0.0; | data->rotation = 0.0; | ||||
| node->storage = data; | node->storage = data; | ||||
| } | } | ||||
| } // namespace blender::nodes::node_composite_boxmask_cc | |||||
| void register_node_type_cmp_boxmask() | void register_node_type_cmp_boxmask() | ||||
| { | { | ||||
| namespace file_ns = blender::nodes::node_composite_boxmask_cc; | |||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| cmp_node_type_base(&ntype, CMP_NODE_MASK_BOX, "Box Mask", NODE_CLASS_MATTE, 0); | cmp_node_type_base(&ntype, CMP_NODE_MASK_BOX, "Box Mask", NODE_CLASS_MATTE, 0); | ||||
| ntype.declare = blender::nodes::cmp_node_boxmask_declare; | ntype.declare = file_ns::cmp_node_boxmask_declare; | ||||
| node_type_init(&ntype, node_composit_init_boxmask); | node_type_init(&ntype, file_ns::node_composit_init_boxmask); | ||||
| node_type_storage(&ntype, "NodeBoxMask", node_free_standard_storage, node_copy_standard_storage); | node_type_storage(&ntype, "NodeBoxMask", node_free_standard_storage, node_copy_standard_storage); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||