4 * ***** BEGIN GPL/BL DUAL 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. The Blender
10 * Foundation also sells licenses for use in proprietary software under
11 * the Blender License. See http://www.blender.org/BL/ for information
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software Foundation,
21 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
24 * All rights reserved.
26 * The Original Code is: all of this file.
28 * Contributor(s): none yet.
30 * ***** END GPL/BL DUAL LICENSE BLOCK *****
32 #ifndef DNA_SCENE_TYPES_H
33 #define DNA_SCENE_TYPES_H
39 #include "DNA_vec_types.h"
40 #include "DNA_listBase.h"
41 #include "DNA_scriptlink_types.h"
43 #include "DNA_scriptlink_types.h"
54 struct Base *next, *prev;
55 unsigned int lay, selcol;
58 struct Object *object;
61 typedef struct AviCodecData {
62 void *lpFormat; /* save format */
63 void *lpParms; /* compressor options */
64 unsigned int cbFormat; /* size of lpFormat buffer */
65 unsigned int cbParms; /* size of lpParms buffer */
67 unsigned int fccType; /* stream type, for consistency */
68 unsigned int fccHandler; /* compressor */
69 unsigned int dwKeyFrameEvery; /* keyframe rate */
70 unsigned int dwQuality; /* compress quality 0-10,000 */
71 unsigned int dwBytesPerSecond; /* bytes per second */
72 unsigned int dwFlags; /* flags... see below */
73 unsigned int dwInterleaveEvery; /* for non-video streams only */
76 char avicodecname[128];
79 typedef struct QuicktimeCodecData {
81 void *cdParms; /* codec/compressor options */
82 void *pad; /* padding */
84 unsigned int cdSize; /* size of cdParms buffer */
85 unsigned int pad2; /* padding */
87 char qtcodecname[128];
90 typedef struct FFMpegCodecData {
107 typedef struct AudioData {
109 float main; /* Main mix in dB */
114 typedef struct SceneRenderLayer {
115 struct SceneRenderLayer *next, *prev;
119 struct Material *mat_override;
120 struct Group *light_override;
122 unsigned int lay; /* scene->lay itself has priority over this */
124 int passflag; /* pass_xor has to be after passflag */
129 #define SCE_LAY_SOLID 1
130 #define SCE_LAY_ZTRA 2
131 #define SCE_LAY_HALO 4
132 #define SCE_LAY_EDGE 8
133 #define SCE_LAY_SKY 16
134 #define SCE_LAY_STRAND 32
135 /* flags between 32 and 0x8000 are set to 1 already, for future options */
137 #define SCE_LAY_ALL_Z 0x8000
138 #define SCE_LAY_XOR 0x10000
139 #define SCE_LAY_DISABLE 0x20000
142 #define SCE_PASS_COMBINED 1
144 #define SCE_PASS_RGBA 4
145 #define SCE_PASS_DIFFUSE 8
146 #define SCE_PASS_SPEC 16
147 #define SCE_PASS_SHADOW 32
148 #define SCE_PASS_AO 64
149 #define SCE_PASS_REFLECT 128
150 #define SCE_PASS_NORMAL 256
151 #define SCE_PASS_VECTOR 512
152 #define SCE_PASS_REFRACT 1024
153 #define SCE_PASS_INDEXOB 2048
154 #define SCE_PASS_UV 4096
155 #define SCE_PASS_RADIO 8192
156 /* note, srl->passflag is treestore element 'nr' in outliner, short still... */
159 typedef struct RenderData {
161 struct AviCodecData *avicodecdata;
162 struct QuicktimeCodecData *qtcodecdata;
163 struct FFMpegCodecData ffcodecdata;
165 int cfra, sfra, efra; /* frames as in 'images' */
166 int psfra, pefra; /* start+end frames of preview range */
168 int images, framapto;
171 float ctime; /* use for calcutions */
172 float framelen, blurfac;
174 /** For UR edge rendering: give the edges this color */
175 float edgeR, edgeG, edgeB;
177 short fullscreen, xplay, yplay, freqplay; /* standalone player */
178 short depth, attrib, rt1, rt2; /* standalone player */
180 short stereomode; /* standalone player stereo settings */
182 short dimensionspreset; /* for the dimensions presets menu */
184 short filtertype; /* filter is box, tent, gauss, mitch, etc */
186 short size, maximsize; /* size in %, max in Kb */
189 * The desired number of pixels in the x direction
193 * The desired number of pixels in the y direction
197 * Adjustment factors for the aspect ratio in the x direction
201 * Adjustment factors for the aspect ratio in the x direction
205 * The number of part to use in the x direction
209 * The number of part to use in the y direction
213 short winpos, planes, imtype, subimtype;
216 /* 0: Enable backbuffering for images */
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, rpad[2];
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 */
257 * Value used to define filter size for all filter options */
260 /** post-production settings. Depricated, but here for upwards compat (initialized to 1) */
261 float postmul, postgamma, posthue, postsat;
263 /* Dither noise intensity */
264 float dither_intensity;
266 /* Bake Render options */
267 short bake_osa, bake_filter, bake_mode, bake_flag;
268 short bake_normal_space, bpad;
271 /* yafray: global panel params. TODO: move elsewhere */
272 short GIquality, GIcache, GImethod, GIphotons, GIdirect;
273 short YF_AA, YFexportxml, YF_nobump, YF_clamprgb, yfpad1;
274 int GIdepth, GIcausdepth, GIpixelspersample;
275 int GIphotoncount, GImixphotons;
276 float GIphotonradius;
277 int YF_numprocs, YF_raydepth, YF_AApasses, YF_AAsamples;
278 float GIshadowquality, GIrefinement, GIpower, GIindirpower;
279 float YF_gamma, YF_exposure, YF_raybias, YF_AApixelsize, YF_AAthreshold;
281 /* paths to backbufffer, output, ftype */
282 char backbuf[160], pic[160], ftype[160];
286 short stamp_font_id, pad3; /* select one of blenders bitmap fonts */
288 /* stamp info user data. */
289 char stamp_udata[160];
291 /* foreground/background color. */
297 typedef struct GameFraming {
299 char type, pad1, pad2, pad3;
302 #define SCE_GAMEFRAMING_BARS 0
303 #define SCE_GAMEFRAMING_EXTEND 1
304 #define SCE_GAMEFRAMING_SCALE 2
306 typedef struct TimeMarker {
307 struct TimeMarker *next, *prev;
313 typedef struct ImagePaintSettings {
317 } ImagePaintSettings;
319 typedef struct ParticleBrushData {
320 short size, strength; /* commong settings */
321 short step, invert; /* for specific brushes only */
324 typedef struct ParticleEditSettings {
330 ParticleBrushData brush[7]; /* 7 = PE_TOT_BRUSH */
334 } ParticleEditSettings;
336 typedef struct ToolSettings {
337 /* Subdivide Settings */
340 /*Triangle to Quad conversion threshold*/
350 /* Primitive Settings */
355 /* Cylinder - Tube - Circle */
361 float uvcalc_cubesize;
363 short uvcalc_mapalign;
367 short autoik_chainlen;
369 /* Image Paint (8 byte aligned please!) */
370 struct ImagePaintSettings imapaint;
372 /* Particle Editing */
373 struct ParticleEditSettings particle;
375 /* Select Group Threshold */
383 char retopo_paint_tool;
384 char line_div, ellipse_div, retopo_hotspot;
387 char multires_subdiv_type;
389 /* Skeleton generation */
390 short skgen_resolution;
391 float skgen_threshold_internal;
392 float skgen_threshold_external;
393 float skgen_length_ratio;
394 float skgen_length_limit;
395 float skgen_angle_limit;
396 float skgen_correlation_limit;
397 float skgen_symmetry_limit;
400 char skgen_postpro_passes;
401 char skgen_subdivisions[3];
406 /* Used by all brushes to store their properties, which can be directly set
407 by the interface code. Note that not all properties are actually used by
409 typedef struct BrushData
412 char strength, dir; /* Not used for smooth brush */
418 struct SculptSession;
419 typedef struct SculptData
421 /* Data stored only from entering sculptmode until exiting sculptmode */
422 struct SculptSession *session;
424 /* Pointers to all of sculptmodes's textures */
425 struct MTex *mtex[10];
427 /* Settings for each brush */
428 BrushData drawbrush, smoothbrush, pinchbrush, inflatebrush, grabbrush, layerbrush, flattenbrush;
431 /* For the Brush Shape */
441 /* Control tablet input */
442 char tablet_size, tablet_strength;
444 /* Symmetry is separate from the other BrushData because the same
445 settings are always used for all brush types */
449 typedef struct Scene {
451 struct Object *camera;
461 float twcent[3]; /* center for transform widget */
462 float twmin[3], twmax[3]; /* boundbox of selection for transform widget */
466 float editbutsize; /* size of normals */
467 short selectmode; /* for mesh only! */
468 short proportional, prop_mode;
469 short automerge, pad5, pad6, pad7;
473 struct bNodeTree *nodetree;
475 void *ed; /* sequence editor data is allocated here */
478 struct GameFraming framing;
480 struct ToolSettings *toolsettings;
482 /* migrate or replace? depends on some internal things... */
483 /* no, is on the right place (ton) */
485 struct AudioData audio;
487 ScriptLink scriptlink;
491 short jumpframe, pad1;
492 short snap_flag, snap_target;
494 /* none of the dependancy graph vars is mean to be saved */
495 struct DagForest *theDag;
496 short dagisvalid, dagflags;
497 short pad4, recalc; /* recalc = counterpart of ob->recalc */
499 /* Sculptmode data */
500 struct SculptData sculptdata;
504 /* **************** RENDERDATA ********************* */
508 #define R_BACKBUFANIM 2
510 #define R_FRONTBUFANIM 8
514 #define R_SHADOW 0x0002
515 #define R_GAMMA 0x0004
516 #define R_ORTHO 0x0008
517 #define R_ENVMAP 0x0010
518 #define R_EDGE 0x0020
519 #define R_FIELDS 0x0040
520 #define R_FIELDSTILL 0x0080
521 #define R_RADIO 0x0100
522 #define R_BORDER 0x0200
523 #define R_PANORAMA 0x0400
524 #define R_CROP 0x0800
525 #define R_COSMO 0x1000
526 #define R_ODDFIELD 0x2000
527 #define R_MBLUR 0x4000
528 /* unified was here */
529 #define R_RAYTRACE 0x10000
530 /* R_GAUSS is obsolete, but used to retrieve setting from old files */
531 #define R_GAUSS 0x20000
532 /* fbuf obsolete... */
533 #define R_FBUF 0x40000
534 /* threads obsolete... is there for old files */
535 #define R_THREADS 0x80000
536 #define R_SPEED 0x100000
537 #define R_SSS 0x200000
540 #define R_FILTER_BOX 0
541 #define R_FILTER_TENT 1
542 #define R_FILTER_QUAD 2
543 #define R_FILTER_CUBIC 3
544 #define R_FILTER_CATROM 4
545 #define R_FILTER_GAUSS 5
546 #define R_FILTER_MITCH 6
547 #define R_FILTER_FAST_GAUSS 7 /* note, this is only used for nodes at the moment */
549 /* yafray: renderer flag (not only exclusive to yafray) */
554 #define R_DOSEQ 0x0001
555 #define R_BG_RENDER 0x0002
556 /* passepartout is camera option now, keep this for backward compatibility */
557 #define R_PASSEPARTOUT 0x0004
558 #define R_PREVIEWBUTS 0x0008
559 #define R_EXTENSION 0x0010
560 #define R_NODE_PREVIEW 0x0020
561 #define R_DOCOMP 0x0040
562 #define R_COMP_CROP 0x0080
563 #define R_FREE_IMAGE 0x0100
564 #define R_SINGLE_LAYER 0x0200
565 #define R_EXR_TILE_FILE 0x0400
566 #define R_COMP_FREE 0x0800
567 #define R_NO_IMAGE_LOAD 0x1000
568 #define R_NO_TEX 0x2000
569 #define R_STAMP_INFO 0x4000
572 #define R_STAMP_TIME 0x0001
573 #define R_STAMP_FRAME 0x0002
574 #define R_STAMP_DATE 0x0004
575 #define R_STAMP_CAMERA 0x0008
576 #define R_STAMP_SCENE 0x0010
577 #define R_STAMP_NOTE 0x0020
578 #define R_STAMP_DRAW 0x0040 /* draw in the image */
579 #define R_STAMP_MARKER 0x0080
580 #define R_STAMP_FILENAME 0x0100
581 #define R_STAMP_SEQSTRIP 0x0200
585 #define R_ALPHAPREMUL 1
589 #define R_PLANES24 24
590 #define R_PLANES32 32
605 #define R_AVICODEC 18
606 #define R_QUICKTIME 19
612 #define R_FRAMESERVER 25
615 #define R_MULTILAYER 28
618 /* subimtype, flag options for imtype */
619 #define R_OPENEXR_HALF 1
620 #define R_OPENEXR_ZBUF 2
621 #define R_PREVIEW_JPG 4
623 /* bake_mode: same as RE_BAKE_xxx defines */
625 #define R_BAKE_CLEAR 1
627 #define R_BAKE_TO_ACTIVE 4
629 /* bake_normal_space */
630 #define R_BAKE_SPACE_CAMERA 0
631 #define R_BAKE_SPACE_WORLD 1
632 #define R_BAKE_SPACE_OBJECT 2
633 #define R_BAKE_SPACE_TANGENT 3
635 /* **************** SCENE ********************* */
636 #define RAD_PHASE_PATCHES 1
637 #define RAD_PHASE_FACES 2
639 /* base->flag is in DNA_object_types.h */
641 /* scene->snap_flag */
643 /* scene->snap_target */
644 #define SCE_SNAP_TARGET_CLOSEST 0
645 #define SCE_SNAP_TARGET_CENTER 1
646 #define SCE_SNAP_TARGET_MEDIAN 2
648 /* sce->selectmode */
649 #define SCE_SELECT_VERTEX 1 /* for mesh */
650 #define SCE_SELECT_EDGE 2
651 #define SCE_SELECT_FACE 4
653 /* sce->selectmode for particles */
654 #define SCE_SELECT_PATH 1
655 #define SCE_SELECT_POINT 2
656 #define SCE_SELECT_END 4
658 /* sce->recalc (now in use by previewrender) */
659 #define SCE_PRV_CHANGED 1
661 /* sce->prop_mode (proportional falloff) */
662 #define PROP_SMOOTH 0
663 #define PROP_SPHERE 1
668 #define PROP_RANDOM 6
670 /* return flag next_object function */
679 #define AUDIO_SCRUB 4
681 #define FFMPEG_MULTIPLEX_AUDIO 1
682 #define FFMPEG_AUTOSPLIT_OUTPUT 2
684 /* SculptData.flags */
685 #define SCULPT_INPUT_SMOOTH 1
686 #define SCULPT_DRAW_FAST 2
687 #define SCULPT_DRAW_BRUSH 4
688 /* SculptData.brushtype */
690 #define SMOOTH_BRUSH 2
691 #define PINCH_BRUSH 3
692 #define INFLATE_BRUSH 4
694 #define LAYER_BRUSH 6
695 #define FLATTEN_BRUSH 7
696 /* SculptData.texrept */
697 #define SCULPTREPT_DRAG 1
698 #define SCULPTREPT_TILE 2
699 #define SCULPTREPT_3D 3
705 /* toolsettings->imagepaint_flag */
706 #define IMAGEPAINT_DRAWING 1
707 #define IMAGEPAINT_DRAW_TOOL 2
708 #define IMAGEPAINT_DRAW_TOOL_DRAWING 4
710 /* toolsettings->particle flag */
711 #define PE_KEEP_LENGTHS 1
712 #define PE_LOCK_FIRST 2
713 #define PE_DEFLECT_EMITTER 4
714 #define PE_INTERPOLATE_ADDED 8
715 #define PE_SHOW_CHILD 16
716 #define PE_SHOW_TIME 32
717 #define PE_X_MIRROR 64
719 /* toolsetting->particle brushtype */
720 #define PE_BRUSH_NONE -1
721 #define PE_BRUSH_COMB 0
722 #define PE_BRUSH_CUT 1
723 #define PE_BRUSH_LENGTH 2
724 #define PE_BRUSH_PUFF 3
725 #define PE_BRUSH_ADD 4
726 #define PE_BRUSH_WEIGHT 5
727 #define PE_BRUSH_SMOOTH 6
729 /* this must equal ParticleEditSettings.brush array size */
730 #define PE_TOT_BRUSH 7
732 /* toolsettings->retopo_mode */
734 #define RETOPO_PAINT 2
736 /* toolsettings->retopo_paint_tool */
738 #define RETOPO_LINE 2
739 #define RETOPO_ELLIPSE 4
741 /* toolsettings->skgen_options */
742 #define SKGEN_FILTER_INTERNAL 1
743 #define SKGEN_FILTER_EXTERNAL 2
744 #define SKGEN_SYMMETRY 4
745 #define SKGEN_CUT_LENGTH 8
746 #define SKGEN_CUT_ANGLE 16
747 #define SKGEN_CUT_CORRELATION 32
749 #define SKGEN_SUB_LENGTH 0
750 #define SKGEN_SUB_ANGLE 1
751 #define SKGEN_SUB_CORRELATION 2
752 #define SKGEN_SUB_TOTAL 3
754 /* toolsettings->skgen_postpro */
755 #define SKGEN_SMOOTH 0
756 #define SKGEN_AVERAGE 1
757 #define SKGEN_SHARPEN 2