~siretart/ubuntu/utopic/blender/libav10

« back to all changes in this revision

Viewing changes to source/blender/nodes/composite/nodes/node_composite_scale.c

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-02-19 11:24:23 UTC
  • mfrom: (14.2.23 sid)
  • Revision ID: package-import@ubuntu.com-20140219112423-rkmaz2m7ha06d4tk
Tags: 2.69-3ubuntu1
* Merge with Debian; remaining changes:
  - Configure without OpenImageIO on armhf, as it is not available on
    Ubuntu.

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
        {   -1, 0, ""   }
46
46
};
47
47
 
 
48
static void node_composite_update_scale(bNodeTree *UNUSED(ntree), bNode *node)
 
49
{
 
50
        bNodeSocket *sock;
 
51
        bool use_xy_scale = ELEM(node->custom1, CMP_SCALE_RELATIVE, CMP_SCALE_ABSOLUTE);
 
52
 
 
53
        /* Only show X/Y scale factor inputs for modes using them! */
 
54
        for (sock = node->inputs.first; sock; sock = sock->next) {
 
55
                if (STREQ(sock->name, "X") || STREQ(sock->name, "Y")) {
 
56
                        if (use_xy_scale) {
 
57
                                sock->flag &= ~SOCK_UNAVAIL;
 
58
                        }
 
59
                        else {
 
60
                                sock->flag |= SOCK_UNAVAIL;
 
61
                        }
 
62
                }
 
63
        }
 
64
}
 
65
 
48
66
void register_node_type_cmp_scale(void)
49
67
{
50
68
        static bNodeType ntype;
51
69
 
52
70
        cmp_node_type_base(&ntype, CMP_NODE_SCALE, "Scale", NODE_CLASS_DISTORT, 0);
53
71
        node_type_socket_templates(&ntype, cmp_node_scale_in, cmp_node_scale_out);
 
72
        node_type_update(&ntype, node_composite_update_scale, NULL);
54
73
 
55
74
        nodeRegisterType(&ntype);
56
75
}