~ubuntu-branches/ubuntu/trusty/blender/trusty-proposed

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2013-08-14 10:43:49 UTC
  • mfrom: (14.2.19 sid)
  • Revision ID: package-import@ubuntu.com-20130814104349-t1d5mtwkphp12dyj
Tags: 2.68a-3
* Upload to unstable
* debian/: python3.3 Depends simplified
  - debian/control: python3.3 Depends dropped
    for blender-data package
  - 0001-blender_thumbnailer.patch refreshed
* debian/control: libavcodec b-dep versioning dropped

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
 
34
34
#include <limits.h>
35
35
 
 
36
#include "BKE_context.h"
 
37
 
 
38
#include "RNA_access.h"
 
39
 
36
40
/* ************ qdn: Defocus node ****************** */
37
41
static bNodeSocketTemplate cmp_node_defocus_in[] = {
38
42
        {       SOCK_RGBA, 1, N_("Image"),                      1.0f, 1.0f, 1.0f, 1.0f},
39
 
        {       SOCK_FLOAT, 1, N_("Z"),                 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR},
 
43
        {       SOCK_FLOAT, 1, N_("Z"),                 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, PROP_NONE},
40
44
        {       -1, 0, ""       }
41
45
};
42
46
static bNodeSocketTemplate cmp_node_defocus_out[] = {
44
48
        {       -1, 0, ""       }
45
49
};
46
50
 
47
 
static void node_composit_init_defocus(bNodeTree *UNUSED(ntree), bNode *node, bNodeTemplate *UNUSED(ntemp))
 
51
static void node_composit_init_defocus(const bContext *C, PointerRNA *ptr)
48
52
{
 
53
        Scene *scene = CTX_data_scene(C);
 
54
        bNode *node = ptr->data;
49
55
        /* qdn: defocus node */
50
56
        NodeDefocus *nbd = MEM_callocN(sizeof(NodeDefocus), "node defocus data");
51
57
        nbd->bktype = 0;
59
65
        nbd->scale = 1.f;
60
66
        nbd->no_zbuf = 1;
61
67
        node->storage = nbd;
 
68
        
 
69
        node->id = &scene->id;
62
70
}
63
71
 
64
 
void register_node_type_cmp_defocus(bNodeTreeType *ttype)
 
72
void register_node_type_cmp_defocus(void)
65
73
{
66
74
        static bNodeType ntype;
67
75
 
68
 
        node_type_base(ttype, &ntype, CMP_NODE_DEFOCUS, "Defocus", NODE_CLASS_OP_FILTER, NODE_OPTIONS);
 
76
        cmp_node_type_base(&ntype, CMP_NODE_DEFOCUS, "Defocus", NODE_CLASS_OP_FILTER, 0);
69
77
        node_type_socket_templates(&ntype, cmp_node_defocus_in, cmp_node_defocus_out);
70
 
        node_type_size(&ntype, 150, 120, 200);
71
 
        node_type_init(&ntype, node_composit_init_defocus);
 
78
        ntype.initfunc_api = node_composit_init_defocus;
72
79
        node_type_storage(&ntype, "NodeDefocus", node_free_standard_storage, node_copy_standard_storage);
73
80
 
74
 
        nodeRegisterType(ttype, &ntype);
 
81
        nodeRegisterType(&ntype);
75
82
}