~ubuntu-branches/ubuntu/utopic/blender/utopic-proposed

« back to all changes in this revision

Viewing changes to source/blender/blenkernel/BKE_node.h

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2012-04-28 12:11:12 UTC
  • mto: (14.1.6 experimental) (1.5.1)
  • mto: This revision was merged to the branch mainline in revision 34.
  • Revision ID: package-import@ubuntu.com-20120428121112-2zi0vp8b6vejda8i
Tags: upstream-2.63
ImportĀ upstreamĀ versionĀ 2.63

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 * ***** END GPL LICENSE BLOCK *****
26
26
 */
27
27
 
28
 
#ifndef BKE_NODE_H
29
 
#define BKE_NODE_H
 
28
#ifndef __BKE_NODE_H__
 
29
#define __BKE_NODE_H__
30
30
 
31
31
/** \file BKE_node.h
32
32
 *  \ingroup bke
50
50
struct GPUNode;
51
51
struct GPUNodeStack;
52
52
struct ID;
 
53
struct ImageFormatData;
53
54
struct ListBase;
54
55
struct Main;
55
56
struct uiBlock;
112
113
typedef struct bNodeTemplate {
113
114
        int type;
114
115
        
115
 
        /* group tree */
116
 
        struct bNodeTree *ngroup;
 
116
        struct Main *main;
 
117
        struct Scene *scene;
 
118
        struct bNodeTree *ngroup;       /* group tree */
117
119
} bNodeTemplate;
118
120
 
119
121
/** Defines a node type.
163
165
        /// Create a template from an existing node.
164
166
        struct bNodeTemplate (*templatefunc)(struct bNode *);
165
167
        /** If a node can be made from the template in the given node tree.
166
 
         * \example Node groups can not be created inside their own node tree.
 
168
         * \note Node groups can not be created inside their own node tree.
167
169
         */
168
170
        int (*validfunc)(struct bNodeTree *ntree, struct bNodeTemplate *ntemp);
169
171
        
178
180
        struct bNodeTree *(*group_edit_set)(struct bNode *node, int edit);
179
181
        void (*group_edit_clear)(struct bNode *node);
180
182
        
 
183
        /* Generate a temporary list of internal links (bNodeLink), for muting and disconnect operators.
 
184
         * Result must be freed by caller!
 
185
         */
 
186
        ListBase (*internal_connect)(struct bNodeTree *, struct bNode *node);
181
187
        
182
188
        /* **** execution callbacks **** */
183
189
        void *(*initexecfunc)(struct bNode *node);
187
193
         * when a final generic version of execution code is defined, this will be changed anyway
188
194
         */
189
195
        void (*newexecfunc)(void *data, int thread, struct bNode *, void *nodedata, struct bNodeStack **, struct bNodeStack **);
190
 
        /* This is the muting callback.
191
 
         * XXX Mimics the newexecfunc signature... Not sure all of this will be useful, we will see.
192
 
         */
193
 
        void (*mutefunc)(void *data, int thread, struct bNode *, void *nodedata, struct bNodeStack **, struct bNodeStack **);
194
 
        /* And the muting util.
195
 
         * Returns links as a ListBase, as pairs of bNodeStack* if in/out bNodeStacks were provided,
196
 
         * else as pairs of bNodeSocket* if node tree was provided.
197
 
         */
198
 
        ListBase (*mutelinksfunc)(struct bNodeTree *, struct bNode *, struct bNodeStack **, struct bNodeStack **,
199
 
                                  struct GPUNodeStack *, struct GPUNodeStack *);
200
196
        /* gpu */
201
197
        int (*gpufunc)(struct GPUMaterial *mat, struct bNode *node, struct GPUNodeStack *in, struct GPUNodeStack *out);
202
198
        /* extended gpu function */
203
199
        int (*gpuextfunc)(struct GPUMaterial *mat, struct bNode *node, void *nodedata, struct GPUNodeStack *in, struct GPUNodeStack *out);
204
 
        /* This is the muting gpu callback.
205
 
         * XXX Mimics the gpuextfunc signature... Not sure all of this will be useful, we will see.
206
 
         */
207
 
        int (*gpumutefunc)(struct GPUMaterial *, struct bNode *, void *, struct GPUNodeStack *, struct GPUNodeStack *);
208
200
} bNodeType;
209
201
 
210
202
/* node->exec, now in use for composites (#define for break is same as ready yes) */
282
274
        
283
275
        int (*validate_link)(struct bNodeTree *ntree, struct bNodeLink *link);
284
276
 
285
 
        /* Default muting pointers. */
286
 
        void (*mutefunc)(void *data, int thread, struct bNode *, void *nodedata, struct bNodeStack **, struct bNodeStack **);
287
 
        ListBase (*mutelinksfunc)(struct bNodeTree *, struct bNode *, struct bNodeStack **, struct bNodeStack **,
288
 
                                  struct GPUNodeStack *, struct GPUNodeStack *);
289
 
        /* gpu */
290
 
        int (*gpumutefunc)(struct GPUMaterial *, struct bNode *, void *, struct GPUNodeStack *, struct GPUNodeStack *);
 
277
        /* Default internal linking. */
 
278
        ListBase (*internal_connect)(struct bNodeTree *, struct bNode *node);
291
279
} bNodeTreeType;
292
280
 
293
281
/* ************** GENERIC API, TREES *************** */
341
329
void                    nodeUnlinkNode(struct bNodeTree *ntree, struct bNode *node);
342
330
void                    nodeUniqueName(struct bNodeTree *ntree, struct bNode *node);
343
331
 
344
 
void                    nodeRegisterType(struct bNodeTreeType *ttype, struct bNodeType *ntype) ;
 
332
void                    nodeRegisterType(struct bNodeTreeType *ttype, struct bNodeType *ntype);
345
333
void                    nodeMakeDynamicType(struct bNode *node);
346
334
int                             nodeDynamicUnlinkText(struct ID *txtid);
347
335
 
351
339
struct bNodeLink *nodeAddLink(struct bNodeTree *ntree, struct bNode *fromnode, struct bNodeSocket *fromsock, struct bNode *tonode, struct bNodeSocket *tosock);
352
340
void                    nodeRemLink(struct bNodeTree *ntree, struct bNodeLink *link);
353
341
void                    nodeRemSocketLinks(struct bNodeTree *ntree, struct bNodeSocket *sock);
 
342
void                    nodeInternalRelink(struct bNodeTree *ntree, struct bNode *node);
354
343
 
355
344
void                    nodeSpaceCoords(struct bNode *node, float *locx, float *locy);
356
345
void                    nodeAttachNode(struct bNode *node, struct bNode *parent);
375
364
void                    nodeFreePreview(struct bNode *node);
376
365
 
377
366
int                             nodeSocketIsHidden(struct bNodeSocket *sock);
 
367
void                    nodeSocketSetType(struct bNodeSocket *sock, int type);
378
368
 
379
369
/* ************** NODE TYPE ACCESS *************** */
380
370
 
416
406
                                                                   void (*freeexecfunc)(struct bNode *node, void *nodedata),
417
407
                                                                   void (*newexecfunc)(void *data, int thread, struct bNode *, void *nodedata,
418
408
                                                                                       struct bNodeStack **, struct bNodeStack **));
419
 
void                    node_type_mute(struct bNodeType *ntype,
420
 
                               void (*mutefunc)(void *data, int thread, struct bNode *, void *nodedata,
421
 
                                                struct bNodeStack **, struct bNodeStack **),
422
 
                               ListBase (*mutelinksfunc)(struct bNodeTree *, struct bNode *, struct bNodeStack **,
423
 
                                                         struct bNodeStack **, struct GPUNodeStack*, struct GPUNodeStack*));
 
409
void                    node_type_internal_connect(struct bNodeType *ntype, ListBase (*internal_connect)(struct bNodeTree *, struct bNode *));
424
410
void                    node_type_gpu(struct bNodeType *ntype, int (*gpufunc)(struct GPUMaterial *mat, struct bNode *node,
425
411
                                                                      struct GPUNodeStack *in, struct GPUNodeStack *out));
426
412
void                    node_type_gpu_ext(struct bNodeType *ntype, int (*gpuextfunc)(struct GPUMaterial *mat, struct bNode *node,
427
413
                                                                             void *nodedata, struct GPUNodeStack *in,
428
414
                                                                             struct GPUNodeStack *out));
429
 
void                    node_type_gpu_mute(struct bNodeType *ntype, int (*gpumutefunc)(struct GPUMaterial *, struct bNode *, void *,
430
 
                                                                               struct GPUNodeStack *, struct GPUNodeStack *));
431
415
void                    node_type_compatibility(struct bNodeType *ntype, short compatibility);
432
416
 
433
417
/* ************** COMMON NODES *************** */
653
637
#define CMP_NODE_TRANSFORM      264
654
638
#define CMP_NODE_MOVIEDISTORTION        265
655
639
#define CMP_NODE_DOUBLEEDGEMASK    266
 
640
#define CMP_NODE_OUTPUT_MULTI_FILE__DEPRECATED  267     /* DEPRECATED multi file node has been merged into regular CMP_NODE_OUTPUT_FILE */
656
641
 
657
642
#define CMP_NODE_GLARE          301
658
643
#define CMP_NODE_TONEMAP        302
692
677
void ntreeCompositForceHidden(struct bNodeTree *ntree, struct Scene *scene);
693
678
void ntreeCompositClearTags(struct bNodeTree *ntree);
694
679
 
 
680
struct bNodeSocket *ntreeCompositOutputFileAddSocket(struct bNodeTree *ntree, struct bNode *node,
 
681
                                                     const char *name, struct ImageFormatData *im_format);
 
682
int ntreeCompositOutputFileRemoveActiveSocket(struct bNodeTree *ntree, struct bNode *node);
695
683
 
696
684
/* ************** TEXTURE NODES *************** */
697
685
 
727
715
 
728
716
/* API */
729
717
int  ntreeTexTagAnimated(struct bNodeTree *ntree);
730
 
void ntreeTexSetPreviewFlag(int);
731
718
void ntreeTexCheckCyclics(struct bNodeTree *ntree);
732
 
char* ntreeTexOutputMenu(struct bNodeTree *ntree);
733
719
 
734
720
struct bNodeTreeExec *ntreeTexBeginExecTree(struct bNodeTree *ntree, int use_tree_data);
735
721
void ntreeTexEndExecTree(struct bNodeTreeExec *exec, int use_tree_data);