1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2005 Blender Foundation.
17  * All rights reserved.
18  */
19 
20 /** \file
21  * \ingroup DNA
22  */
23 
24 #pragma once
25 
26 #include "DNA_ID.h"
27 #include "DNA_listBase.h"
28 #include "DNA_scene_types.h"
29 #include "DNA_texture_types.h"
30 #include "DNA_vec_types.h"
31 
32 struct AnimData;
33 struct ID;
34 struct Image;
35 struct ListBase;
36 struct bGPdata;
37 struct bNodeInstanceHash;
38 struct bNodeLink;
39 struct bNodePreview;
40 struct bNodeTreeExec;
41 struct bNodeType;
42 struct uiBlock;
43 
44 #define NODE_MAXSTR 64
45 
46 typedef struct bNodeStack {
47   float vec[4];
48   float min, max;
49   void *data;
50   /** When input has link, tagged before executing. */
51   short hasinput;
52   /** When output is linked, tagged before executing. */
53   short hasoutput;
54   /** Type of data pointer. */
55   short datatype;
56   /** Type of socket stack comes from, to remap linking different sockets. */
57   short sockettype;
58   /** Data is a copy of external data (no freeing). */
59   short is_copy;
60   /** Data is used by external nodes (no freeing). */
61   short external;
62   char _pad[4];
63 } bNodeStack;
64 
65 /* ns->datatype, shadetree only */
66 #define NS_OSA_VECTORS 1
67 #define NS_OSA_VALUES 2
68 
69 /* node socket/node socket type -b conversion rules */
70 #define NS_CR_CENTER 0
71 #define NS_CR_NONE 1
72 #define NS_CR_FIT_WIDTH 2
73 #define NS_CR_FIT_HEIGHT 3
74 #define NS_CR_FIT 4
75 #define NS_CR_STRETCH 5
76 
77 typedef struct bNodeSocket {
78   struct bNodeSocket *next, *prev, *new_sock;
79 
80   /** User-defined properties. */
81   IDProperty *prop;
82 
83   /** Unique identifier for mapping. */
84   char identifier[64];
85 
86   /** MAX_NAME. */
87   char name[64];
88 
89   /* XXX deprecated, only used for the Image and OutputFile nodes,
90    * should be removed at some point.
91    */
92   /** Custom storage. */
93   void *storage;
94 
95   short type, flag;
96   /** Max. number of links. Read via nodeSocketLinkLimit, because the limit might be defined on the
97    * socket type. */
98   short limit;
99   /** Input/output type. */
100   short in_out;
101   /** Runtime type information. */
102   struct bNodeSocketType *typeinfo;
103   /** Runtime type identifier. */
104   char idname[64];
105 
106   float locx, locy;
107 
108   /** Default input value used for unlinked sockets. */
109   void *default_value;
110 
111   /* execution data */
112   /** Local stack index. */
113   short stack_index;
114   /* XXX deprecated, kept for forward compatibility */
115   short stack_type DNA_DEPRECATED;
116   char display_shape;
117   char _pad[3];
118 
119   /** Custom dynamic defined label, MAX_NAME. */
120   char label[64];
121 
122   /** Cached data from execution. */
123   void *cache;
124 
125   /* internal data to retrieve relations and groups
126    * DEPRECATED, now uses the generic identifier string instead
127    */
128   /** Group socket identifiers, to find matching pairs after reading files. */
129   int own_index DNA_DEPRECATED;
130   /* XXX deprecated, only used for restoring old group node links */
131   int to_index DNA_DEPRECATED;
132   /* XXX deprecated, still forward compatible since verification
133    * restores pointer from matching own_index. */
134   struct bNodeSocket *groupsock DNA_DEPRECATED;
135 
136   /** A link pointer, set in ntreeUpdateTree. */
137   struct bNodeLink *link;
138 
139   /* XXX deprecated, socket input values are stored in default_value now.
140    * kept for forward compatibility */
141   /** Custom data for inputs, only UI writes in this. */
142   bNodeStack ns DNA_DEPRECATED;
143 } bNodeSocket;
144 
145 /* sock->type */
146 typedef enum eNodeSocketDatatype {
147   SOCK_CUSTOM = -1, /* socket has no integer type */
148   SOCK_FLOAT = 0,
149   SOCK_VECTOR = 1,
150   SOCK_RGBA = 2,
151   SOCK_SHADER = 3,
152   SOCK_BOOLEAN = 4,
153   __SOCK_MESH = 5, /* deprecated */
154   SOCK_INT = 6,
155   SOCK_STRING = 7,
156   SOCK_OBJECT = 8,
157   SOCK_IMAGE = 9,
158 } eNodeSocketDatatype;
159 
160 /* socket shape */
161 typedef enum eNodeSocketDisplayShape {
162   SOCK_DISPLAY_SHAPE_CIRCLE = 0,
163   SOCK_DISPLAY_SHAPE_SQUARE = 1,
164   SOCK_DISPLAY_SHAPE_DIAMOND = 2,
165   SOCK_DISPLAY_SHAPE_CIRCLE_DOT = 3,
166   SOCK_DISPLAY_SHAPE_SQUARE_DOT = 4,
167   SOCK_DISPLAY_SHAPE_DIAMOND_DOT = 5,
168 } eNodeSocketDisplayShape;
169 
170 /* socket side (input/output) */
171 typedef enum eNodeSocketInOut {
172   SOCK_IN = 1 << 0,
173   SOCK_OUT = 1 << 1,
174 } eNodeSocketInOut;
175 
176 /* sock->flag, first bit is select */
177 typedef enum eNodeSocketFlag {
178   /** hidden is user defined, to hide unused */
179   SOCK_HIDDEN = (1 << 1),
180   /** for quick check if socket is linked */
181   SOCK_IN_USE = (1 << 2),
182   /** unavailable is for dynamic sockets */
183   SOCK_UNAVAIL = (1 << 3),
184   // /** DEPRECATED  dynamic socket (can be modified by user) */
185   // SOCK_DYNAMIC = (1 << 4),
186   // /** DEPRECATED  group socket should not be exposed */
187   // SOCK_INTERNAL = (1 << 5),
188   /** socket collapsed in UI */
189   SOCK_COLLAPSED = (1 << 6),
190   /** hide socket value, if it gets auto default */
191   SOCK_HIDE_VALUE = (1 << 7),
192   /** socket hidden automatically, to distinguish from manually hidden */
193   SOCK_AUTO_HIDDEN__DEPRECATED = (1 << 8),
194   SOCK_NO_INTERNAL_LINK = (1 << 9),
195   /** Draw socket in a more compact form. */
196   SOCK_COMPACT = (1 << 10),
197 } eNodeSocketFlag;
198 
199 /* limit data in bNode to what we want to see saved? */
200 typedef struct bNode {
201   struct bNode *next, *prev, *new_node;
202 
203   /** User-defined properties. */
204   IDProperty *prop;
205 
206   /** Runtime type information. */
207   struct bNodeType *typeinfo;
208   /** Runtime type identifier. */
209   char idname[64];
210 
211   /** MAX_NAME. */
212   char name[64];
213   int flag;
214   short type;
215   char _pad[2];
216   /** Both for dependency and sorting. */
217   short done, level;
218   /** Lasty: check preview render status, menunr: browse ID blocks. */
219   short lasty, menunr;
220   /** For groupnode, offset in global caller stack. */
221   short stack_index;
222   /** Number of this node in list, used for UI exec events. */
223   short nr;
224   /** Custom user-defined color. */
225   float color[3];
226 
227   ListBase inputs, outputs;
228   /** Parent node. */
229   struct bNode *parent;
230   /** Optional link to libdata. */
231   struct ID *id;
232   /** Custom data, must be struct, for storage in file. */
233   void *storage;
234   /** The original node in the tree (for localized tree). */
235   struct bNode *original;
236   /** List of cached internal links (input to output), for muted nodes and operators. */
237   ListBase internal_links;
238 
239   /** Root offset for drawing (parent space). */
240   float locx, locy;
241   /** Node custom width and height. */
242   float width, height;
243   /** Node width if hidden. */
244   float miniwidth;
245   /** Additional offset from loc. */
246   float offsetx, offsety;
247   /** Initial locx for insert offset animation. */
248   float anim_init_locx;
249   /** Offset that will be added to locx for insert offset animation. */
250   float anim_ofsx;
251 
252   /** Update flags. */
253   int update;
254 
255   /** Custom user-defined label, MAX_NAME. */
256   char label[64];
257   /** To be abused for buttons. */
258   short custom1, custom2;
259   float custom3, custom4;
260 
261   /** Need_exec is set as UI execution event, exec is flag during exec. */
262   short need_exec, exec;
263   /** Optional extra storage for use in thread (read only then!). */
264   void *threaddata;
265   /** Entire boundbox (worldspace). */
266   rctf totr;
267   /** Optional buttons area. */
268   rctf butr;
269   /** Optional preview area. */
270   rctf prvr;
271   /**
272    * XXX TODO
273    * Node totr size depends on the prvr size, which in turn is determined from preview size.
274    * In earlier versions bNodePreview was stored directly in nodes, but since now there can be
275    * multiple instances using different preview images it is possible that required node size
276    * varies between instances. preview_xsize, preview_ysize defines a common reserved size for
277    * preview rect for now, could be replaced by more accurate node instance drawing,
278    * but that requires removing totr from DNA and replacing all uses with per-instance data.
279    */
280   /** Reserved size of the preview rect. */
281   short preview_xsize, preview_ysize;
282   /** Used at runtime when going through the tree. Initialize before use. */
283   short tmp_flag;
284   /** Used at runtime to tag derivatives branches. EEVEE only. */
285   char branch_tag;
286   /** Used at runtime when iterating over node branches. */
287   char iter_flag;
288   /** Runtime during drawing. */
289   struct uiBlock *block;
290 
291   /**
292    * XXX: eevee only, id of screen space reflection layer,
293    * needs to be a float to feed GPU_uniform.
294    */
295   float ssr_id;
296   /**
297    * XXX: eevee only, id of screen subsurface scatter layer,
298    * needs to be a float to feed GPU_uniform.
299    */
300   float sss_id;
301 } bNode;
302 
303 /* node->flag */
304 #define NODE_SELECT 1
305 #define NODE_OPTIONS 2
306 #define NODE_PREVIEW 4
307 #define NODE_HIDDEN 8
308 #define NODE_ACTIVE 16
309 #define NODE_ACTIVE_ID 32
310 #define NODE_DO_OUTPUT 64
311 #define __NODE_GROUP_EDIT 128 /* DEPRECATED */
312 /* free test flag, undefined */
313 #define NODE_TEST 256
314 /* node is disabled */
315 #define NODE_MUTED 512
316 // #define NODE_CUSTOM_NAME 1024    /* deprecated! */
317 /* group node types: use const outputs by default */
318 #define NODE_CONST_OUTPUT (1 << 11)
319 /* node is always behind others */
320 #define NODE_BACKGROUND (1 << 12)
321 /* automatic flag for nodes included in transforms */
322 #define NODE_TRANSFORM (1 << 13)
323 /* node is active texture */
324 
325 /* note: take care with this flag since its possible it gets
326  * `stuck` inside/outside the active group - which makes buttons
327  * window texture not update, we try to avoid it by clearing the
328  * flag when toggling group editing - Campbell */
329 #define NODE_ACTIVE_TEXTURE (1 << 14)
330 /* use a custom color for the node */
331 #define NODE_CUSTOM_COLOR (1 << 15)
332 /* Node has been initialized
333  * This flag indicates the node->typeinfo->init function has been called.
334  * In case of undefined type at creation time this can be delayed until
335  * until the node type is registered.
336  */
337 #define NODE_INIT (1 << 16)
338 
339 /* do recalc of output, used to skip recalculation of unwanted
340  * composite out nodes when editing tree
341  */
342 #define NODE_DO_OUTPUT_RECALC (1 << 17)
343 
344 /* node->update */
345 /* XXX NODE_UPDATE is a generic update flag. More fine-grained updates
346  * might be used in the future, but currently all work the same way.
347  */
348 #define NODE_UPDATE 0xFFFF     /* generic update flag (includes all others) */
349 #define NODE_UPDATE_ID 1       /* associated id data block has changed */
350 #define NODE_UPDATE_OPERATOR 2 /* node update triggered from update operator */
351 
352 /* Unique hash key for identifying node instances
353  * Defined as a struct because DNA does not support other typedefs.
354  */
355 typedef struct bNodeInstanceKey {
356   unsigned int value;
357 } bNodeInstanceKey;
358 
359 /* Base struct for entries in node instance hash.
360  * WARNING: pointers are cast to this struct internally,
361  * it must be first member in hash entry structs!
362  */
363 #
364 #
365 typedef struct bNodeInstanceHashEntry {
366   bNodeInstanceKey key;
367 
368   /* tags for cleaning the cache */
369   short tag;
370 } bNodeInstanceHashEntry;
371 
372 #
373 #
374 typedef struct bNodePreview {
375   /** Must be first. */
376   bNodeInstanceHashEntry hash_entry;
377 
378   unsigned char *rect;
379   short xsize, ysize;
380 } bNodePreview;
381 
382 typedef struct bNodeLink {
383   struct bNodeLink *next, *prev;
384 
385   bNode *fromnode, *tonode;
386   bNodeSocket *fromsock, *tosock;
387 
388   int flag;
389   char _pad[4];
390 } bNodeLink;
391 
392 /* link->flag */
393 #define NODE_LINKFLAG_HILITE (1 << 0) /* link has been successfully validated */
394 #define NODE_LINK_VALID (1 << 1)
395 #define NODE_LINK_TEST (1 << 2) /* free test flag, undefined */
396 
397 /* tree->edit_quality/tree->render_quality */
398 #define NTREE_QUALITY_HIGH 0
399 #define NTREE_QUALITY_MEDIUM 1
400 #define NTREE_QUALITY_LOW 2
401 
402 /* tree->chunksize */
403 #define NTREE_CHUNKSIZE_32 32
404 #define NTREE_CHUNKSIZE_64 64
405 #define NTREE_CHUNKSIZE_128 128
406 #define NTREE_CHUNKSIZE_256 256
407 #define NTREE_CHUNKSIZE_512 512
408 #define NTREE_CHUNKSIZE_1024 1024
409 
410 /* the basis for a Node tree, all links and nodes reside internal here */
411 /* only re-usable node trees are in the library though,
412  * materials and textures allocate own tree struct */
413 typedef struct bNodeTree {
414   ID id;
415   /** Animation data (must be immediately after id for utilities to use it). */
416   struct AnimData *adt;
417 
418   /** Runtime type information. */
419   struct bNodeTreeType *typeinfo;
420   /** Runtime type identifier. */
421   char idname[64];
422 
423   /** Runtime RNA type of the group interface. */
424   struct StructRNA *interface_type;
425 
426   /** Grease pencil data. */
427   struct bGPdata *gpd;
428   /** Node tree stores own offset for consistent editor view. */
429   float view_center[2];
430 
431   ListBase nodes, links;
432 
433   /** Set init on fileread. */
434   int type, init;
435   /**
436    * Sockets in groups have unique identifiers, adding new sockets always
437    * will increase this counter.
438    */
439   int cur_index;
440   int flag;
441   /** Update flags. */
442   int update;
443   /** Flag to prevent re-entrant update calls. */
444   short is_updating;
445   /** Generic temporary flag for recursion check (DFS/BFS). */
446   short done;
447   char _pad2[4];
448 
449   /** Specific node type this tree is used for. */
450   int nodetype DNA_DEPRECATED;
451 
452   /** Quality setting when editing. */
453   short edit_quality;
454   /** Quality setting when rendering. */
455   short render_quality;
456   /** Tile size for compositor engine. */
457   int chunksize;
458 
459   rctf viewer_border;
460 
461   /* Lists of bNodeSocket to hold default values and own_index.
462    * Warning! Don't make links to these sockets, input/output nodes are used for that.
463    * These sockets are used only for generating external interfaces.
464    */
465   ListBase inputs, outputs;
466 
467   /* Node preview hash table
468    * Only available in base node trees (e.g. scene->node_tree)
469    */
470   struct bNodeInstanceHash *previews;
471   /* Defines the node tree instance to use for the "active" context,
472    * in case multiple different editors are used and make context ambiguous.
473    */
474   bNodeInstanceKey active_viewer_key;
475   char _pad[4];
476 
477   /** Execution data.
478    *
479    * XXX It would be preferable to completely move this data out of the underlying node tree,
480    * so node tree execution could finally run independent of the tree itself.
481    * This would allow node trees to be merely linked by other data (materials, textures, etc.),
482    * as ID data is supposed to.
483    * Execution data is generated from the tree once at execution start and can then be used
484    * as long as necessary, even while the tree is being modified.
485    */
486   struct bNodeTreeExec *execdata;
487 
488   /* callbacks */
489   void (*progress)(void *, float progress);
490   /** \warning may be called by different threads */
491   void (*stats_draw)(void *, const char *str);
492   int (*test_break)(void *);
493   void (*update_draw)(void *);
494   void *tbh, *prh, *sdh, *udh;
495 } bNodeTree;
496 
497 /* ntree->type, index */
498 #define NTREE_CUSTOM -1 /* for dynamically registered custom types */
499 #define NTREE_SHADER 0
500 #define NTREE_COMPOSIT 1
501 #define NTREE_TEXTURE 2
502 #define NTREE_SIMULATION 3
503 
504 /* ntree->init, flag */
505 #define NTREE_TYPE_INIT 1
506 
507 /* ntree->flag */
508 #define NTREE_DS_EXPAND (1 << 0)            /* for animation editors */
509 #define NTREE_COM_OPENCL (1 << 1)           /* use opencl */
510 #define NTREE_TWO_PASS (1 << 2)             /* two pass */
511 #define NTREE_COM_GROUPNODE_BUFFER (1 << 3) /* use groupnode buffers */
512 #define NTREE_VIEWER_BORDER (1 << 4)        /* use a border for viewer nodes */
513 /* NOTE: DEPRECATED, use (id->tag & LIB_TAG_LOCALIZED) instead. */
514 
515 /* tree is localized copy, free when deleting node groups */
516 /* #define NTREE_IS_LOCALIZED           (1 << 5) */
517 
518 /* ntree->update */
519 typedef enum eNodeTreeUpdate {
520   NTREE_UPDATE = 0xFFFF,             /* generic update flag (includes all others) */
521   NTREE_UPDATE_LINKS = (1 << 0),     /* links have been added or removed */
522   NTREE_UPDATE_NODES = (1 << 1),     /* nodes or sockets have been added or removed */
523   NTREE_UPDATE_GROUP_IN = (1 << 4),  /* group inputs have changed */
524   NTREE_UPDATE_GROUP_OUT = (1 << 5), /* group outputs have changed */
525   /* group has changed (generic flag including all other group flags) */
526   NTREE_UPDATE_GROUP = (NTREE_UPDATE_GROUP_IN | NTREE_UPDATE_GROUP_OUT),
527 } eNodeTreeUpdate;
528 
529 /* socket value structs for input buttons
530  * DEPRECATED now using ID properties
531  */
532 
533 typedef struct bNodeSocketValueInt {
534   /** RNA subtype. */
535   int subtype;
536   int value;
537   int min, max;
538 } bNodeSocketValueInt;
539 
540 typedef struct bNodeSocketValueFloat {
541   /** RNA subtype. */
542   int subtype;
543   float value;
544   float min, max;
545 } bNodeSocketValueFloat;
546 
547 typedef struct bNodeSocketValueBoolean {
548   char value;
549   char _pad[3];
550 } bNodeSocketValueBoolean;
551 
552 typedef struct bNodeSocketValueVector {
553   /** RNA subtype. */
554   int subtype;
555   float value[3];
556   float min, max;
557 } bNodeSocketValueVector;
558 
559 typedef struct bNodeSocketValueRGBA {
560   float value[4];
561 } bNodeSocketValueRGBA;
562 
563 typedef struct bNodeSocketValueString {
564   int subtype;
565   char _pad[4];
566   /** 1024 = FILEMAX. */
567   char value[1024];
568 } bNodeSocketValueString;
569 
570 typedef struct bNodeSocketValueObject {
571   struct Object *value;
572 } bNodeSocketValueObject;
573 
574 typedef struct bNodeSocketValueImage {
575   struct Image *value;
576 } bNodeSocketValueImage;
577 
578 /* data structs, for node->storage */
579 enum {
580   CMP_NODE_MASKTYPE_ADD = 0,
581   CMP_NODE_MASKTYPE_SUBTRACT = 1,
582   CMP_NODE_MASKTYPE_MULTIPLY = 2,
583   CMP_NODE_MASKTYPE_NOT = 3,
584 };
585 
586 enum {
587   CMP_NODE_DILATEERODE_STEP = 0,
588   CMP_NODE_DILATEERODE_DISTANCE_THRESH = 1,
589   CMP_NODE_DILATEERODE_DISTANCE = 2,
590   CMP_NODE_DILATEERODE_DISTANCE_FEATHER = 3,
591 };
592 
593 enum {
594   CMP_NODE_INPAINT_SIMPLE = 0,
595 };
596 
597 enum {
598   /* CMP_NODEFLAG_MASK_AA          = (1 << 0), */ /* DEPRECATED */
599   CMP_NODEFLAG_MASK_NO_FEATHER = (1 << 1),
600   CMP_NODEFLAG_MASK_MOTION_BLUR = (1 << 2),
601 
602   /* we may want multiple aspect options, exposed as an rna enum */
603   CMP_NODEFLAG_MASK_FIXED = (1 << 8),
604   CMP_NODEFLAG_MASK_FIXED_SCENE = (1 << 9),
605 };
606 
607 enum {
608   CMP_NODEFLAG_BLUR_VARIABLE_SIZE = (1 << 0),
609   CMP_NODEFLAG_BLUR_EXTEND_BOUNDS = (1 << 1),
610 };
611 
612 typedef struct NodeFrame {
613   short flag;
614   short label_size;
615 } NodeFrame;
616 
617 /* this one has been replaced with ImageUser, keep it for do_versions() */
618 typedef struct NodeImageAnim {
619   int frames DNA_DEPRECATED;
620   int sfra DNA_DEPRECATED;
621   int nr DNA_DEPRECATED;
622   char cyclic DNA_DEPRECATED;
623   char movie DNA_DEPRECATED;
624   char _pad[2];
625 } NodeImageAnim;
626 
627 typedef struct ColorCorrectionData {
628   float saturation;
629   float contrast;
630   float gamma;
631   float gain;
632   float lift;
633   char _pad[4];
634 } ColorCorrectionData;
635 
636 typedef struct NodeColorCorrection {
637   ColorCorrectionData master;
638   ColorCorrectionData shadows;
639   ColorCorrectionData midtones;
640   ColorCorrectionData highlights;
641   float startmidtones;
642   float endmidtones;
643 } NodeColorCorrection;
644 
645 typedef struct NodeBokehImage {
646   float angle;
647   int flaps;
648   float rounding;
649   float catadioptric;
650   float lensshift;
651 } NodeBokehImage;
652 
653 typedef struct NodeBoxMask {
654   float x;
655   float y;
656   float rotation;
657   float height;
658   float width;
659   char _pad[4];
660 } NodeBoxMask;
661 
662 typedef struct NodeEllipseMask {
663   float x;
664   float y;
665   float rotation;
666   float height;
667   float width;
668   char _pad[4];
669 } NodeEllipseMask;
670 
671 /* layer info for image node outputs */
672 typedef struct NodeImageLayer {
673   /* index in the Image->layers->passes lists */
674   int pass_index DNA_DEPRECATED;
675   /* render pass name */
676   /** Amount defined in openexr_multi.h. */
677   char pass_name[64];
678 } NodeImageLayer;
679 
680 typedef struct NodeBlurData {
681   short sizex, sizey;
682   short samples, maxspeed, minspeed, relative, aspect;
683   short curved;
684   float fac, percentx, percenty;
685   short filtertype;
686   char bokeh, gamma;
687   /** Needed for absolute/relative conversions. */
688   int image_in_width, image_in_height;
689 } NodeBlurData;
690 
691 typedef struct NodeDBlurData {
692   float center_x, center_y, distance, angle, spin, zoom;
693   short iter;
694   char wrap, _pad;
695 } NodeDBlurData;
696 
697 typedef struct NodeBilateralBlurData {
698   float sigma_color, sigma_space;
699   short iter;
700   char _pad[2];
701 } NodeBilateralBlurData;
702 
703 /* NOTE: Only for do-version code. */
704 typedef struct NodeHueSat {
705   float hue, sat, val;
706 } NodeHueSat;
707 
708 typedef struct NodeImageFile {
709   /** 1024 = FILE_MAX. */
710   char name[1024];
711   struct ImageFormatData im_format;
712   int sfra, efra;
713 } NodeImageFile;
714 
715 /* XXX first struct fields should match NodeImageFile to ensure forward compatibility */
716 typedef struct NodeImageMultiFile {
717   /** 1024 = FILE_MAX. */
718   char base_path[1024];
719   ImageFormatData format;
720   /** XXX old frame rand values from NodeImageFile for forward compatibility. */
721   int sfra DNA_DEPRECATED, efra DNA_DEPRECATED;
722   /** Selected input in details view list. */
723   int active_input;
724   char _pad[4];
725 } NodeImageMultiFile;
726 typedef struct NodeImageMultiFileSocket {
727   /* single layer file output */
728   short use_render_format DNA_DEPRECATED;
729   /** Use overall node image format. */
730   short use_node_format;
731   char _pad1[4];
732   /** 1024 = FILE_MAX. */
733   char path[1024];
734   ImageFormatData format;
735 
736   /* multilayer output */
737   /** EXR_TOT_MAXNAME-2 ('.' and channel char are appended). */
738   char layer[30];
739   char _pad2[2];
740 } NodeImageMultiFileSocket;
741 
742 typedef struct NodeChroma {
743   float t1, t2, t3;
744   float fsize, fstrength, falpha;
745   float key[4];
746   short algorithm, channel;
747 } NodeChroma;
748 
749 typedef struct NodeTwoXYs {
750   short x1, x2, y1, y2;
751   float fac_x1, fac_x2, fac_y1, fac_y2;
752 } NodeTwoXYs;
753 
754 typedef struct NodeTwoFloats {
755   float x, y;
756 } NodeTwoFloats;
757 
758 typedef struct NodeVertexCol {
759   char name[64];
760 } NodeVertexCol;
761 
762 /* qdn: Defocus blur node */
763 typedef struct NodeDefocus {
764   char bktype, _pad0, preview, gamco;
765   short samples, no_zbuf;
766   float fstop, maxblur, bthresh, scale;
767   float rotation;
768   char _pad1[4];
769 } NodeDefocus;
770 
771 typedef struct NodeScriptDict {
772   /** For PyObject *dict. */
773   void *dict;
774   /** For BPy_Node *node. */
775   void *node;
776 } NodeScriptDict;
777 
778 /* qdn: glare node */
779 typedef struct NodeGlare {
780   char quality, type, iter;
781   /* XXX angle is only kept for backward/forward compatibility,
782    * was used for two different things, see T50736. */
783   char angle DNA_DEPRECATED, _pad0, size, star_45, streaks;
784   float colmod, mix, threshold, fade;
785   float angle_ofs;
786   char _pad1[4];
787 } NodeGlare;
788 
789 /* qdn: tonemap node */
790 typedef struct NodeTonemap {
791   float key, offset, gamma;
792   float f, m, a, c;
793   int type;
794 } NodeTonemap;
795 
796 /* qdn: lens distortion node */
797 typedef struct NodeLensDist {
798   short jit, proj, fit;
799   char _pad[2];
800 } NodeLensDist;
801 
802 typedef struct NodeColorBalance {
803   /* ASC CDL parameters */
804   float slope[3];
805   float offset[3];
806   float power[3];
807   float offset_basis;
808   char _pad[4];
809 
810   /* LGG parameters */
811   float lift[3];
812   float gamma[3];
813   float gain[3];
814 } NodeColorBalance;
815 
816 typedef struct NodeColorspill {
817   short limchan, unspill;
818   float limscale;
819   float uspillr, uspillg, uspillb;
820 } NodeColorspill;
821 
822 typedef struct NodeDilateErode {
823   char falloff;
824   char _pad[7];
825 } NodeDilateErode;
826 
827 typedef struct NodeMask {
828   int size_x, size_y;
829 } NodeMask;
830 
831 typedef struct NodeTexBase {
832   TexMapping tex_mapping;
833   ColorMapping color_mapping;
834 } NodeTexBase;
835 
836 typedef struct NodeTexSky {
837   NodeTexBase base;
838   int sky_model;
839   float sun_direction[3];
840   float turbidity;
841   float ground_albedo;
842   float sun_size;
843   float sun_intensity;
844   float sun_elevation;
845   float sun_rotation;
846   float altitude;
847   float air_density;
848   float dust_density;
849   float ozone_density;
850   char sun_disc;
851   char _pad[7];
852 } NodeTexSky;
853 
854 typedef struct NodeTexImage {
855   NodeTexBase base;
856   ImageUser iuser;
857   int color_space DNA_DEPRECATED;
858   int projection;
859   float projection_blend;
860   int interpolation;
861   int extension;
862   char _pad[4];
863 } NodeTexImage;
864 
865 typedef struct NodeTexChecker {
866   NodeTexBase base;
867 } NodeTexChecker;
868 
869 typedef struct NodeTexBrick {
870   NodeTexBase base;
871   int offset_freq, squash_freq;
872   float offset, squash;
873 } NodeTexBrick;
874 
875 typedef struct NodeTexEnvironment {
876   NodeTexBase base;
877   ImageUser iuser;
878   int color_space DNA_DEPRECATED;
879   int projection;
880   int interpolation;
881   char _pad[4];
882 } NodeTexEnvironment;
883 
884 typedef struct NodeTexGradient {
885   NodeTexBase base;
886   int gradient_type;
887   char _pad[4];
888 } NodeTexGradient;
889 
890 typedef struct NodeTexNoise {
891   NodeTexBase base;
892   int dimensions;
893   char _pad[4];
894 } NodeTexNoise;
895 
896 typedef struct NodeTexVoronoi {
897   NodeTexBase base;
898   int dimensions;
899   int feature;
900   int distance;
901   int coloring DNA_DEPRECATED;
902 } NodeTexVoronoi;
903 
904 typedef struct NodeTexMusgrave {
905   NodeTexBase base;
906   int musgrave_type;
907   int dimensions;
908 } NodeTexMusgrave;
909 
910 typedef struct NodeTexWave {
911   NodeTexBase base;
912   int wave_type;
913   int bands_direction;
914   int rings_direction;
915   int wave_profile;
916 } NodeTexWave;
917 
918 typedef struct NodeTexMagic {
919   NodeTexBase base;
920   int depth;
921   char _pad[4];
922 } NodeTexMagic;
923 
924 typedef struct NodeShaderAttribute {
925   char name[64];
926 } NodeShaderAttribute;
927 
928 typedef struct NodeShaderVectTransform {
929   int type;
930   int convert_from, convert_to;
931   char _pad[4];
932 } NodeShaderVectTransform;
933 
934 typedef struct NodeShaderTexPointDensity {
935   NodeTexBase base;
936   short point_source;
937   char _pad[2];
938   int particle_system;
939   float radius;
940   int resolution;
941   short space;
942   short interpolation;
943   short color_source;
944   short ob_color_source;
945   /** Vertex attribute layer for color source, MAX_CUSTOMDATA_LAYER_NAME. */
946   char vertex_attribute_name[64];
947   /* Used at runtime only by sampling RNA API. */
948   PointDensity pd;
949   int cached_resolution;
950   char _pad2[4];
951 } NodeShaderTexPointDensity;
952 
953 /* TEX_output */
954 typedef struct TexNodeOutput {
955   char name[64];
956 } TexNodeOutput;
957 
958 typedef struct NodeKeyingScreenData {
959   char tracking_object[64];
960 } NodeKeyingScreenData;
961 
962 typedef struct NodeKeyingData {
963   float screen_balance;
964   float despill_factor;
965   float despill_balance;
966   int edge_kernel_radius;
967   float edge_kernel_tolerance;
968   float clip_black, clip_white;
969   int dilate_distance;
970   int feather_distance;
971   int feather_falloff;
972   int blur_pre, blur_post;
973 } NodeKeyingData;
974 
975 typedef struct NodeTrackPosData {
976   char tracking_object[64];
977   char track_name[64];
978 } NodeTrackPosData;
979 
980 typedef struct NodeTranslateData {
981   char wrap_axis;
982   char relative;
983   char _pad[6];
984 } NodeTranslateData;
985 
986 typedef struct NodePlaneTrackDeformData {
987   char tracking_object[64];
988   char plane_track_name[64];
989   char flag;
990   char motion_blur_samples;
991   char _pad[2];
992   float motion_blur_shutter;
993 } NodePlaneTrackDeformData;
994 
995 typedef struct NodeShaderScript {
996   int mode;
997   int flag;
998 
999   /** 1024 = FILE_MAX. */
1000   char filepath[1024];
1001 
1002   char bytecode_hash[64];
1003   char *bytecode;
1004 } NodeShaderScript;
1005 
1006 typedef struct NodeShaderTangent {
1007   int direction_type;
1008   int axis;
1009   char uv_map[64];
1010 } NodeShaderTangent;
1011 
1012 typedef struct NodeShaderNormalMap {
1013   int space;
1014   char uv_map[64];
1015 } NodeShaderNormalMap;
1016 
1017 typedef struct NodeShaderUVMap {
1018   char uv_map[64];
1019 } NodeShaderUVMap;
1020 
1021 typedef struct NodeShaderVertexColor {
1022   char layer_name[64];
1023 } NodeShaderVertexColor;
1024 
1025 typedef struct NodeShaderTexIES {
1026   int mode;
1027 
1028   /** 1024 = FILE_MAX. */
1029   char filepath[1024];
1030 } NodeShaderTexIES;
1031 
1032 typedef struct NodeShaderOutputAOV {
1033   char name[64];
1034 } NodeShaderOutputAOV;
1035 
1036 typedef struct NodeSunBeams {
1037   float source[2];
1038 
1039   float ray_length;
1040 } NodeSunBeams;
1041 
1042 typedef struct NodeCryptomatte {
1043   float add[3];
1044   float remove[3];
1045   char *matte_id;
1046   int num_inputs;
1047   char _pad[4];
1048 } NodeCryptomatte;
1049 
1050 typedef struct NodeDenoise {
1051   char hdr;
1052   char _pad[7];
1053 } NodeDenoise;
1054 
1055 /* script node mode */
1056 #define NODE_SCRIPT_INTERNAL 0
1057 #define NODE_SCRIPT_EXTERNAL 1
1058 
1059 /* script node flag */
1060 #define NODE_SCRIPT_AUTO_UPDATE 1
1061 
1062 /* ies node mode */
1063 #define NODE_IES_INTERNAL 0
1064 #define NODE_IES_EXTERNAL 1
1065 
1066 /* frame node flags */
1067 #define NODE_FRAME_SHRINK 1     /* keep the bounding box minimal */
1068 #define NODE_FRAME_RESIZEABLE 2 /* test flag, if frame can be resized by user */
1069 
1070 /* proxy node flags */
1071 #define NODE_PROXY_AUTOTYPE 1 /* automatically change output type based on link */
1072 
1073 /* comp channel matte */
1074 #define CMP_NODE_CHANNEL_MATTE_CS_RGB 1
1075 #define CMP_NODE_CHANNEL_MATTE_CS_HSV 2
1076 #define CMP_NODE_CHANNEL_MATTE_CS_YUV 3
1077 #define CMP_NODE_CHANNEL_MATTE_CS_YCC 4
1078 
1079 /* glossy distributions */
1080 #define SHD_GLOSSY_BECKMANN 0
1081 #define SHD_GLOSSY_SHARP 1
1082 #define SHD_GLOSSY_GGX 2
1083 #define SHD_GLOSSY_ASHIKHMIN_SHIRLEY 3
1084 #define SHD_GLOSSY_MULTI_GGX 4
1085 
1086 /* vector transform */
1087 #define SHD_VECT_TRANSFORM_TYPE_VECTOR 0
1088 #define SHD_VECT_TRANSFORM_TYPE_POINT 1
1089 #define SHD_VECT_TRANSFORM_TYPE_NORMAL 2
1090 
1091 #define SHD_VECT_TRANSFORM_SPACE_WORLD 0
1092 #define SHD_VECT_TRANSFORM_SPACE_OBJECT 1
1093 #define SHD_VECT_TRANSFORM_SPACE_CAMERA 2
1094 
1095 /* toon modes */
1096 #define SHD_TOON_DIFFUSE 0
1097 #define SHD_TOON_GLOSSY 1
1098 
1099 /* hair components */
1100 #define SHD_HAIR_REFLECTION 0
1101 #define SHD_HAIR_TRANSMISSION 1
1102 
1103 /* principled hair parametrization */
1104 #define SHD_PRINCIPLED_HAIR_REFLECTANCE 0
1105 #define SHD_PRINCIPLED_HAIR_PIGMENT_CONCENTRATION 1
1106 #define SHD_PRINCIPLED_HAIR_DIRECT_ABSORPTION 2
1107 
1108 /* blend texture */
1109 #define SHD_BLEND_LINEAR 0
1110 #define SHD_BLEND_QUADRATIC 1
1111 #define SHD_BLEND_EASING 2
1112 #define SHD_BLEND_DIAGONAL 3
1113 #define SHD_BLEND_RADIAL 4
1114 #define SHD_BLEND_QUADRATIC_SPHERE 5
1115 #define SHD_BLEND_SPHERICAL 6
1116 
1117 /* noise basis for textures */
1118 #define SHD_NOISE_PERLIN 0
1119 #define SHD_NOISE_VORONOI_F1 1
1120 #define SHD_NOISE_VORONOI_F2 2
1121 #define SHD_NOISE_VORONOI_F3 3
1122 #define SHD_NOISE_VORONOI_F4 4
1123 #define SHD_NOISE_VORONOI_F2_F1 5
1124 #define SHD_NOISE_VORONOI_CRACKLE 6
1125 #define SHD_NOISE_CELL_NOISE 7
1126 
1127 #define SHD_NOISE_SOFT 0
1128 #define SHD_NOISE_HARD 1
1129 
1130 /* Voronoi Texture */
1131 
1132 enum {
1133   SHD_VORONOI_EUCLIDEAN = 0,
1134   SHD_VORONOI_MANHATTAN = 1,
1135   SHD_VORONOI_CHEBYCHEV = 2,
1136   SHD_VORONOI_MINKOWSKI = 3,
1137 };
1138 
1139 enum {
1140   SHD_VORONOI_F1 = 0,
1141   SHD_VORONOI_F2 = 1,
1142   SHD_VORONOI_SMOOTH_F1 = 2,
1143   SHD_VORONOI_DISTANCE_TO_EDGE = 3,
1144   SHD_VORONOI_N_SPHERE_RADIUS = 4,
1145 };
1146 
1147 /* musgrave texture */
1148 #define SHD_MUSGRAVE_MULTIFRACTAL 0
1149 #define SHD_MUSGRAVE_FBM 1
1150 #define SHD_MUSGRAVE_HYBRID_MULTIFRACTAL 2
1151 #define SHD_MUSGRAVE_RIDGED_MULTIFRACTAL 3
1152 #define SHD_MUSGRAVE_HETERO_TERRAIN 4
1153 
1154 /* wave texture */
1155 #define SHD_WAVE_BANDS 0
1156 #define SHD_WAVE_RINGS 1
1157 
1158 enum {
1159   SHD_WAVE_BANDS_DIRECTION_X = 0,
1160   SHD_WAVE_BANDS_DIRECTION_Y = 1,
1161   SHD_WAVE_BANDS_DIRECTION_Z = 2,
1162   SHD_WAVE_BANDS_DIRECTION_DIAGONAL = 3,
1163 };
1164 
1165 enum {
1166   SHD_WAVE_RINGS_DIRECTION_X = 0,
1167   SHD_WAVE_RINGS_DIRECTION_Y = 1,
1168   SHD_WAVE_RINGS_DIRECTION_Z = 2,
1169   SHD_WAVE_RINGS_DIRECTION_SPHERICAL = 3,
1170 };
1171 
1172 enum {
1173   SHD_WAVE_PROFILE_SIN = 0,
1174   SHD_WAVE_PROFILE_SAW = 1,
1175   SHD_WAVE_PROFILE_TRI = 2,
1176 };
1177 
1178 /* sky texture */
1179 #define SHD_SKY_PREETHAM 0
1180 #define SHD_SKY_HOSEK 1
1181 #define SHD_SKY_NISHITA 2
1182 
1183 /* environment texture */
1184 #define SHD_PROJ_EQUIRECTANGULAR 0
1185 #define SHD_PROJ_MIRROR_BALL 1
1186 
1187 #define SHD_IMAGE_EXTENSION_REPEAT 0
1188 #define SHD_IMAGE_EXTENSION_EXTEND 1
1189 #define SHD_IMAGE_EXTENSION_CLIP 2
1190 
1191 /* image texture */
1192 #define SHD_PROJ_FLAT 0
1193 #define SHD_PROJ_BOX 1
1194 #define SHD_PROJ_SPHERE 2
1195 #define SHD_PROJ_TUBE 3
1196 
1197 /* image texture interpolation */
1198 #define SHD_INTERP_LINEAR 0
1199 #define SHD_INTERP_CLOSEST 1
1200 #define SHD_INTERP_CUBIC 2
1201 #define SHD_INTERP_SMART 3
1202 
1203 /* tangent */
1204 #define SHD_TANGENT_RADIAL 0
1205 #define SHD_TANGENT_UVMAP 1
1206 
1207 /* tangent */
1208 #define SHD_TANGENT_AXIS_X 0
1209 #define SHD_TANGENT_AXIS_Y 1
1210 #define SHD_TANGENT_AXIS_Z 2
1211 
1212 /* normal map, displacement space */
1213 #define SHD_SPACE_TANGENT 0
1214 #define SHD_SPACE_OBJECT 1
1215 #define SHD_SPACE_WORLD 2
1216 #define SHD_SPACE_BLENDER_OBJECT 3
1217 #define SHD_SPACE_BLENDER_WORLD 4
1218 
1219 #define SHD_AO_INSIDE 1
1220 #define SHD_AO_LOCAL 2
1221 
1222 /* Mapping node vector types */
1223 enum {
1224   NODE_MAPPING_TYPE_POINT = 0,
1225   NODE_MAPPING_TYPE_TEXTURE = 1,
1226   NODE_MAPPING_TYPE_VECTOR = 2,
1227   NODE_MAPPING_TYPE_NORMAL = 3,
1228 };
1229 
1230 /* Rotation node vector types */
1231 enum {
1232   NODE_VECTOR_ROTATE_TYPE_AXIS = 0,
1233   NODE_VECTOR_ROTATE_TYPE_AXIS_X = 1,
1234   NODE_VECTOR_ROTATE_TYPE_AXIS_Y = 2,
1235   NODE_VECTOR_ROTATE_TYPE_AXIS_Z = 3,
1236   NODE_VECTOR_ROTATE_TYPE_EULER_XYZ = 4,
1237 };
1238 
1239 /* math node clamp */
1240 #define SHD_MATH_CLAMP 1
1241 
1242 /* Math node operations. */
1243 enum {
1244   NODE_MATH_ADD = 0,
1245   NODE_MATH_SUBTRACT = 1,
1246   NODE_MATH_MULTIPLY = 2,
1247   NODE_MATH_DIVIDE = 3,
1248   NODE_MATH_SINE = 4,
1249   NODE_MATH_COSINE = 5,
1250   NODE_MATH_TANGENT = 6,
1251   NODE_MATH_ARCSINE = 7,
1252   NODE_MATH_ARCCOSINE = 8,
1253   NODE_MATH_ARCTANGENT = 9,
1254   NODE_MATH_POWER = 10,
1255   NODE_MATH_LOGARITHM = 11,
1256   NODE_MATH_MINIMUM = 12,
1257   NODE_MATH_MAXIMUM = 13,
1258   NODE_MATH_ROUND = 14,
1259   NODE_MATH_LESS_THAN = 15,
1260   NODE_MATH_GREATER_THAN = 16,
1261   NODE_MATH_MODULO = 17,
1262   NODE_MATH_ABSOLUTE = 18,
1263   NODE_MATH_ARCTAN2 = 19,
1264   NODE_MATH_FLOOR = 20,
1265   NODE_MATH_CEIL = 21,
1266   NODE_MATH_FRACTION = 22,
1267   NODE_MATH_SQRT = 23,
1268   NODE_MATH_INV_SQRT = 24,
1269   NODE_MATH_SIGN = 25,
1270   NODE_MATH_EXPONENT = 26,
1271   NODE_MATH_RADIANS = 27,
1272   NODE_MATH_DEGREES = 28,
1273   NODE_MATH_SINH = 29,
1274   NODE_MATH_COSH = 30,
1275   NODE_MATH_TANH = 31,
1276   NODE_MATH_TRUNC = 32,
1277   NODE_MATH_SNAP = 33,
1278   NODE_MATH_WRAP = 34,
1279   NODE_MATH_COMPARE = 35,
1280   NODE_MATH_MULTIPLY_ADD = 36,
1281   NODE_MATH_PINGPONG = 37,
1282   NODE_MATH_SMOOTH_MIN = 38,
1283   NODE_MATH_SMOOTH_MAX = 39,
1284 };
1285 
1286 /* Vector Math node operations. */
1287 enum {
1288   NODE_VECTOR_MATH_ADD = 0,
1289   NODE_VECTOR_MATH_SUBTRACT = 1,
1290   NODE_VECTOR_MATH_MULTIPLY = 2,
1291   NODE_VECTOR_MATH_DIVIDE = 3,
1292 
1293   NODE_VECTOR_MATH_CROSS_PRODUCT = 4,
1294   NODE_VECTOR_MATH_PROJECT = 5,
1295   NODE_VECTOR_MATH_REFLECT = 6,
1296   NODE_VECTOR_MATH_DOT_PRODUCT = 7,
1297 
1298   NODE_VECTOR_MATH_DISTANCE = 8,
1299   NODE_VECTOR_MATH_LENGTH = 9,
1300   NODE_VECTOR_MATH_SCALE = 10,
1301   NODE_VECTOR_MATH_NORMALIZE = 11,
1302 
1303   NODE_VECTOR_MATH_SNAP = 12,
1304   NODE_VECTOR_MATH_FLOOR = 13,
1305   NODE_VECTOR_MATH_CEIL = 14,
1306   NODE_VECTOR_MATH_MODULO = 15,
1307   NODE_VECTOR_MATH_FRACTION = 16,
1308   NODE_VECTOR_MATH_ABSOLUTE = 17,
1309   NODE_VECTOR_MATH_MINIMUM = 18,
1310   NODE_VECTOR_MATH_MAXIMUM = 19,
1311   NODE_VECTOR_MATH_WRAP = 20,
1312   NODE_VECTOR_MATH_SINE = 21,
1313   NODE_VECTOR_MATH_COSINE = 22,
1314   NODE_VECTOR_MATH_TANGENT = 23,
1315 };
1316 
1317 /* Boolean math node operations. */
1318 enum {
1319   NODE_BOOLEAN_MATH_AND = 0,
1320   NODE_BOOLEAN_MATH_OR = 1,
1321   NODE_BOOLEAN_MATH_NOT = 2,
1322 };
1323 
1324 /* Float compare node operations. */
1325 enum {
1326   NODE_FLOAT_COMPARE_LESS_THAN = 0,
1327   NODE_FLOAT_COMPARE_LESS_EQUAL = 1,
1328   NODE_FLOAT_COMPARE_GREATER_THAN = 2,
1329   NODE_FLOAT_COMPARE_GREATER_EQUAL = 3,
1330   NODE_FLOAT_COMPARE_EQUAL = 4,
1331   NODE_FLOAT_COMPARE_NOT_EQUAL = 5,
1332 };
1333 
1334 /* Clamp node types. */
1335 enum {
1336   NODE_CLAMP_MINMAX = 0,
1337   NODE_CLAMP_RANGE = 1,
1338 };
1339 
1340 /* Map range node types. */
1341 enum {
1342   NODE_MAP_RANGE_LINEAR = 0,
1343   NODE_MAP_RANGE_STEPPED = 1,
1344   NODE_MAP_RANGE_SMOOTHSTEP = 2,
1345   NODE_MAP_RANGE_SMOOTHERSTEP = 3,
1346 };
1347 
1348 /* mix rgb node flags */
1349 #define SHD_MIXRGB_USE_ALPHA 1
1350 #define SHD_MIXRGB_CLAMP 2
1351 
1352 /* subsurface */
1353 enum {
1354 #ifdef DNA_DEPRECATED_ALLOW
1355   SHD_SUBSURFACE_COMPATIBLE = 0, /* Deprecated */
1356 #endif
1357   SHD_SUBSURFACE_CUBIC = 1,
1358   SHD_SUBSURFACE_GAUSSIAN = 2,
1359   SHD_SUBSURFACE_BURLEY = 3,
1360   SHD_SUBSURFACE_RANDOM_WALK = 4,
1361 };
1362 
1363 /* blur node */
1364 #define CMP_NODE_BLUR_ASPECT_NONE 0
1365 #define CMP_NODE_BLUR_ASPECT_Y 1
1366 #define CMP_NODE_BLUR_ASPECT_X 2
1367 
1368 /* wrapping */
1369 #define CMP_NODE_WRAP_NONE 0
1370 #define CMP_NODE_WRAP_X 1
1371 #define CMP_NODE_WRAP_Y 2
1372 #define CMP_NODE_WRAP_XY 3
1373 
1374 #define CMP_NODE_MASK_MBLUR_SAMPLES_MAX 64
1375 
1376 /* image */
1377 #define CMP_NODE_IMAGE_USE_STRAIGHT_OUTPUT 1
1378 
1379 /* viewer and cmposite output */
1380 #define CMP_NODE_OUTPUT_IGNORE_ALPHA 1
1381 
1382 /* Plane track deform node */
1383 enum {
1384   CMP_NODEFLAG_PLANETRACKDEFORM_MOTION_BLUR = 1,
1385 };
1386 
1387 /* Stabilization node */
1388 enum {
1389   CMP_NODEFLAG_STABILIZE_INVERSE = 1,
1390 };
1391 
1392 #define CMP_NODE_PLANETRACKDEFORM_MBLUR_SAMPLES_MAX 64
1393 
1394 /* Point Density shader node */
1395 
1396 enum {
1397   SHD_POINTDENSITY_SOURCE_PSYS = 0,
1398   SHD_POINTDENSITY_SOURCE_OBJECT = 1,
1399 };
1400 
1401 enum {
1402   SHD_POINTDENSITY_SPACE_OBJECT = 0,
1403   SHD_POINTDENSITY_SPACE_WORLD = 1,
1404 };
1405 
1406 enum {
1407   SHD_POINTDENSITY_COLOR_PARTAGE = 1,
1408   SHD_POINTDENSITY_COLOR_PARTSPEED = 2,
1409   SHD_POINTDENSITY_COLOR_PARTVEL = 3,
1410 };
1411 
1412 enum {
1413   SHD_POINTDENSITY_COLOR_VERTCOL = 0,
1414   SHD_POINTDENSITY_COLOR_VERTWEIGHT = 1,
1415   SHD_POINTDENSITY_COLOR_VERTNOR = 2,
1416 };
1417 
1418 /* Output shader node */
1419 
1420 typedef enum NodeShaderOutputTarget {
1421   SHD_OUTPUT_ALL = 0,
1422   SHD_OUTPUT_EEVEE = 1,
1423   SHD_OUTPUT_CYCLES = 2,
1424 } NodeShaderOutputTarget;
1425 
1426 /* Particle Time Step Event node */
1427 typedef enum NodeSimParticleTimeStepEventType {
1428   NODE_PARTICLE_TIME_STEP_EVENT_BEGIN = 0,
1429   NODE_PARTICLE_TIME_STEP_EVENT_END = 1,
1430 } NodeSimParticleTimeStepEventType;
1431 
1432 /* Simulation Time node */
1433 typedef enum NodeSimInputTimeType {
1434   NODE_SIM_INPUT_SIMULATION_TIME = 0,
1435   NODE_SIM_INPUT_SCENE_TIME = 1,
1436 } NodeSimInputTimeType;
1437