Merging r39717 through r39983 from trunk into soc-2011-tomato
[blender.git] / source / blender / nodes / composite / nodes / node_composite_movieclip.c
  * ***** END GPL LICENSE BLOCK *****
  */
 
-/** \file blender/nodes/intern/CMP_nodes/CMP_movieclip.c
+/** \file blender/nodes/composite/nodes/node_composite_movieclip.c
  *  \ingroup cmpnodes
  */
 
 
-#include "../CMP_util.h"
+#include "node_composite_util.h"
 
-static bNodeSocketType cmp_node_rlayers_out[]= {
-       {       SOCK_RGBA,              0, "Image",                     0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f},
-       {       SOCK_VALUE,             1,      "Offset X",             0.0f, 0.0f, 0.0f, 0.0f, -10000.0f, 10000.0f},
-       {       SOCK_VALUE,             1,      "Offset Y",             0.0f, 0.0f, 0.0f, 0.0f, -10000.0f, 10000.0f},
-       {       SOCK_VALUE,             1,      "Scale",                1.0f, 0.0f, 0.0f, 0.0f, 0.0001f, CMP_SCALE_MAX},
+static bNodeSocketTemplate cmp_node_movieclip_out[]= {
+       {       SOCK_RGBA,              0,      "Image"},
+       {       SOCK_FLOAT,             1,      "Offset X"},
+       {       SOCK_FLOAT,             1,      "Offset Y"},
+       {       SOCK_FLOAT,             1,      "Scale"},
        {       -1, 0, ""       }
 };
 
@@ -153,7 +153,7 @@ static void node_composit_exec_movieclip(void *data, bNode *node, bNodeStack **U
        }
 }
 
-static void node_composit_init_movieclip(bNode* node)
+static void init(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 {
        MovieClipUser *user= MEM_callocN(sizeof(MovieClipUser), "node movie clip user");
        node->storage= user;
@@ -164,10 +164,10 @@ void register_node_type_cmp_movieclip(ListBase *lb)
 {
        static bNodeType ntype;
 
-       node_type_base(&ntype, CMP_NODE_MOVIECLIP, "Movie Clip", NODE_CLASS_INPUT, NODE_PREVIEW|NODE_OPTIONS,
-               NULL, cmp_node_rlayers_out);
+       node_type_base(&ntype, CMP_NODE_MOVIECLIP, "Movie Clip", NODE_CLASS_INPUT, NODE_PREVIEW|NODE_OPTIONS);
+       node_type_socket_templates(&ntype, NULL, cmp_node_movieclip_out);
        node_type_size(&ntype, 120, 80, 300);
-       node_type_init(&ntype, node_composit_init_movieclip);
+       node_type_init(&ntype, init);
        node_type_storage(&ntype, "MovieClipUser", node_free_standard_storage, node_copy_standard_storage);
        node_type_exec(&ntype, node_composit_exec_movieclip);