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"
52 struct Base *next, *prev;
53 unsigned int lay, selcol;
56 struct Object *object;
59 typedef struct AviCodecData {
60 void *lpFormat; /* save format */
61 void *lpParms; /* compressor options */
62 unsigned int cbFormat; /* size of lpFormat buffer */
63 unsigned int cbParms; /* size of lpParms buffer */
65 unsigned int fccType; /* stream type, for consistency */
66 unsigned int fccHandler; /* compressor */
67 unsigned int dwKeyFrameEvery; /* keyframe rate */
68 unsigned int dwQuality; /* compress quality 0-10,000 */
69 unsigned int dwBytesPerSecond; /* bytes per second */
70 unsigned int dwFlags; /* flags... see below */
71 unsigned int dwInterleaveEvery; /* for non-video streams only */
74 char avicodecname[128];
77 typedef struct QuicktimeCodecData {
79 void *cdParms; /* codec/compressor options */
80 void *pad; /* padding */
82 unsigned int cdSize; /* size of cdParms buffer */
83 unsigned int pad2; /* padding */
85 char qtcodecname[128];
88 typedef struct FFMpegCodecData {
102 IDProperty *properties;
106 typedef struct AudioData {
108 float main; /* Main mix in dB */
113 typedef struct SceneRenderLayer {
114 struct SceneRenderLayer *next, *prev;
118 struct Material *mat_override;
119 struct Group *light_override;
121 unsigned int lay; /* scene->lay itself has priority over this */
122 unsigned int lay_zmask; /* has to be after lay, this is for Z-masking */
127 int passflag; /* pass_xor has to be after passflag */
132 #define SCE_LAY_SOLID 1
133 #define SCE_LAY_ZTRA 2
134 #define SCE_LAY_HALO 4
135 #define SCE_LAY_EDGE 8
136 #define SCE_LAY_SKY 16
137 #define SCE_LAY_STRAND 32
138 /* flags between 32 and 0x8000 are set to 1 already, for future options */
140 #define SCE_LAY_ALL_Z 0x8000
141 #define SCE_LAY_XOR 0x10000
142 #define SCE_LAY_DISABLE 0x20000
143 #define SCE_LAY_ZMASK 0x40000
144 #define SCE_LAY_NEG_ZMASK 0x80000
147 #define SCE_PASS_COMBINED 1
149 #define SCE_PASS_RGBA 4
150 #define SCE_PASS_DIFFUSE 8
151 #define SCE_PASS_SPEC 16
152 #define SCE_PASS_SHADOW 32
153 #define SCE_PASS_AO 64
154 #define SCE_PASS_REFLECT 128
155 #define SCE_PASS_NORMAL 256
156 #define SCE_PASS_VECTOR 512
157 #define SCE_PASS_REFRACT 1024
158 #define SCE_PASS_INDEXOB 2048
159 #define SCE_PASS_UV 4096
160 #define SCE_PASS_RADIO 8192
161 #define SCE_PASS_MIST 16384
163 /* note, srl->passflag is treestore element 'nr' in outliner, short still... */
166 typedef struct RenderData {
168 struct AviCodecData *avicodecdata;
169 struct QuicktimeCodecData *qtcodecdata;
170 struct FFMpegCodecData ffcodecdata;
172 int cfra, sfra, efra; /* frames as in 'images' */
173 int psfra, pefra; /* start+end frames of preview range */
175 int images, framapto;
178 float ctime; /* use for calcutions */
179 float framelen, blurfac;
181 /** For UR edge rendering: give the edges this color */
182 float edgeR, edgeG, edgeB;
184 short fullscreen, xplay, yplay, freqplay; /* standalone player */
185 short depth, attrib, rt1, rt2; /* standalone player */
187 short stereomode; /* standalone player stereo settings */
189 short dimensionspreset; /* for the dimensions presets menu */
191 short filtertype; /* filter is box, tent, gauss, mitch, etc */
193 short size, maximsize; /* size in %, max in Kb */
196 * The desired number of pixels in the x direction
200 * The desired number of pixels in the y direction
204 * The number of part to use in the x direction
208 * The number of part to use in the y direction
212 short winpos, planes, imtype, subimtype;
215 /* 0: Enable backbuffering for images */
219 short rpad, rpad1, rpad2;
222 * Flags for render settings. Use bit-masking to access the settings.
227 * Flags for render settings. Use bit-masking to access the settings.
231 /* render engine, octree resolution */
232 short renderer, ocres;
235 * What to do with the sky/background. Picks sky/premul/key
236 * blending for the background
241 * The number of samples to use per pixel.
245 short frs_sec, edgeint;
247 /* safety, border and display rect */
251 /* information on different layers to be rendered */
256 * Adjustment factors for the aspect ratio in the x direction, was a short in 2.45
260 * Adjustment factors for the aspect ratio in the x direction, was a short in 2.45
267 * Value used to define filter size for all filter options */
270 /** post-production settings. Depricated, but here for upwards compat (initialized to 1) */
271 float postmul, postgamma, posthue, postsat;
273 /* Dither noise intensity */
274 float dither_intensity;
276 /* Bake Render options */
277 short bake_osa, bake_filter, bake_mode, bake_flag;
278 short bake_normal_space, bake_quad_split;
279 float bake_maxdist, bake_biasdist, bake_pad;
281 /* yafray: global panel params. TODO: move elsewhere */
282 short GIquality, GIcache, GImethod, GIphotons, GIdirect;
283 short YF_AA, YFexportxml, YF_nobump, YF_clamprgb, yfpad1;
284 int GIdepth, GIcausdepth, GIpixelspersample;
285 int GIphotoncount, GImixphotons;
286 float GIphotonradius;
287 int YF_raydepth, YF_AApasses, YF_AAsamples, yfpad2;
288 float GIshadowquality, GIrefinement, GIpower, GIindirpower;
289 float YF_gamma, YF_exposure, YF_raybias, YF_AApixelsize, YF_AAthreshold;
291 /* paths to backbufffer, output, ftype */
292 char backbuf[160], pic[160];
296 short stamp_font_id, pad3; /* select one of blenders bitmap fonts */
298 /* stamp info user data. */
299 char stamp_udata[160];
301 /* foreground/background color. */
305 /* render simplify */
306 int simplify_subsurf;
307 int simplify_shadowsamples;
308 float simplify_particles;
309 float simplify_aosss;
312 short cineonwhite, cineonblack;
316 short jp2_preset, jp2_depth;
320 short domeres, domemode;
321 short domeangle, pad9;
324 struct Text *dometext;
328 /* control render convert and shading engine */
329 typedef struct RenderProfile {
330 struct RenderProfile *next, *prev;
335 short shadbufsample_max;
338 float ao_error, pad2;
342 typedef struct GameFraming {
344 char type, pad1, pad2, pad3;
347 #define SCE_GAMEFRAMING_BARS 0
348 #define SCE_GAMEFRAMING_EXTEND 1
349 #define SCE_GAMEFRAMING_SCALE 2
351 typedef struct TimeMarker {
352 struct TimeMarker *next, *prev;
358 typedef struct ImagePaintSettings {
362 /* for projection painting only */
363 short seam_bleed,normal_angle;
364 } ImagePaintSettings;
366 typedef struct ParticleBrushData {
367 short size, strength; /* common settings */
368 short step, invert; /* for specific brushes only */
371 typedef struct ParticleEditSettings {
377 ParticleBrushData brush[7]; /* 7 = PE_TOT_BRUSH */
381 } ParticleEditSettings;
383 typedef struct TransformOrientation {
384 struct TransformOrientation *next, *prev;
387 } TransformOrientation;
389 typedef struct ToolSettings {
390 /* Subdivide Settings */
393 /*Triangle to Quad conversion threshold*/
403 /* Primitive Settings */
408 /* Cylinder - Tube - Circle */
414 float uvcalc_cubesize;
416 short uvcalc_mapalign;
420 short autoik_chainlen;
422 /* Image Paint (8 byttse aligned please!) */
423 struct ImagePaintSettings imapaint;
425 /* Particle Editing */
426 struct ParticleEditSettings particle;
428 /* Select Group Threshold */
436 char retopo_paint_tool;
437 char line_div, ellipse_div, retopo_hotspot;
440 char multires_subdiv_type;
442 /* Skeleton generation */
443 short skgen_resolution;
444 float skgen_threshold_internal;
445 float skgen_threshold_external;
446 float skgen_length_ratio;
447 float skgen_length_limit;
448 float skgen_angle_limit;
449 float skgen_correlation_limit;
450 float skgen_symmetry_limit;
451 float skgen_retarget_angle_weight;
452 float skgen_retarget_length_weight;
453 float skgen_retarget_distance_weight;
456 char skgen_postpro_passes;
457 char skgen_subdivisions[3];
458 char skgen_multi_level;
460 /* Skeleton Sketching */
461 struct Object *skgen_template;
463 char bone_sketching_convert;
464 char skgen_subdivision_number;
465 char skgen_retarget_options;
466 char skgen_retarget_roll;
467 char skgen_side_string[8];
468 char skgen_num_string[8];
475 /* Used by all brushes to store their properties, which can be directly set
476 by the interface code. Note that not all properties are actually used by
478 typedef struct BrushData
481 char strength, dir; /* Not used for smooth brush */
487 struct SculptSession;
488 typedef struct SculptData
490 /* Note! all pointers in this struct must be duplicated header_info.c's copy_scene function */
492 /* Data stored only from entering sculptmode until exiting sculptmode */
493 struct SculptSession *session;
495 /* Pointers to all of sculptmodes's textures */
496 struct MTex *mtex[18];
498 /* Editable brush shape */
499 struct CurveMapping *cumap;
501 /* Settings for each brush */
502 BrushData drawbrush, smoothbrush, pinchbrush, inflatebrush, grabbrush, layerbrush, flattenbrush;
504 /* For rotating around a pivot point */
509 /* For the Brush Shape */
519 /* Control tablet input */
520 char tablet_size, tablet_strength;
522 /* Symmetry is separate from the other BrushData because the same
523 settings are always used for all brush types */
526 /* Added to store if the 'Rake' setting has been set */
532 typedef struct Scene {
534 struct Object *camera;
544 float twcent[3]; /* center for transform widget */
545 float twmin[3], twmax[3]; /* boundbox of selection for transform widget */
549 float editbutsize; /* size of normals */
550 short selectmode; /* for mesh only! */
551 short proportional, prop_mode;
552 short automerge, pad5, pad6;
554 short autokey_mode; /* mode for autokeying (defines in DNA_userdef_types.h */
558 struct bNodeTree *nodetree;
560 void *ed; /* sequence editor data is allocated here */
563 struct GameFraming framing;
565 struct ToolSettings *toolsettings;
567 /* migrate or replace? depends on some internal things... */
568 /* no, is on the right place (ton) */
570 struct AudioData audio;
572 ScriptLink scriptlink;
575 ListBase transform_spaces;
578 short snap_mode, snap_flag, snap_target;
580 /* none of the dependancy graph vars is mean to be saved */
581 struct DagForest *theDag;
582 short dagisvalid, dagflags;
583 short pad4, recalc; /* recalc = counterpart of ob->recalc */
585 /* Sculptmode data */
586 struct SculptData sculptdata;
594 /* **************** RENDERDATA ********************* */
598 #define R_BACKBUFANIM 2
600 #define R_FRONTBUFANIM 8
604 #define R_SHADOW 0x0002
605 #define R_GAMMA 0x0004
606 #define R_ORTHO 0x0008
607 #define R_ENVMAP 0x0010
608 #define R_EDGE 0x0020
609 #define R_FIELDS 0x0040
610 #define R_FIELDSTILL 0x0080
611 #define R_RADIO 0x0100
612 #define R_BORDER 0x0200
613 #define R_PANORAMA 0x0400
614 #define R_CROP 0x0800
615 #define R_COSMO 0x1000
616 #define R_ODDFIELD 0x2000
617 #define R_MBLUR 0x4000
618 /* unified was here */
619 #define R_RAYTRACE 0x10000
620 /* R_GAUSS is obsolete, but used to retrieve setting from old files */
621 #define R_GAUSS 0x20000
622 /* fbuf obsolete... */
623 #define R_FBUF 0x40000
624 /* threads obsolete... is there for old files, now use for autodetect threads */
625 #define R_THREADS 0x80000
626 /* Use the same flag for autothreads */
627 #define R_FIXED_THREADS 0x80000
629 #define R_SPEED 0x100000
630 #define R_SSS 0x200000
631 #define R_NO_OVERWRITE 0x400000 /* skip existing files */
632 #define R_TOUCH 0x800000 /* touch files before rendering */
633 #define R_SIMPLIFY 0x1000000
637 #define R_FILTER_BOX 0
638 #define R_FILTER_TENT 1
639 #define R_FILTER_QUAD 2
640 #define R_FILTER_CUBIC 3
641 #define R_FILTER_CATROM 4
642 #define R_FILTER_GAUSS 5
643 #define R_FILTER_MITCH 6
644 #define R_FILTER_FAST_GAUSS 7 /* note, this is only used for nodes at the moment */
646 /* yafray: renderer flag (not only exclusive to yafray) */
650 /* scemode (int now) */
651 #define R_DOSEQ 0x0001
652 #define R_BG_RENDER 0x0002
653 /* passepartout is camera option now, keep this for backward compatibility */
654 #define R_PASSEPARTOUT 0x0004
655 #define R_PREVIEWBUTS 0x0008
656 #define R_EXTENSION 0x0010
657 #define R_NODE_PREVIEW 0x0020
658 #define R_DOCOMP 0x0040
659 #define R_COMP_CROP 0x0080
660 #define R_FREE_IMAGE 0x0100
661 #define R_SINGLE_LAYER 0x0200
662 #define R_EXR_TILE_FILE 0x0400
663 #define R_COMP_FREE 0x0800
664 #define R_NO_IMAGE_LOAD 0x1000
665 #define R_NO_TEX 0x2000
666 #define R_STAMP_INFO 0x4000
667 #define R_FULL_SAMPLE 0x8000
668 #define R_COMP_RERENDER 0x10000
671 #define R_STAMP_TIME 0x0001
672 #define R_STAMP_FRAME 0x0002
673 #define R_STAMP_DATE 0x0004
674 #define R_STAMP_CAMERA 0x0008
675 #define R_STAMP_SCENE 0x0010
676 #define R_STAMP_NOTE 0x0020
677 #define R_STAMP_DRAW 0x0040 /* draw in the image */
678 #define R_STAMP_MARKER 0x0080
679 #define R_STAMP_FILENAME 0x0100
680 #define R_STAMP_SEQSTRIP 0x0200
684 #define R_ALPHAPREMUL 1
688 #define R_PLANES24 24
689 #define R_PLANES32 32
696 #define R_FTYPE 3 /* ftype is nomore */
704 #define R_AVICODEC 18
705 #define R_QUICKTIME 19
711 #define R_FRAMESERVER 25
714 #define R_MULTILAYER 28
718 /* subimtype, flag options for imtype */
719 #define R_OPENEXR_HALF 1
720 #define R_OPENEXR_ZBUF 2
721 #define R_PREVIEW_JPG 4
722 #define R_CINEON_LOG 8
723 #define R_TIFF_16BIT 16
725 #define R_JPEG2K_12BIT 32 /* Jpeg2000 */
726 #define R_JPEG2K_16BIT 64
727 #define R_JPEG2K_YCC 128 /* when disabled use RGB */
728 #define R_JPEG2K_CINE_PRESET 256
729 #define R_JPEG2K_CINE_48FPS 512
732 /* bake_mode: same as RE_BAKE_xxx defines */
734 #define R_BAKE_CLEAR 1
736 #define R_BAKE_TO_ACTIVE 4
737 #define R_BAKE_NORMALIZE 8
739 /* bake_normal_space */
740 #define R_BAKE_SPACE_CAMERA 0
741 #define R_BAKE_SPACE_WORLD 1
742 #define R_BAKE_SPACE_OBJECT 2
743 #define R_BAKE_SPACE_TANGENT 3
745 /* **************** SCENE ********************* */
746 #define RAD_PHASE_PATCHES 1
747 #define RAD_PHASE_FACES 2
749 /* base->flag is in DNA_object_types.h */
751 /* scene->snap_flag */
753 #define SCE_SNAP_ROTATE 2
754 #define SCE_SNAP_PEEL_OBJECT 4
755 /* scene->snap_target */
756 #define SCE_SNAP_TARGET_CLOSEST 0
757 #define SCE_SNAP_TARGET_CENTER 1
758 #define SCE_SNAP_TARGET_MEDIAN 2
759 #define SCE_SNAP_TARGET_ACTIVE 3
760 /* scene->snap_mode */
761 #define SCE_SNAP_MODE_VERTEX 0
762 #define SCE_SNAP_MODE_EDGE 1
763 #define SCE_SNAP_MODE_FACE 2
764 #define SCE_SNAP_MODE_VOLUME 3
766 /* sce->selectmode */
767 #define SCE_SELECT_VERTEX 1 /* for mesh */
768 #define SCE_SELECT_EDGE 2
769 #define SCE_SELECT_FACE 4
771 /* sce->selectmode for particles */
772 #define SCE_SELECT_PATH 1
773 #define SCE_SELECT_POINT 2
774 #define SCE_SELECT_END 4
776 /* sce->recalc (now in use by previewrender) */
777 #define SCE_PRV_CHANGED 1
779 /* sce->prop_mode (proportional falloff) */
780 #define PROP_SMOOTH 0
781 #define PROP_SPHERE 1
786 #define PROP_RANDOM 6
788 /* return flag next_object function */
797 #define AUDIO_SCRUB 4
799 #define FFMPEG_MULTIPLEX_AUDIO 1
800 #define FFMPEG_AUTOSPLIT_OUTPUT 2
802 /* Sculpt brush flags */
803 #define SCULPT_BRUSH_AIRBRUSH 1
804 #define SCULPT_BRUSH_ANCHORED 2
805 /* SculptData.flags */
806 #define SCULPT_INPUT_SMOOTH 1
807 #define SCULPT_DRAW_FAST 2
808 #define SCULPT_DRAW_BRUSH 4
809 /* SculptData.brushtype */
811 #define SMOOTH_BRUSH 2
812 #define PINCH_BRUSH 3
813 #define INFLATE_BRUSH 4
815 #define LAYER_BRUSH 6
816 #define FLATTEN_BRUSH 7
817 /* SculptData.texrept */
818 #define SCULPTREPT_DRAG 1
819 #define SCULPTREPT_TILE 2
820 #define SCULPTREPT_3D 3
830 /* toolsettings->imagepaint_flag */
831 #define IMAGEPAINT_DRAWING 1
832 #define IMAGEPAINT_DRAW_TOOL 2
833 #define IMAGEPAINT_DRAW_TOOL_DRAWING 4
835 /* projection painting only */
836 #define IMAGEPAINT_PROJECT_DISABLE 8 /* Non projection 3D painting */
837 #define IMAGEPAINT_PROJECT_XRAY 16
838 #define IMAGEPAINT_PROJECT_BACKFACE 32
839 #define IMAGEPAINT_PROJECT_FLAT 64
840 #define IMAGEPAINT_PROJECT_LAYER_CLONE 128
841 #define IMAGEPAINT_PROJECT_LAYER_MASK 256
842 #define IMAGEPAINT_PROJECT_LAYER_MASK_INV 512
844 /* toolsettings->uvcalc_flag */
845 #define UVCALC_FILLHOLES 1
846 #define UVCALC_NO_ASPECT_CORRECT 2 /* would call this UVCALC_ASPECT_CORRECT, except it should be default with old file */
847 #define UVCALC_TRANSFORM_CORRECT 4 /* adjust UV's while transforming to avoid distortion */
849 /* toolsettings->edge_mode */
850 #define EDGE_MODE_SELECT 0
851 #define EDGE_MODE_TAG_SEAM 1
852 #define EDGE_MODE_TAG_SHARP 2
853 #define EDGE_MODE_TAG_CREASE 3
854 #define EDGE_MODE_TAG_BEVEL 4
856 /* toolsettings->particle flag */
857 #define PE_KEEP_LENGTHS 1
858 #define PE_LOCK_FIRST 2
859 #define PE_DEFLECT_EMITTER 4
860 #define PE_INTERPOLATE_ADDED 8
861 #define PE_SHOW_CHILD 16
862 #define PE_SHOW_TIME 32
863 #define PE_X_MIRROR 64
865 /* toolsetting->particle brushtype */
866 #define PE_BRUSH_NONE -1
867 #define PE_BRUSH_COMB 0
868 #define PE_BRUSH_CUT 1
869 #define PE_BRUSH_LENGTH 2
870 #define PE_BRUSH_PUFF 3
871 #define PE_BRUSH_ADD 4
872 #define PE_BRUSH_WEIGHT 5
873 #define PE_BRUSH_SMOOTH 6
875 /* this must equal ParticleEditSettings.brush array size */
876 #define PE_TOT_BRUSH 7
878 /* toolsettings->retopo_mode */
880 #define RETOPO_PAINT 2
882 /* toolsettings->retopo_paint_tool */
884 #define RETOPO_LINE 2
885 #define RETOPO_ELLIPSE 4
887 /* toolsettings->skgen_options */
888 #define SKGEN_FILTER_INTERNAL (1 << 0)
889 #define SKGEN_FILTER_EXTERNAL (1 << 1)
890 #define SKGEN_SYMMETRY (1 << 2)
891 #define SKGEN_CUT_LENGTH (1 << 3)
892 #define SKGEN_CUT_ANGLE (1 << 4)
893 #define SKGEN_CUT_CORRELATION (1 << 5)
894 #define SKGEN_HARMONIC (1 << 6)
895 #define SKGEN_STICK_TO_EMBEDDING (1 << 7)
896 #define SKGEN_ADAPTIVE_DISTANCE (1 << 8)
897 #define SKGEN_FILTER_SMART (1 << 9)
898 #define SKGEN_DISP_LENGTH (1 << 10)
899 #define SKGEN_DISP_WEIGHT (1 << 11)
900 #define SKGEN_DISP_ORIG (1 << 12)
901 #define SKGEN_DISP_EMBED (1 << 13)
902 #define SKGEN_DISP_INDEX (1 << 14)
904 #define SKGEN_SUB_LENGTH 0
905 #define SKGEN_SUB_ANGLE 1
906 #define SKGEN_SUB_CORRELATION 2
907 #define SKGEN_SUB_TOTAL 3
909 /* toolsettings->skgen_postpro */
910 #define SKGEN_SMOOTH 0
911 #define SKGEN_AVERAGE 1
912 #define SKGEN_SHARPEN 2
914 /* toolsettings->bone_sketching */
915 #define BONE_SKETCHING 1
916 #define BONE_SKETCHING_QUICK 2
917 #define BONE_SKETCHING_ADJUST 4
919 /* toolsettings->bone_sketching_convert */
920 #define SK_CONVERT_CUT_FIXED 0
921 #define SK_CONVERT_CUT_LENGTH 1
922 #define SK_CONVERT_CUT_ADAPTATIVE 2
923 #define SK_CONVERT_RETARGET 3
925 /* toolsettings->skgen_retarget_options */
926 #define SK_RETARGET_AUTONAME 1
928 /* toolsettings->skgen_retarget_roll */
929 #define SK_RETARGET_ROLL_VIEW 1
930 #define SK_RETARGET_ROLL_JOINT 2