75
80
void (*execfunc)(void *data, struct bNode *, struct bNodeStack **, struct bNodeStack **);
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 *);
85
void (*initfunc)(struct bNode *);
86
void (*freestoragefunc)(struct bNode *);
87
void (*copystoragefunc)(struct bNode *, struct bNode *);
89
/* for use with dynamic typedefs */
91
void *pynode; /* holds pointer to python script */
92
void *pydict; /* holds pointer to python script dictionary (scope)*/
96
/* node->exec, now in use for composites (#define for break is same as ready yes) */
97
#define NODE_PROCESSING 1
100
#define NODE_FINISHED 4
101
#define NODE_FREEBUFS 8
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
92
116
/* ************** GENERIC API, TREES *************** */
96
120
struct bNodeTree *ntreeAddTree(int type);
97
121
void ntreeInitTypes(struct bNodeTree *ntree);
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);
121
147
void nodeAddToPreview(struct bNode *, float *, int, int);
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);
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);
162
int nodeFindNode(struct bNodeTree *ntree, struct bNodeSocket *sock, struct bNode **nodep, int *sockindex);
130
164
struct bNodeLink *nodeFindLink(struct bNodeTree *ntree, struct bNodeSocket *from, struct bNodeSocket *to);
131
165
int nodeCountSocketLinks(struct bNodeTree *ntree, struct bNodeSocket *sock);
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
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 */
186
242
/* the type definitions array */
187
extern bNodeType *node_all_shaders[];
243
extern struct ListBase node_all_shaders;
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);
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 *));
198
256
/* ************** COMPOSITE NODES *************** */
258
/* output socket defines */
259
#define RRES_OUT_IMAGE 0
260
#define RRES_OUT_ALPHA 1
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
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
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
334
#define CMP_NODE_GLARE 301
335
#define CMP_NODE_TONEMAP 302
336
#define CMP_NODE_LENSDIST 303
338
/* channel toggles */
339
#define CMP_CHAN_RGB 1
343
#define CMP_CHAN_B 16
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
354
/* scale node type, in custom1 */
355
#define CMP_SCALE_RELATIVE 0
356
#define CMP_SCALE_ABSOLUTE 1
357
#define CMP_SCALE_SCENEPERCENT 2
239
360
/* the type definitions array */
240
extern bNodeType *node_all_composit[];
361
extern struct ListBase node_all_composit;
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);
248
370
void free_compbuf(struct CompBuf *cbuf); /* internal...*/
372
void init_nodesystem(void);
373
void free_nodesystem(void);