diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-06-19 21:29:58 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-06-19 21:29:58 +0400 |
commit | 72e170d67a1d6f3484d3a62a51bdb65719bbb2a6 (patch) | |
tree | 1e5155377f77599322f814b09be54373836ed8a9 /source/blender/nodes | |
parent | a3680a35a6f57e54c0cfb9392e16bb62d052b7c3 (diff) |
Implementation of node for track position input
Diffstat (limited to 'source/blender/nodes')
-rw-r--r-- | source/blender/nodes/CMakeLists.txt | 1 | ||||
-rw-r--r-- | source/blender/nodes/NOD_composite.h | 2 | ||||
-rw-r--r-- | source/blender/nodes/composite/nodes/node_composite_trackpos.c | 65 |
3 files changed, 68 insertions, 0 deletions
diff --git a/source/blender/nodes/CMakeLists.txt b/source/blender/nodes/CMakeLists.txt index 2415c7842a7..146f59c83f6 100644 --- a/source/blender/nodes/CMakeLists.txt +++ b/source/blender/nodes/CMakeLists.txt @@ -104,6 +104,7 @@ set(SRC composite/nodes/node_composite_stabilize2d.c composite/nodes/node_composite_texture.c composite/nodes/node_composite_tonemap.c + composite/nodes/node_composite_trackpos.c composite/nodes/node_composite_transform.c composite/nodes/node_composite_translate.c composite/nodes/node_composite_valToRgb.c diff --git a/source/blender/nodes/NOD_composite.h b/source/blender/nodes/NOD_composite.h index 33d6327ece1..3b4fa49ea05 100644 --- a/source/blender/nodes/NOD_composite.h +++ b/source/blender/nodes/NOD_composite.h @@ -132,4 +132,6 @@ void register_node_type_cmp_bokehimage(struct bNodeTreeType *ttype); void register_node_type_cmp_bokehblur(struct bNodeTreeType *ttype); void register_node_type_cmp_switch(struct bNodeTreeType *ttype); +void register_node_type_cmp_trackpos(struct bNodeTreeType *ttype); + #endif diff --git a/source/blender/nodes/composite/nodes/node_composite_trackpos.c b/source/blender/nodes/composite/nodes/node_composite_trackpos.c new file mode 100644 index 00000000000..09eb42b4d93 --- /dev/null +++ b/source/blender/nodes/composite/nodes/node_composite_trackpos.c @@ -0,0 +1,65 @@ +/* + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * The Original Code is Copyright (C) 2011 Blender Foundation. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): Blender Foundation, + * Sergey Sharybin + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/** \file blender/nodes/composite/nodes/node_composite_movieclip.c + * \ingroup cmpnodes + */ + + +#include "node_composite_util.h" + +static bNodeSocketTemplate cmp_node_trackpos_out[] = { + { SOCK_FLOAT, 1, N_("X")}, + { SOCK_FLOAT, 1, N_("Y")}, + { -1, 0, "" } +}; + +static void node_composit_exec_trackpos(void *UNUSED(data), bNode *UNUSED(node), bNodeStack **UNUSED(in), bNodeStack **UNUSED(out)) +{ +} + +static void init(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp)) +{ + NodeTrackPosData *data = MEM_callocN(sizeof(NodeTrackPosData), "node track position data"); + + node->storage = data; +} + +void register_node_type_cmp_trackpos(bNodeTreeType *ttype) +{ + static bNodeType ntype; + + node_type_base(ttype, &ntype, CMP_NODE_TRACKPOS, "Track Position", NODE_CLASS_INPUT, NODE_OPTIONS); + node_type_socket_templates(&ntype, NULL, cmp_node_trackpos_out); + node_type_size(&ntype, 120, 80, 300); + node_type_init(&ntype, init); + node_type_storage(&ntype, "NodeTrackPosData", node_free_standard_storage, node_copy_standard_storage); + node_type_exec(&ntype, node_composit_exec_trackpos); + + nodeRegisterType(ttype, &ntype); +} |