4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
21 * All rights reserved.
23 * The Original Code is: all of this file.
25 * Contributor(s): none yet.
27 * ***** END GPL LICENSE BLOCK *****
29 #ifndef DNA_SCENE_TYPES_H
30 #define DNA_SCENE_TYPES_H
36 #include "DNA_vec_types.h"
37 #include "DNA_listBase.h"
38 #include "DNA_scriptlink_types.h"
40 #include "DNA_scriptlink_types.h"
51 struct Base *next, *prev;
52 unsigned int lay, selcol;
55 struct Object *object;
58 typedef struct AviCodecData {
59 void *lpFormat; /* save format */
60 void *lpParms; /* compressor options */
61 unsigned int cbFormat; /* size of lpFormat buffer */
62 unsigned int cbParms; /* size of lpParms buffer */
64 unsigned int fccType; /* stream type, for consistency */
65 unsigned int fccHandler; /* compressor */
66 unsigned int dwKeyFrameEvery; /* keyframe rate */
67 unsigned int dwQuality; /* compress quality 0-10,000 */
68 unsigned int dwBytesPerSecond; /* bytes per second */
69 unsigned int dwFlags; /* flags... see below */
70 unsigned int dwInterleaveEvery; /* for non-video streams only */
73 char avicodecname[128];
76 typedef struct QuicktimeCodecData {
78 void *cdParms; /* codec/compressor options */
79 void *pad; /* padding */
81 unsigned int cdSize; /* size of cdParms buffer */
82 unsigned int pad2; /* padding */
84 char qtcodecname[128];
87 typedef struct FFMpegCodecData {
101 IDProperty *properties;
105 typedef struct AudioData {
107 float main; /* Main mix in dB */
112 typedef struct SceneRenderLayer {
113 struct SceneRenderLayer *next, *prev;
117 struct Material *mat_override;
118 struct Group *light_override;
120 unsigned int lay; /* scene->lay itself has priority over this */
121 unsigned int lay_zmask; /* has to be after lay, this is for Z-masking */
126 int passflag; /* pass_xor has to be after passflag */
131 #define SCE_LAY_SOLID 1
132 #define SCE_LAY_ZTRA 2
133 #define SCE_LAY_HALO 4
134 #define SCE_LAY_EDGE 8
135 #define SCE_LAY_SKY 16
136 #define SCE_LAY_STRAND 32
137 /* flags between 32 and 0x8000 are set to 1 already, for future options */
139 #define SCE_LAY_ALL_Z 0x8000
140 #define SCE_LAY_XOR 0x10000
141 #define SCE_LAY_DISABLE 0x20000
142 #define SCE_LAY_ZMASK 0x40000
143 #define SCE_LAY_NEG_ZMASK 0x80000
146 #define SCE_PASS_COMBINED 1
148 #define SCE_PASS_RGBA 4
149 #define SCE_PASS_DIFFUSE 8
150 #define SCE_PASS_SPEC 16
151 #define SCE_PASS_SHADOW 32
152 #define SCE_PASS_AO 64
153 #define SCE_PASS_REFLECT 128
154 #define SCE_PASS_NORMAL 256
155 #define SCE_PASS_VECTOR 512
156 #define SCE_PASS_REFRACT 1024
157 #define SCE_PASS_INDEXOB 2048
158 #define SCE_PASS_UV 4096
159 #define SCE_PASS_RADIO 8192
160 #define SCE_PASS_MIST 16384
162 /* note, srl->passflag is treestore element 'nr' in outliner, short still... */
165 typedef struct RenderData {
167 struct AviCodecData *avicodecdata;
168 struct QuicktimeCodecData *qtcodecdata;
169 struct FFMpegCodecData ffcodecdata;
171 int cfra, sfra, efra; /* frames as in 'images' */
172 int psfra, pefra; /* start+end frames of preview range */
174 int images, framapto;
177 float ctime; /* use for calcutions */
178 float framelen, blurfac;
180 /** For UR edge rendering: give the edges this color */
181 float edgeR, edgeG, edgeB;
183 short fullscreen, xplay, yplay, freqplay; /* standalone player */
184 short depth, attrib, rt1, rt2; /* standalone player */
186 short stereomode; /* standalone player stereo settings */
188 short dimensionspreset; /* for the dimensions presets menu */
190 short filtertype; /* filter is box, tent, gauss, mitch, etc */
192 short size, maximsize; /* size in %, max in Kb */
195 * The desired number of pixels in the x direction
199 * The desired number of pixels in the y direction
203 * The number of part to use in the x direction
207 * The number of part to use in the y direction
211 short winpos, planes, imtype, subimtype;
214 /* 0: Enable backbuffering for images */
218 short rpad, rpad1, rpad2;
221 * Flags for render settings. Use bit-masking to access the settings.
226 * Flags for render settings. Use bit-masking to access the settings.
230 /* render engine, octree resolution */
231 short renderer, ocres;
234 * What to do with the sky/background. Picks sky/premul/key
235 * blending for the background
240 * The number of samples to use per pixel.
244 short frs_sec, edgeint;
246 /* safety, border and display rect */
250 /* information on different layers to be rendered */
255 * Adjustment factors for the aspect ratio in the x direction, was a short in 2.45
259 * Adjustment factors for the aspect ratio in the x direction, was a short in 2.45
266 * Value used to define filter size for all filter options */
269 /** post-production settings. Depricated, but here for upwards compat (initialized to 1) */
270 float postmul, postgamma, posthue, postsat;
272 /* Dither noise intensity */
273 float dither_intensity;
275 /* Bake Render options */
276 short bake_osa, bake_filter, bake_mode, bake_flag;
277 short bake_normal_space, bake_quad_split;
278 float bake_maxdist, bake_biasdist, bake_pad;
280 /* yafray: global panel params. TODO: move elsewhere */
281 short GIquality, GIcache, GImethod, GIphotons, GIdirect;
282 short YF_AA, YFexportxml, YF_nobump, YF_clamprgb, yfpad1;
283 int GIdepth, GIcausdepth, GIpixelspersample;
284 int GIphotoncount, GImixphotons;
285 float GIphotonradius;
286 int YF_raydepth, YF_AApasses, YF_AAsamples, yfpad2;
287 float GIshadowquality, GIrefinement, GIpower, GIindirpower;
288 float YF_gamma, YF_exposure, YF_raybias, YF_AApixelsize, YF_AAthreshold;
290 /* paths to backbufffer, output, ftype */
291 char backbuf[160], pic[160];
295 short stamp_font_id, pad3; /* select one of blenders bitmap fonts */
297 /* stamp info user data. */
298 char stamp_udata[160];
300 /* foreground/background color. */
304 /* render simplify */
305 int simplify_subsurf;
306 int simplify_shadowsamples;
307 float simplify_particles;
308 float simplify_aosss;
311 short cineonwhite, cineonblack;
315 /* control render convert and shading engine */
316 typedef struct RenderProfile {
317 struct RenderProfile *next, *prev;
322 short shadbufsample_max;
325 float ao_error, pad2;
329 typedef struct GameFraming {
331 char type, pad1, pad2, pad3;
334 #define SCE_GAMEFRAMING_BARS 0
335 #define SCE_GAMEFRAMING_EXTEND 1
336 #define SCE_GAMEFRAMING_SCALE 2
338 typedef struct TimeMarker {
339 struct TimeMarker *next, *prev;
345 typedef struct ImagePaintSettings {
349 } ImagePaintSettings;
351 typedef struct ParticleBrushData {
352 short size, strength; /* common settings */
353 short step, invert; /* for specific brushes only */
356 typedef struct ParticleEditSettings {
362 ParticleBrushData brush[7]; /* 7 = PE_TOT_BRUSH */
366 } ParticleEditSettings;
368 typedef struct TransformOrientation {
369 struct TransformOrientation *next, *prev;
372 } TransformOrientation;
374 typedef struct ToolSettings {
375 /* Subdivide Settings */
378 /*Triangle to Quad conversion threshold*/
388 /* Primitive Settings */
393 /* Cylinder - Tube - Circle */
399 float uvcalc_cubesize;
401 short uvcalc_mapalign;
405 short autoik_chainlen;
407 /* Image Paint (8 byttse aligned please!) */
408 struct ImagePaintSettings imapaint;
410 /* Particle Editing */
411 struct ParticleEditSettings particle;
413 /* Select Group Threshold */
421 char retopo_paint_tool;
422 char line_div, ellipse_div, retopo_hotspot;
425 char multires_subdiv_type;
427 /* Skeleton generation */
428 short skgen_resolution;
429 float skgen_threshold_internal;
430 float skgen_threshold_external;
431 float skgen_length_ratio;
432 float skgen_length_limit;
433 float skgen_angle_limit;
434 float skgen_correlation_limit;
435 float skgen_symmetry_limit;
436 float skgen_retarget_angle_weight;
437 float skgen_retarget_length_weight;
438 float skgen_retarget_distance_weight;
441 char skgen_postpro_passes;
442 char skgen_subdivisions[3];
443 char skgen_multi_level;
444 char skgen_optimisation_method;
448 /* Skeleton Sketching */
450 char skgen_subdivision_number;
457 /* Used by all brushes to store their properties, which can be directly set
458 by the interface code. Note that not all properties are actually used by
460 typedef struct BrushData
463 char strength, dir; /* Not used for smooth brush */
469 struct SculptSession;
470 typedef struct SculptData
472 /* Note! all pointers in this struct must be duplicated header_info.c's copy_scene function */
474 /* Data stored only from entering sculptmode until exiting sculptmode */
475 struct SculptSession *session;
477 /* Pointers to all of sculptmodes's textures */
478 struct MTex *mtex[18];
480 /* Editable brush shape */
481 struct CurveMapping *cumap;
483 /* Settings for each brush */
484 BrushData drawbrush, smoothbrush, pinchbrush, inflatebrush, grabbrush, layerbrush, flattenbrush;
486 /* For rotating around a pivot point */
491 /* For the Brush Shape */
501 /* Control tablet input */
502 char tablet_size, tablet_strength;
504 /* Symmetry is separate from the other BrushData because the same
505 settings are always used for all brush types */
508 /* Added to store if the 'Rake' setting has been set */
514 typedef struct Scene {
516 struct Object *camera;
526 float twcent[3]; /* center for transform widget */
527 float twmin[3], twmax[3]; /* boundbox of selection for transform widget */
531 float editbutsize; /* size of normals */
532 short selectmode; /* for mesh only! */
533 short proportional, prop_mode;
534 short automerge, pad5, pad6;
536 short autokey_mode; /* mode for autokeying (defines in DNA_userdef_types.h */
540 struct bNodeTree *nodetree;
542 void *ed; /* sequence editor data is allocated here */
545 struct GameFraming framing;
547 struct ToolSettings *toolsettings;
549 /* migrate or replace? depends on some internal things... */
550 /* no, is on the right place (ton) */
552 struct AudioData audio;
554 ScriptLink scriptlink;
557 ListBase transform_spaces;
560 short snap_mode, snap_flag, snap_target;
562 /* none of the dependancy graph vars is mean to be saved */
563 struct DagForest *theDag;
564 short dagisvalid, dagflags;
565 short pad4, recalc; /* recalc = counterpart of ob->recalc */
567 /* Sculptmode data */
568 struct SculptData sculptdata;
576 /* **************** RENDERDATA ********************* */
580 #define R_BACKBUFANIM 2
582 #define R_FRONTBUFANIM 8
586 #define R_SHADOW 0x0002
587 #define R_GAMMA 0x0004
588 #define R_ORTHO 0x0008
589 #define R_ENVMAP 0x0010
590 #define R_EDGE 0x0020
591 #define R_FIELDS 0x0040
592 #define R_FIELDSTILL 0x0080
593 #define R_RADIO 0x0100
594 #define R_BORDER 0x0200
595 #define R_PANORAMA 0x0400
596 #define R_CROP 0x0800
597 #define R_COSMO 0x1000
598 #define R_ODDFIELD 0x2000
599 #define R_MBLUR 0x4000
600 /* unified was here */
601 #define R_RAYTRACE 0x10000
602 /* R_GAUSS is obsolete, but used to retrieve setting from old files */
603 #define R_GAUSS 0x20000
604 /* fbuf obsolete... */
605 #define R_FBUF 0x40000
606 /* threads obsolete... is there for old files, now use for autodetect threads */
607 #define R_THREADS 0x80000
608 /* Use the same flag for autothreads */
609 #define R_FIXED_THREADS 0x80000
611 #define R_SPEED 0x100000
612 #define R_SSS 0x200000
613 #define R_NO_OVERWRITE 0x400000 /* skip existing files */
614 #define R_TOUCH 0x800000 /* touch files before rendering */
615 #define R_SIMPLIFY 0x1000000
619 #define R_FILTER_BOX 0
620 #define R_FILTER_TENT 1
621 #define R_FILTER_QUAD 2
622 #define R_FILTER_CUBIC 3
623 #define R_FILTER_CATROM 4
624 #define R_FILTER_GAUSS 5
625 #define R_FILTER_MITCH 6
626 #define R_FILTER_FAST_GAUSS 7 /* note, this is only used for nodes at the moment */
628 /* yafray: renderer flag (not only exclusive to yafray) */
632 /* scemode (int now) */
633 #define R_DOSEQ 0x0001
634 #define R_BG_RENDER 0x0002
635 /* passepartout is camera option now, keep this for backward compatibility */
636 #define R_PASSEPARTOUT 0x0004
637 #define R_PREVIEWBUTS 0x0008
638 #define R_EXTENSION 0x0010
639 #define R_NODE_PREVIEW 0x0020
640 #define R_DOCOMP 0x0040
641 #define R_COMP_CROP 0x0080
642 #define R_FREE_IMAGE 0x0100
643 #define R_SINGLE_LAYER 0x0200
644 #define R_EXR_TILE_FILE 0x0400
645 #define R_COMP_FREE 0x0800
646 #define R_NO_IMAGE_LOAD 0x1000
647 #define R_NO_TEX 0x2000
648 #define R_STAMP_INFO 0x4000
649 #define R_FULL_SAMPLE 0x8000
650 #define R_COMP_RERENDER 0x10000
653 #define R_STAMP_TIME 0x0001
654 #define R_STAMP_FRAME 0x0002
655 #define R_STAMP_DATE 0x0004
656 #define R_STAMP_CAMERA 0x0008
657 #define R_STAMP_SCENE 0x0010
658 #define R_STAMP_NOTE 0x0020
659 #define R_STAMP_DRAW 0x0040 /* draw in the image */
660 #define R_STAMP_MARKER 0x0080
661 #define R_STAMP_FILENAME 0x0100
662 #define R_STAMP_SEQSTRIP 0x0200
666 #define R_ALPHAPREMUL 1
670 #define R_PLANES24 24
671 #define R_PLANES32 32
678 #define R_FTYPE 3 /* ftype is nomore */
686 #define R_AVICODEC 18
687 #define R_QUICKTIME 19
693 #define R_FRAMESERVER 25
696 #define R_MULTILAYER 28
699 /* subimtype, flag options for imtype */
700 #define R_OPENEXR_HALF 1
701 #define R_OPENEXR_ZBUF 2
702 #define R_PREVIEW_JPG 4
703 #define R_CINEON_LOG 8
704 #define R_TIFF_16BIT 16
706 /* bake_mode: same as RE_BAKE_xxx defines */
708 #define R_BAKE_CLEAR 1
710 #define R_BAKE_TO_ACTIVE 4
711 #define R_BAKE_NORMALIZE 8
713 /* bake_normal_space */
714 #define R_BAKE_SPACE_CAMERA 0
715 #define R_BAKE_SPACE_WORLD 1
716 #define R_BAKE_SPACE_OBJECT 2
717 #define R_BAKE_SPACE_TANGENT 3
719 /* **************** SCENE ********************* */
720 #define RAD_PHASE_PATCHES 1
721 #define RAD_PHASE_FACES 2
723 /* base->flag is in DNA_object_types.h */
725 /* scene->snap_flag */
727 #define SCE_SNAP_ROTATE 2
728 /* scene->snap_target */
729 #define SCE_SNAP_TARGET_CLOSEST 0
730 #define SCE_SNAP_TARGET_CENTER 1
731 #define SCE_SNAP_TARGET_MEDIAN 2
732 #define SCE_SNAP_TARGET_ACTIVE 3
733 /* scene->snap_mode */
734 #define SCE_SNAP_MODE_VERTEX 0
735 #define SCE_SNAP_MODE_EDGE 1
736 #define SCE_SNAP_MODE_FACE 2
738 /* sce->selectmode */
739 #define SCE_SELECT_VERTEX 1 /* for mesh */
740 #define SCE_SELECT_EDGE 2
741 #define SCE_SELECT_FACE 4
743 /* sce->selectmode for particles */
744 #define SCE_SELECT_PATH 1
745 #define SCE_SELECT_POINT 2
746 #define SCE_SELECT_END 4
748 /* sce->recalc (now in use by previewrender) */
749 #define SCE_PRV_CHANGED 1
751 /* sce->prop_mode (proportional falloff) */
752 #define PROP_SMOOTH 0
753 #define PROP_SPHERE 1
758 #define PROP_RANDOM 6
760 /* return flag next_object function */
769 #define AUDIO_SCRUB 4
771 #define FFMPEG_MULTIPLEX_AUDIO 1
772 #define FFMPEG_AUTOSPLIT_OUTPUT 2
774 /* Sculpt brush flags */
775 #define SCULPT_BRUSH_AIRBRUSH 1
776 #define SCULPT_BRUSH_ANCHORED 2
777 /* SculptData.flags */
778 #define SCULPT_INPUT_SMOOTH 1
779 #define SCULPT_DRAW_FAST 2
780 #define SCULPT_DRAW_BRUSH 4
781 /* SculptData.brushtype */
783 #define SMOOTH_BRUSH 2
784 #define PINCH_BRUSH 3
785 #define INFLATE_BRUSH 4
787 #define LAYER_BRUSH 6
788 #define FLATTEN_BRUSH 7
789 /* SculptData.texrept */
790 #define SCULPTREPT_DRAG 1
791 #define SCULPTREPT_TILE 2
792 #define SCULPTREPT_3D 3
802 /* toolsettings->imagepaint_flag */
803 #define IMAGEPAINT_DRAWING 1
804 #define IMAGEPAINT_DRAW_TOOL 2
805 #define IMAGEPAINT_DRAW_TOOL_DRAWING 4
807 /* toolsettings->uvcalc_flag */
808 #define UVCALC_FILLHOLES 1
809 #define UVCALC_NO_ASPECT_CORRECT 2 /* would call this UVCALC_ASPECT_CORRECT, except it should be default with old file */
810 #define UVCALC_TRANSFORM_CORRECT 4 /* adjust UV's while transforming to avoid distortion */
812 /* toolsettings->edge_mode */
813 #define EDGE_MODE_SELECT 0
814 #define EDGE_MODE_TAG_SEAM 1
815 #define EDGE_MODE_TAG_SHARP 2
816 #define EDGE_MODE_TAG_CREASE 3
817 #define EDGE_MODE_TAG_BEVEL 4
819 /* toolsettings->particle flag */
820 #define PE_KEEP_LENGTHS 1
821 #define PE_LOCK_FIRST 2
822 #define PE_DEFLECT_EMITTER 4
823 #define PE_INTERPOLATE_ADDED 8
824 #define PE_SHOW_CHILD 16
825 #define PE_SHOW_TIME 32
826 #define PE_X_MIRROR 64
828 /* toolsetting->particle brushtype */
829 #define PE_BRUSH_NONE -1
830 #define PE_BRUSH_COMB 0
831 #define PE_BRUSH_CUT 1
832 #define PE_BRUSH_LENGTH 2
833 #define PE_BRUSH_PUFF 3
834 #define PE_BRUSH_ADD 4
835 #define PE_BRUSH_WEIGHT 5
836 #define PE_BRUSH_SMOOTH 6
838 /* this must equal ParticleEditSettings.brush array size */
839 #define PE_TOT_BRUSH 7
841 /* toolsettings->retopo_mode */
843 #define RETOPO_PAINT 2
845 /* toolsettings->retopo_paint_tool */
847 #define RETOPO_LINE 2
848 #define RETOPO_ELLIPSE 4
850 /* toolsettings->skgen_options */
851 #define SKGEN_FILTER_INTERNAL (1 << 0)
852 #define SKGEN_FILTER_EXTERNAL (1 << 1)
853 #define SKGEN_SYMMETRY (1 << 2)
854 #define SKGEN_CUT_LENGTH (1 << 3)
855 #define SKGEN_CUT_ANGLE (1 << 4)
856 #define SKGEN_CUT_CORRELATION (1 << 5)
857 #define SKGEN_HARMONIC (1 << 6)
858 #define SKGEN_STICK_TO_EMBEDDING (1 << 7)
859 #define SKGEN_ADAPTIVE_DISTANCE (1 << 8)
860 #define SKGEN_FILTER_SMART (1 << 9)
861 #define SKGEN_DISP_LENGTH (1 << 10)
862 #define SKGEN_DISP_WEIGHT (1 << 11)
863 #define SKGEN_DISP_ORIG (1 << 12)
864 #define SKGEN_DISP_EMBED (1 << 13)
865 #define SKGEN_DISP_INDEX (1 << 14)
866 #define SKGEN_CUT_FIXED 64
868 #define SKGEN_SUB_LENGTH 0
869 #define SKGEN_SUB_ANGLE 1
870 #define SKGEN_SUB_CORRELATION 2
871 #define SKGEN_SUB_TOTAL 3
873 /* toolsettings->skgen_postpro */
874 #define SKGEN_SMOOTH 0
875 #define SKGEN_AVERAGE 1
876 #define SKGEN_SHARPEN 2
878 /* toolsettings->bone_sketching */
879 #define BONE_SKETCHING 1
880 #define BONE_SKETCHING_QUICK 2