Merged changes in the trunk up to revision 42116.
[blender.git] / source / blender / nodes / composite / nodes / node_composite_mixrgb.c
index eaab24d628a770a759d09b1c8c8d840725da664d..0296fa417d6dd1f6353b00b8e8ab62228bb02e99 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * $Id$
- *
  * ***** BEGIN GPL LICENSE BLOCK *****
  *
  * This program is free software; you can redistribute it and/or
@@ -35,9 +33,9 @@
 
 /* **************** MIX RGB ******************** */
 static bNodeSocketTemplate cmp_node_mix_rgb_in[]= {
-       {       SOCK_FLOAT, 1, "Fac",                   0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 5.0f, PROP_FACTOR},
-       {       SOCK_RGBA, 1, "Image",                  0.8f, 0.8f, 0.8f, 1.0f},
-       {       SOCK_RGBA, 1, "Image",                  0.8f, 0.8f, 0.8f, 1.0f},
+       {       SOCK_FLOAT, 1, "Fac",                   1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 5.0f, PROP_FACTOR},
+       {       SOCK_RGBA, 1, "Image",                  1.0f, 1.0f, 1.0f, 1.0f},
+       {       SOCK_RGBA, 1, "Image",                  1.0f, 1.0f, 1.0f, 1.0f},
        {       -1, 0, ""       }
 };
 static bNodeSocketTemplate cmp_node_mix_rgb_out[]= {
@@ -49,12 +47,12 @@ static void do_mix_rgb(bNode *node, float *out, float *in1, float *in2, float *f
 {
        float col[3];
        
-       VECCOPY(col, in1);
+       copy_v3_v3(col, in1);
        if(node->custom2)
-               ramp_blend(node->custom1, col, col+1, col+2, in2[3]*fac[0], in2);
+               ramp_blend(node->custom1, col, in2[3]*fac[0], in2);
        else
-               ramp_blend(node->custom1, col, col+1, col+2, fac[0], in2);
-       VECCOPY(out, col);
+               ramp_blend(node->custom1, col, fac[0], in2);
+       copy_v3_v3(out, col);
        out[3]= in1[3];
 }
 
@@ -84,16 +82,15 @@ static void node_composit_exec_mix_rgb(void *data, bNode *node, bNodeStack **in,
 }
 
 /* custom1 = mix type */
-void register_node_type_cmp_mix_rgb(ListBase *lb)
+void register_node_type_cmp_mix_rgb(bNodeTreeType *ttype)
 {
        static bNodeType ntype;
 
-       node_type_base(&ntype, CMP_NODE_MIX_RGB, "Mix", NODE_CLASS_OP_COLOR, NODE_PREVIEW|NODE_OPTIONS);
+       node_type_base(ttype, &ntype, CMP_NODE_MIX_RGB, "Mix", NODE_CLASS_OP_COLOR, NODE_PREVIEW|NODE_OPTIONS);
        node_type_socket_templates(&ntype, cmp_node_mix_rgb_in, cmp_node_mix_rgb_out);
        node_type_size(&ntype, 110, 60, 120);
        node_type_label(&ntype, node_blend_label);
        node_type_exec(&ntype, node_composit_exec_mix_rgb);
 
-       nodeRegisterType(lb, &ntype);
+       nodeRegisterType(ttype, &ntype);
 }
-