Merged the particles-2010 branch with node improvements into trunk.
[blender-staging.git] / source / blender / nodes / composite / nodes / node_composite_translate.c
similarity index 73%
rename from source/blender/nodes/intern/CMP_nodes/CMP_translate.c
rename to source/blender/nodes/composite/nodes/node_composite_translate.c
index eb69523e7a9ae071b190e446a1c5a59f98b84b68..a07dfb936aeab0558bd99b0e202b397fd0b1d241 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id$
+ * $Id: CMP_translate.c 36593 2011-05-10 11:19:26Z lukastoenne $
  *
  * ***** BEGIN GPL LICENSE BLOCK *****
  *
  * ***** END GPL LICENSE BLOCK *****
  */
 
-/** \file blender/nodes/intern/CMP_nodes/CMP_translate.c
+/** \file blender/nodes/composite/nodes/node_composite_translate.c
  *  \ingroup cmpnodes
  */
 
 
-#include "../CMP_util.h"
+#include "node_composite_util.h"
 
 
 /* **************** Translate  ******************** */
 
-static bNodeSocketType cmp_node_translate_in[]= {
-       {       SOCK_RGBA, 1, "Image",                  0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f},
-       {       SOCK_VALUE, 1, "X",     0.0f, 0.0f, 0.0f, 0.0f, -10000.0f, 10000.0f},
-       {       SOCK_VALUE, 1, "Y",     0.0f, 0.0f, 0.0f, 0.0f, -10000.0f, 10000.0f},
+static bNodeSocketTemplate cmp_node_translate_in[]= {
+       {       SOCK_RGBA, 1, "Image",                  0.8f, 0.8f, 0.8f, 1.0f},
+       {       SOCK_FLOAT, 1, "X",     0.0f, 0.0f, 0.0f, 0.0f, -10000.0f, 10000.0f, PROP_NONE},
+       {       SOCK_FLOAT, 1, "Y",     0.0f, 0.0f, 0.0f, 0.0f, -10000.0f, 10000.0f, PROP_NONE},
        {       -1, 0, ""       }
 };
-static bNodeSocketType cmp_node_translate_out[]= {
-       {       SOCK_RGBA, 0, "Image",                  0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f},
+static bNodeSocketTemplate cmp_node_translate_out[]= {
+       {       SOCK_RGBA, 0, "Image"},
        {       -1, 0, ""       }
 };
 
@@ -65,8 +65,8 @@ void register_node_type_cmp_translate(ListBase *lb)
 {
        static bNodeType ntype;
 
-       node_type_base(&ntype, CMP_NODE_TRANSLATE, "Translate", NODE_CLASS_DISTORT, NODE_OPTIONS,
-               cmp_node_translate_in, cmp_node_translate_out);
+       node_type_base(&ntype, CMP_NODE_TRANSLATE, "Translate", NODE_CLASS_DISTORT, NODE_OPTIONS);
+       node_type_socket_templates(&ntype, cmp_node_translate_in, cmp_node_translate_out);
        node_type_size(&ntype, 140, 100, 320);
        node_type_exec(&ntype, node_composit_exec_translate);