~ubuntu-branches/ubuntu/intrepid/blender/intrepid-updates

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Cyril Brulebois
  • Date: 2008-08-08 02:45:40 UTC
  • mfrom: (12.1.14 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080808024540-kkjp7ekfivzhuw3l
Tags: 2.46+dfsg-4
* Fix python syntax warning in import_dxf.py, which led to nasty output
  in installation/upgrade logs during byte-compilation, using a patch
  provided by the script author (Closes: #492280):
   - debian/patches/45_fix_python_syntax_warning

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**
2
 
 * $Id: BKE_node.h,v 1.15 2006/07/03 09:49:12 ton Exp $
 
2
 * $Id: BKE_node.h 14652 2008-05-01 22:28:18Z ianwill $
3
3
 *
4
4
 * ***** BEGIN GPL LICENSE BLOCK *****
5
5
 *
33
33
#ifndef BKE_NODE_H
34
34
#define BKE_NODE_H
35
35
 
 
36
/* not very important, but the stack solver likes to know a maximum */
 
37
#define MAX_SOCKET      64
 
38
 
36
39
struct ID;
37
40
struct bNodeTree;
38
41
struct bNode;
43
46
struct rctf;
44
47
struct ListBase;
45
48
struct RenderData;
 
49
struct Scene;
46
50
 
47
51
#define SOCK_IN         1
48
52
#define SOCK_OUT        2
63
67
} bNodeSocketType;
64
68
 
65
69
typedef struct bNodeType {
 
70
        void *next,*prev;
66
71
        int type;
67
72
        char *name;
68
73
        float width, minwidth, maxwidth;
74
79
        
75
80
        void (*execfunc)(void *data, struct bNode *, struct bNodeStack **, struct bNodeStack **);
76
81
        
77
 
        /* after this line is set on startup of blender */
 
82
        /* this line is set on startup of blender */
78
83
        int (*butfunc)(struct uiBlock *, struct bNodeTree *, struct bNode *, struct rctf *);
79
84
 
 
85
        void (*initfunc)(struct bNode *);
 
86
        void (*freestoragefunc)(struct bNode *);
 
87
        void (*copystoragefunc)(struct bNode *, struct bNode *);
 
88
        
 
89
        /* for use with dynamic typedefs */
 
90
        ID *id;
 
91
        void *pynode; /* holds pointer to python script */
 
92
        void *pydict; /* holds pointer to python script dictionary (scope)*/
 
93
 
80
94
} bNodeType;
81
95
 
 
96
/* node->exec, now in use for composites (#define for break is same as ready yes) */
 
97
#define NODE_PROCESSING 1
 
98
#define NODE_READY              2
 
99
#define NODE_BREAK              2
 
100
#define NODE_FINISHED   4
 
101
#define NODE_FREEBUFS   8
 
102
 
82
103
/* nodetype->nclass, for add-menu and themes */
83
104
#define NODE_CLASS_INPUT                0
84
105
#define NODE_CLASS_OUTPUT               1
88
109
#define NODE_CLASS_GROUP                6
89
110
#define NODE_CLASS_FILE                 7
90
111
#define NODE_CLASS_CONVERTOR    8
 
112
#define NODE_CLASS_MATTE                9
 
113
#define NODE_CLASS_DISTORT              10
 
114
#define NODE_CLASS_OP_DYNAMIC   11
91
115
 
92
116
/* ************** GENERIC API, TREES *************** */
93
117
 
95
119
 
96
120
struct bNodeTree *ntreeAddTree(int type);
97
121
void                    ntreeInitTypes(struct bNodeTree *ntree);
 
122
 
98
123
void                    ntreeMakeOwnType(struct bNodeTree *ntree);
 
124
void                    ntreeUpdateType(struct bNodeTree *ntree, struct bNodeType *ntype);
99
125
void                    ntreeFreeTree(struct bNodeTree *ntree);
100
126
struct bNodeTree *ntreeCopyTree(struct bNodeTree *ntree, int internal_select);
101
127
void                    ntreeMakeLocal(struct bNodeTree *ntree);
120
146
 
121
147
void                    nodeAddToPreview(struct bNode *, float *, int, int);
122
148
 
123
 
struct bNode    *nodeAddNodeType(struct bNodeTree *ntree, int type, struct bNodeTree *ngroup);
 
149
void                    nodeUnlinkNode(struct bNodeTree *ntree, struct bNode *node);
 
150
void                    nodeAddSockets(struct bNode *node, struct bNodeType *ntype);
 
151
struct bNode    *nodeAddNodeType(struct bNodeTree *ntree, int type, struct bNodeTree *ngroup, struct ID *id);
 
152
void                    nodeRegisterType(struct ListBase *typelist, const struct bNodeType *ntype) ;
 
153
void                    nodeUpdateType(struct bNodeTree *ntree, struct bNode* node, struct bNodeType *ntype);
 
154
void                    nodeMakeDynamicType(struct bNode *node);
 
155
int                             nodeDynamicUnlinkText(struct ID *txtid);
124
156
void                    nodeFreeNode(struct bNodeTree *ntree, struct bNode *node);
125
 
struct bNode    *nodeCopyNode(struct bNodeTree *ntree, struct bNode *node);
 
157
struct bNode    *nodeCopyNode(struct bNodeTree *ntree, struct bNode *node, int internal);
126
158
 
127
159
struct bNodeLink *nodeAddLink(struct bNodeTree *ntree, struct bNode *fromnode, struct bNodeSocket *fromsock, struct bNode *tonode, struct bNodeSocket *tosock);
128
160
void                    nodeRemLink(struct bNodeTree *ntree, struct bNodeLink *link);
129
161
 
 
162
int                     nodeFindNode(struct bNodeTree *ntree, struct bNodeSocket *sock, struct bNode **nodep, int *sockindex);
 
163
 
130
164
struct bNodeLink *nodeFindLink(struct bNodeTree *ntree, struct bNodeSocket *from, struct bNodeSocket *to);
131
165
int                             nodeCountSocketLinks(struct bNodeTree *ntree, struct bNodeSocket *sock);
132
166
 
146
180
void                    nodeVerifyGroup(struct bNodeTree *ngroup);
147
181
void                    nodeGroupSocketUseFlags(struct bNodeTree *ngroup);
148
182
 
 
183
void                    nodeCopyGroup(struct bNode *gnode);
 
184
 
149
185
/* ************** COMMON NODES *************** */
150
186
 
151
 
#define NODE_GROUP                      2
 
187
#define NODE_GROUP              2
152
188
#define NODE_GROUP_MENU         1000
 
189
#define NODE_DYNAMIC_MENU       4000
153
190
 
154
191
extern bNodeType node_group_typeinfo;
155
192
 
177
214
#define SH_NODE_MAPPING         109
178
215
#define SH_NODE_CURVE_VEC       110
179
216
#define SH_NODE_CURVE_RGB       111
 
217
#define SH_NODE_CAMERA          114
 
218
#define SH_NODE_MATH            115
 
219
#define SH_NODE_VECT_MATH       116
 
220
#define SH_NODE_SQUEEZE         117
 
221
#define SH_NODE_MATERIAL_EXT    118
 
222
#define SH_NODE_INVERT          119
 
223
#define SH_NODE_SEPRGB          120
 
224
#define SH_NODE_COMBRGB         121
 
225
#define SH_NODE_HUE_SAT         122
 
226
#define NODE_DYNAMIC            123
180
227
 
181
 
/* custom defines: options for Material node */
182
 
#define SH_NODE_MAT_DIFF        1
183
 
#define SH_NODE_MAT_SPEC        2
184
 
#define SH_NODE_MAT_NEG         4
 
228
/* custom defines options for Material node */
 
229
#define SH_NODE_MAT_DIFF   1
 
230
#define SH_NODE_MAT_SPEC   2
 
231
#define SH_NODE_MAT_NEG    4
 
232
/* custom defines: states for Script node. These are bit indices */
 
233
#define NODE_DYNAMIC_READY      0 /* 1 */
 
234
#define NODE_DYNAMIC_LOADED     1 /* 2 */
 
235
#define NODE_DYNAMIC_NEW        2 /* 4 */
 
236
#define NODE_DYNAMIC_UPDATED    3 /* 8 */
 
237
#define NODE_DYNAMIC_ADDEXIST   4 /* 16 */
 
238
#define NODE_DYNAMIC_ERROR      5 /* 32 */
 
239
#define NODE_DYNAMIC_REPARSE    6 /* 64 */
 
240
#define NODE_DYNAMIC_SET        15 /* sign */
185
241
 
186
242
/* the type definitions array */
187
 
extern bNodeType *node_all_shaders[];
 
243
extern struct ListBase node_all_shaders;
188
244
 
189
245
/* API */
190
246
 
191
247
void                    ntreeShaderExecTree(struct bNodeTree *ntree, struct ShadeInput *shi, struct ShadeResult *shr);
192
 
int                             ntreeShaderGetTexco(struct bNodeTree *ntree, int osa);
 
248
void                    ntreeShaderGetTexcoMode(struct bNodeTree *ntree, int osa, short *texco, int *mode);
193
249
void                    nodeShaderSynchronizeID(struct bNode *node, int copyto);
194
250
 
195
251
                                /* switch material render loop */
 
252
extern void (*node_shader_lamp_loop)(struct ShadeInput *, struct ShadeResult *);
196
253
void                    set_node_shader_lamp_loop(void (*lamp_loop_func)(struct ShadeInput *, struct ShadeResult *));
197
254
 
 
255
 
198
256
/* ************** COMPOSITE NODES *************** */
199
257
 
 
258
/* output socket defines */
 
259
#define RRES_OUT_IMAGE          0
 
260
#define RRES_OUT_ALPHA          1
 
261
#define RRES_OUT_Z                      2
 
262
#define RRES_OUT_NORMAL         3
 
263
#define RRES_OUT_UV                     4
 
264
#define RRES_OUT_VEC            5
 
265
#define RRES_OUT_RGBA           6
 
266
#define RRES_OUT_DIFF           7
 
267
#define RRES_OUT_SPEC           8
 
268
#define RRES_OUT_SHADOW         9
 
269
#define RRES_OUT_AO                     10
 
270
#define RRES_OUT_REFLECT        11
 
271
#define RRES_OUT_REFRACT        12
 
272
#define RRES_OUT_RADIO          13
 
273
#define RRES_OUT_INDEXOB        14
 
274
#define RRES_OUT_MIST           15
 
275
 
200
276
/* note: types are needed to restore callbacks, don't change values */
201
277
#define CMP_NODE_VIEWER         201
202
278
#define CMP_NODE_RGB            202
217
293
#define CMP_NODE_SEPHSVA        217
218
294
#define CMP_NODE_SETALPHA       218
219
295
#define CMP_NODE_HUE_SAT        219
220
 
#define CMP_NODE_IMAGE                  220
221
 
#define CMP_NODE_R_LAYERS               221
222
 
#define CMP_NODE_COMPOSITE              222
 
296
#define CMP_NODE_IMAGE          220
 
297
#define CMP_NODE_R_LAYERS       221
 
298
#define CMP_NODE_COMPOSITE      222
223
299
#define CMP_NODE_OUTPUT_FILE    223
224
 
#define CMP_NODE_TEXTURE                224
225
 
#define CMP_NODE_TRANSLATE              225
226
 
#define CMP_NODE_ZCOMBINE               226
227
 
 
 
300
#define CMP_NODE_TEXTURE        224
 
301
#define CMP_NODE_TRANSLATE      225
 
302
#define CMP_NODE_ZCOMBINE       226
 
303
#define CMP_NODE_COMBRGBA       227
 
304
#define CMP_NODE_DILATEERODE    228
 
305
#define CMP_NODE_ROTATE         229
 
306
#define CMP_NODE_SCALE          230
 
307
#define CMP_NODE_SEPYCCA        231
 
308
#define CMP_NODE_COMBYCCA       232
 
309
#define CMP_NODE_SEPYUVA        233
 
310
#define CMP_NODE_COMBYUVA       234
 
311
#define CMP_NODE_DIFF_MATTE     235
 
312
#define CMP_NODE_COLOR_SPILL    236
 
313
#define CMP_NODE_CHROMA         237
 
314
#define CMP_NODE_CHANNEL_MATTE  238
 
315
#define CMP_NODE_FLIP           239
 
316
#define CMP_NODE_SPLITVIEWER    240
 
317
#define CMP_NODE_INDEX_MASK     241
 
318
#define CMP_NODE_MAP_UV         242
 
319
#define CMP_NODE_ID_MASK        243
 
320
#define CMP_NODE_DEFOCUS        244
 
321
#define CMP_NODE_DISPLACE       245
 
322
#define CMP_NODE_COMBHSVA       246
 
323
#define CMP_NODE_MATH           247
 
324
#define CMP_NODE_LUMA_MATTE     248
 
325
#define CMP_NODE_BRIGHTCONTRAST 249
 
326
#define CMP_NODE_GAMMA          250
 
327
#define CMP_NODE_INVERT         251
 
328
#define CMP_NODE_NORMALIZE      252
 
329
#define CMP_NODE_CROP           253
 
330
#define CMP_NODE_DBLUR          254
 
331
#define CMP_NODE_BILATERALBLUR  255
 
332
#define CMP_NODE_PREMULKEY  256
 
333
 
 
334
#define CMP_NODE_GLARE          301
 
335
#define CMP_NODE_TONEMAP        302
 
336
#define CMP_NODE_LENSDIST       303
 
337
 
 
338
/* channel toggles */
 
339
#define CMP_CHAN_RGB            1
 
340
#define CMP_CHAN_A                      2
 
341
#define CMP_CHAN_R                      4
 
342
#define CMP_CHAN_G                      8
 
343
#define CMP_CHAN_B                      16
228
344
 
229
345
/* filter types */
230
346
#define CMP_FILT_SOFT           0
235
351
#define CMP_FILT_KIRSCH         5
236
352
#define CMP_FILT_SHADOW         6
237
353
 
 
354
/* scale node type, in custom1 */
 
355
#define CMP_SCALE_RELATIVE              0
 
356
#define CMP_SCALE_ABSOLUTE              1
 
357
#define CMP_SCALE_SCENEPERCENT  2
 
358
 
238
359
 
239
360
/* the type definitions array */
240
 
extern bNodeType *node_all_composit[];
 
361
extern struct ListBase node_all_composit;
241
362
 
242
363
/* API */
243
364
struct CompBuf;
244
 
void ntreeCompositTagRender(struct bNodeTree *ntree);
245
 
void ntreeCompositTagAnimated(struct bNodeTree *ntree);
 
365
void ntreeCompositTagRender(struct Scene *sce);
 
366
int ntreeCompositTagAnimated(struct bNodeTree *ntree);
246
367
void ntreeCompositTagGenerators(struct bNodeTree *ntree);
 
368
void ntreeCompositForceHidden(struct bNodeTree *ntree);
247
369
 
248
370
void free_compbuf(struct CompBuf *cbuf); /* internal...*/
249
371
 
 
372
void init_nodesystem(void);
 
373
void free_nodesystem(void);
 
374
 
250
375
#endif
251