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;
438 char skgen_postpro_passes;
439 char skgen_subdivisions[3];
441 /* Skeleton Sketching */
443 char skgen_subdivision_number;
450 /* Used by all brushes to store their properties, which can be directly set
451 by the interface code. Note that not all properties are actually used by
453 typedef struct BrushData
456 char strength, dir; /* Not used for smooth brush */
462 struct SculptSession;
463 typedef struct SculptData
465 /* Note! all pointers in this struct must be duplicated header_info.c's copy_scene function */
467 /* Data stored only from entering sculptmode until exiting sculptmode */
468 struct SculptSession *session;
470 /* Pointers to all of sculptmodes's textures */
471 struct MTex *mtex[18];
473 /* Editable brush shape */
474 struct CurveMapping *cumap;
476 /* Settings for each brush */
477 BrushData drawbrush, smoothbrush, pinchbrush, inflatebrush, grabbrush, layerbrush, flattenbrush;
479 /* For rotating around a pivot point */
484 /* For the Brush Shape */
494 /* Control tablet input */
495 char tablet_size, tablet_strength;
497 /* Symmetry is separate from the other BrushData because the same
498 settings are always used for all brush types */
501 /* Added to store if the 'Rake' setting has been set */
507 typedef struct Scene {
509 struct Object *camera;
519 float twcent[3]; /* center for transform widget */
520 float twmin[3], twmax[3]; /* boundbox of selection for transform widget */
524 float editbutsize; /* size of normals */
525 short selectmode; /* for mesh only! */
526 short proportional, prop_mode;
527 short automerge, pad5, pad6;
529 short autokey_mode; /* mode for autokeying (defines in DNA_userdef_types.h */
533 struct bNodeTree *nodetree;
535 void *ed; /* sequence editor data is allocated here */
538 struct GameFraming framing;
540 struct ToolSettings *toolsettings;
542 /* migrate or replace? depends on some internal things... */
543 /* no, is on the right place (ton) */
545 struct AudioData audio;
547 ScriptLink scriptlink;
550 ListBase transform_spaces;
553 short snap_mode, snap_flag, snap_target;
555 /* none of the dependancy graph vars is mean to be saved */
556 struct DagForest *theDag;
557 short dagisvalid, dagflags;
558 short pad4, recalc; /* recalc = counterpart of ob->recalc */
560 /* Sculptmode data */
561 struct SculptData sculptdata;
569 /* **************** RENDERDATA ********************* */
573 #define R_BACKBUFANIM 2
575 #define R_FRONTBUFANIM 8
579 #define R_SHADOW 0x0002
580 #define R_GAMMA 0x0004
581 #define R_ORTHO 0x0008
582 #define R_ENVMAP 0x0010
583 #define R_EDGE 0x0020
584 #define R_FIELDS 0x0040
585 #define R_FIELDSTILL 0x0080
586 #define R_RADIO 0x0100
587 #define R_BORDER 0x0200
588 #define R_PANORAMA 0x0400
589 #define R_CROP 0x0800
590 #define R_COSMO 0x1000
591 #define R_ODDFIELD 0x2000
592 #define R_MBLUR 0x4000
593 /* unified was here */
594 #define R_RAYTRACE 0x10000
595 /* R_GAUSS is obsolete, but used to retrieve setting from old files */
596 #define R_GAUSS 0x20000
597 /* fbuf obsolete... */
598 #define R_FBUF 0x40000
599 /* threads obsolete... is there for old files, now use for autodetect threads */
600 #define R_THREADS 0x80000
601 /* Use the same flag for autothreads */
602 #define R_FIXED_THREADS 0x80000
604 #define R_SPEED 0x100000
605 #define R_SSS 0x200000
606 #define R_NO_OVERWRITE 0x400000 /* skip existing files */
607 #define R_TOUCH 0x800000 /* touch files before rendering */
608 #define R_SIMPLIFY 0x1000000
612 #define R_FILTER_BOX 0
613 #define R_FILTER_TENT 1
614 #define R_FILTER_QUAD 2
615 #define R_FILTER_CUBIC 3
616 #define R_FILTER_CATROM 4
617 #define R_FILTER_GAUSS 5
618 #define R_FILTER_MITCH 6
619 #define R_FILTER_FAST_GAUSS 7 /* note, this is only used for nodes at the moment */
621 /* yafray: renderer flag (not only exclusive to yafray) */
625 /* scemode (int now) */
626 #define R_DOSEQ 0x0001
627 #define R_BG_RENDER 0x0002
628 /* passepartout is camera option now, keep this for backward compatibility */
629 #define R_PASSEPARTOUT 0x0004
630 #define R_PREVIEWBUTS 0x0008
631 #define R_EXTENSION 0x0010
632 #define R_NODE_PREVIEW 0x0020
633 #define R_DOCOMP 0x0040
634 #define R_COMP_CROP 0x0080
635 #define R_FREE_IMAGE 0x0100
636 #define R_SINGLE_LAYER 0x0200
637 #define R_EXR_TILE_FILE 0x0400
638 #define R_COMP_FREE 0x0800
639 #define R_NO_IMAGE_LOAD 0x1000
640 #define R_NO_TEX 0x2000
641 #define R_STAMP_INFO 0x4000
642 #define R_FULL_SAMPLE 0x8000
643 #define R_COMP_RERENDER 0x10000
646 #define R_STAMP_TIME 0x0001
647 #define R_STAMP_FRAME 0x0002
648 #define R_STAMP_DATE 0x0004
649 #define R_STAMP_CAMERA 0x0008
650 #define R_STAMP_SCENE 0x0010
651 #define R_STAMP_NOTE 0x0020
652 #define R_STAMP_DRAW 0x0040 /* draw in the image */
653 #define R_STAMP_MARKER 0x0080
654 #define R_STAMP_FILENAME 0x0100
655 #define R_STAMP_SEQSTRIP 0x0200
659 #define R_ALPHAPREMUL 1
663 #define R_PLANES24 24
664 #define R_PLANES32 32
671 #define R_FTYPE 3 /* ftype is nomore */
679 #define R_AVICODEC 18
680 #define R_QUICKTIME 19
686 #define R_FRAMESERVER 25
689 #define R_MULTILAYER 28
692 /* subimtype, flag options for imtype */
693 #define R_OPENEXR_HALF 1
694 #define R_OPENEXR_ZBUF 2
695 #define R_PREVIEW_JPG 4
696 #define R_CINEON_LOG 8
697 #define R_TIFF_16BIT 16
699 /* bake_mode: same as RE_BAKE_xxx defines */
701 #define R_BAKE_CLEAR 1
703 #define R_BAKE_TO_ACTIVE 4
704 #define R_BAKE_NORMALIZE 8
706 /* bake_normal_space */
707 #define R_BAKE_SPACE_CAMERA 0
708 #define R_BAKE_SPACE_WORLD 1
709 #define R_BAKE_SPACE_OBJECT 2
710 #define R_BAKE_SPACE_TANGENT 3
712 /* **************** SCENE ********************* */
713 #define RAD_PHASE_PATCHES 1
714 #define RAD_PHASE_FACES 2
716 /* base->flag is in DNA_object_types.h */
718 /* scene->snap_flag */
720 #define SCE_SNAP_ROTATE 2
721 /* scene->snap_target */
722 #define SCE_SNAP_TARGET_CLOSEST 0
723 #define SCE_SNAP_TARGET_CENTER 1
724 #define SCE_SNAP_TARGET_MEDIAN 2
725 #define SCE_SNAP_TARGET_ACTIVE 3
726 /* scene->snap_mode */
727 #define SCE_SNAP_MODE_VERTEX 0
728 #define SCE_SNAP_MODE_EDGE 1
729 #define SCE_SNAP_MODE_FACE 2
731 /* sce->selectmode */
732 #define SCE_SELECT_VERTEX 1 /* for mesh */
733 #define SCE_SELECT_EDGE 2
734 #define SCE_SELECT_FACE 4
736 /* sce->selectmode for particles */
737 #define SCE_SELECT_PATH 1
738 #define SCE_SELECT_POINT 2
739 #define SCE_SELECT_END 4
741 /* sce->recalc (now in use by previewrender) */
742 #define SCE_PRV_CHANGED 1
744 /* sce->prop_mode (proportional falloff) */
745 #define PROP_SMOOTH 0
746 #define PROP_SPHERE 1
751 #define PROP_RANDOM 6
753 /* return flag next_object function */
762 #define AUDIO_SCRUB 4
764 #define FFMPEG_MULTIPLEX_AUDIO 1
765 #define FFMPEG_AUTOSPLIT_OUTPUT 2
767 /* Sculpt brush flags */
768 #define SCULPT_BRUSH_AIRBRUSH 1
769 #define SCULPT_BRUSH_ANCHORED 2
770 /* SculptData.flags */
771 #define SCULPT_INPUT_SMOOTH 1
772 #define SCULPT_DRAW_FAST 2
773 #define SCULPT_DRAW_BRUSH 4
774 /* SculptData.brushtype */
776 #define SMOOTH_BRUSH 2
777 #define PINCH_BRUSH 3
778 #define INFLATE_BRUSH 4
780 #define LAYER_BRUSH 6
781 #define FLATTEN_BRUSH 7
782 /* SculptData.texrept */
783 #define SCULPTREPT_DRAG 1
784 #define SCULPTREPT_TILE 2
785 #define SCULPTREPT_3D 3
795 /* toolsettings->imagepaint_flag */
796 #define IMAGEPAINT_DRAWING 1
797 #define IMAGEPAINT_DRAW_TOOL 2
798 #define IMAGEPAINT_DRAW_TOOL_DRAWING 4
800 /* toolsettings->uvcalc_flag */
801 #define UVCALC_FILLHOLES 1
802 #define UVCALC_NO_ASPECT_CORRECT 2 /* would call this UVCALC_ASPECT_CORRECT, except it should be default with old file */
803 #define UVCALC_TRANSFORM_CORRECT 4 /* adjust UV's while transforming to avoid distortion */
805 /* toolsettings->edge_mode */
806 #define EDGE_MODE_SELECT 0
807 #define EDGE_MODE_TAG_SEAM 1
808 #define EDGE_MODE_TAG_SHARP 2
809 #define EDGE_MODE_TAG_CREASE 3
810 #define EDGE_MODE_TAG_BEVEL 4
812 /* toolsettings->particle flag */
813 #define PE_KEEP_LENGTHS 1
814 #define PE_LOCK_FIRST 2
815 #define PE_DEFLECT_EMITTER 4
816 #define PE_INTERPOLATE_ADDED 8
817 #define PE_SHOW_CHILD 16
818 #define PE_SHOW_TIME 32
819 #define PE_X_MIRROR 64
821 /* toolsetting->particle brushtype */
822 #define PE_BRUSH_NONE -1
823 #define PE_BRUSH_COMB 0
824 #define PE_BRUSH_CUT 1
825 #define PE_BRUSH_LENGTH 2
826 #define PE_BRUSH_PUFF 3
827 #define PE_BRUSH_ADD 4
828 #define PE_BRUSH_WEIGHT 5
829 #define PE_BRUSH_SMOOTH 6
831 /* this must equal ParticleEditSettings.brush array size */
832 #define PE_TOT_BRUSH 7
834 /* toolsettings->retopo_mode */
836 #define RETOPO_PAINT 2
838 /* toolsettings->retopo_paint_tool */
840 #define RETOPO_LINE 2
841 #define RETOPO_ELLIPSE 4
843 /* toolsettings->skgen_options */
844 #define SKGEN_FILTER_INTERNAL 1
845 #define SKGEN_FILTER_EXTERNAL 2
846 #define SKGEN_SYMMETRY 4
847 #define SKGEN_CUT_LENGTH 8
848 #define SKGEN_CUT_ANGLE 16
849 #define SKGEN_CUT_CORRELATION 32
850 #define SKGEN_CUT_FIXED 64
852 #define SKGEN_SUB_LENGTH 0
853 #define SKGEN_SUB_ANGLE 1
854 #define SKGEN_SUB_CORRELATION 2
855 #define SKGEN_SUB_TOTAL 3
857 /* toolsettings->skgen_postpro */
858 #define SKGEN_SMOOTH 0
859 #define SKGEN_AVERAGE 1
860 #define SKGEN_SHARPEN 2
862 /* toolsettings->bone_sketching */
863 #define BONE_SKETCHING 1
864 #define BONE_SKETCHING_QUICK 2