Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/composite/nodes/node_composite_trackpos.cc
- This file was moved from source/blender/nodes/composite/nodes/node_composite_trackpos.c.
| Show All 15 Lines | |||||
| * The Original Code is Copyright (C) 2011 Blender Foundation. | * The Original Code is Copyright (C) 2011 Blender Foundation. | ||||
| * All rights reserved. | * All rights reserved. | ||||
| */ | */ | ||||
| /** \file | /** \file | ||||
| * \ingroup cmpnodes | * \ingroup cmpnodes | ||||
| */ | */ | ||||
| #include "node_composite_util.h" | #include "node_composite_util.hh" | ||||
| static bNodeSocketTemplate cmp_node_trackpos_out[] = { | namespace blender::nodes { | ||||
| {SOCK_FLOAT, N_("X")}, | |||||
| {SOCK_FLOAT, N_("Y")}, | static void cmp_node_trackpos_declare(NodeDeclarationBuilder &b) | ||||
| {SOCK_VECTOR, N_("Speed"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_VELOCITY}, | { | ||||
| {-1, ""}, | b.add_output<decl::Float>("X"); | ||||
| }; | b.add_output<decl::Float>("Y"); | ||||
| b.add_output<decl::Vector>("Speed").subtype(PROP_VELOCITY); | |||||
| } | |||||
| } // namespace blender::nodes | |||||
| static void init(bNodeTree *UNUSED(ntree), bNode *node) | static void init(bNodeTree *UNUSED(ntree), bNode *node) | ||||
| { | { | ||||
| NodeTrackPosData *data = MEM_callocN(sizeof(NodeTrackPosData), "node track position data"); | NodeTrackPosData *data = (NodeTrackPosData *)MEM_callocN(sizeof(NodeTrackPosData), | ||||
| "node track position data"); | |||||
| node->storage = data; | node->storage = data; | ||||
| } | } | ||||
| void register_node_type_cmp_trackpos(void) | void register_node_type_cmp_trackpos(void) | ||||
| { | { | ||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| cmp_node_type_base(&ntype, CMP_NODE_TRACKPOS, "Track Position", NODE_CLASS_INPUT, 0); | cmp_node_type_base(&ntype, CMP_NODE_TRACKPOS, "Track Position", NODE_CLASS_INPUT, 0); | ||||
| node_type_socket_templates(&ntype, NULL, cmp_node_trackpos_out); | ntype.declare = blender::nodes::cmp_node_trackpos_declare; | ||||
| node_type_init(&ntype, init); | node_type_init(&ntype, init); | ||||
| node_type_storage( | node_type_storage( | ||||
| &ntype, "NodeTrackPosData", node_free_standard_storage, node_copy_standard_storage); | &ntype, "NodeTrackPosData", node_free_standard_storage, node_copy_standard_storage); | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||