2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
19 * All rights reserved.
21 * The Original Code is: all of this file.
23 * Contributor(s): none yet.
25 * ***** END GPL LICENSE BLOCK *****
28 /** \file DNA_scene_types.h
32 #ifndef __DNA_SCENE_TYPES_H__
33 #define __DNA_SCENE_TYPES_H__
37 /* XXX, temp feature - campbell */
38 #define DURIAN_CAMERA_SWITCH
44 #include "DNA_color_types.h" /* color management */
45 #include "DNA_vec_types.h"
46 #include "DNA_listBase.h"
48 #include "DNA_freestyle_types.h"
49 #include "DNA_gpu_types.h"
50 #include "DNA_userdef_types.h"
68 /* ************************************************************* */
71 /* Base - Wrapper for referencing Objects in a Scene */
73 struct Base *next, *prev;
74 unsigned int lay, selcol;
77 struct Object *object;
80 /* ************************************************************* */
81 /* Output Format Data */
83 typedef struct AviCodecData {
84 void *lpFormat; /* save format */
85 void *lpParms; /* compressor options */
86 unsigned int cbFormat; /* size of lpFormat buffer */
87 unsigned int cbParms; /* size of lpParms buffer */
89 unsigned int fccType; /* stream type, for consistency */
90 unsigned int fccHandler; /* compressor */
91 unsigned int dwKeyFrameEvery; /* keyframe rate */
92 unsigned int dwQuality; /* compress quality 0-10,000 */
93 unsigned int dwBytesPerSecond; /* bytes per second */
94 unsigned int dwFlags; /* flags... see below */
95 unsigned int dwInterleaveEvery; /* for non-video streams only */
98 char avicodecname[128];
101 typedef struct QuicktimeCodecData {
102 /*Old quicktime implementation compatibility fields, read only in 2.5 - deprecated*/
103 void *cdParms; /* codec/compressor options */
104 void *pad; /* padding */
106 unsigned int cdSize; /* size of cdParms buffer */
107 unsigned int pad2; /* padding */
109 char qtcodecname[128];
110 } QuicktimeCodecData;
112 typedef struct QuicktimeCodecSettings {
113 /* Codec settings detailed for 2.5 implementation*/
114 int codecType; /* Types defined in quicktime_export.h */
115 int codecSpatialQuality; /* in 0-100 scale, to be translated in 0-1024 for qt use */
117 /* Settings not available in current QTKit API */
121 int codecTemporalQuality; /* in 0-100 scale, to be translated in 0-1024 for qt use */
122 int minSpatialQuality; /* in 0-100 scale, to be translated in 0-1024 for qt use */
123 int minTemporalQuality; /* in 0-100 scale, to be translated in 0-1024 for qt use */
125 int bitRate; /* bitrate in bps */
127 /* Audio Codec settings */
135 } QuicktimeCodecSettings;
137 typedef struct FFMpegCodecData {
155 IDProperty *properties;
158 /* ************************************************************* */
161 typedef struct AudioData {
162 int mixrate; // 2.5: now in FFMpegCodecData: audio_mixrate
163 float main; // 2.5: now in FFMpegCodecData: audio_volume
164 float speed_of_sound;
165 float doppler_factor;
173 /* *************************************************************** */
177 typedef struct SceneRenderLayer {
178 struct SceneRenderLayer *next, *prev;
180 char name[64]; /* MAX_NAME */
182 struct Material *mat_override;
183 struct Group *light_override;
185 unsigned int lay; /* scene->lay itself has priority over this */
186 unsigned int lay_zmask; /* has to be after lay, this is for Z-masking */
187 unsigned int lay_exclude; /* not used by internal, exclude */
190 int passflag; /* pass_xor has to be after passflag */
194 float pass_alpha_threshold;
196 struct FreestyleConfig freestyleConfig;
200 #define SCE_LAY_SOLID 1
201 #define SCE_LAY_ZTRA 2
202 #define SCE_LAY_HALO 4
203 #define SCE_LAY_EDGE 8
204 #define SCE_LAY_SKY 16
205 #define SCE_LAY_STRAND 32
206 #define SCE_LAY_FRS 64
207 #define SCE_LAY_AO 128
208 /* flags between 256 and 0x8000 are set to 1 already, for future options */
210 #define SCE_LAY_ALL_Z 0x8000
211 #define SCE_LAY_XOR 0x10000
212 #define SCE_LAY_DISABLE 0x20000
213 #define SCE_LAY_ZMASK 0x40000
214 #define SCE_LAY_NEG_ZMASK 0x80000
217 typedef enum ScenePassType {
218 SCE_PASS_COMBINED = (1 << 0),
219 SCE_PASS_Z = (1 << 1),
220 SCE_PASS_RGBA = (1 << 2),
221 SCE_PASS_DIFFUSE = (1 << 3),
222 SCE_PASS_SPEC = (1 << 4),
223 SCE_PASS_SHADOW = (1 << 5),
224 SCE_PASS_AO = (1 << 6),
225 SCE_PASS_REFLECT = (1 << 7),
226 SCE_PASS_NORMAL = (1 << 8),
227 SCE_PASS_VECTOR = (1 << 9),
228 SCE_PASS_REFRACT = (1 << 10),
229 SCE_PASS_INDEXOB = (1 << 11),
230 SCE_PASS_UV = (1 << 12),
231 SCE_PASS_INDIRECT = (1 << 13),
232 SCE_PASS_MIST = (1 << 14),
233 SCE_PASS_RAYHITS = (1 << 15),
234 SCE_PASS_EMIT = (1 << 16),
235 SCE_PASS_ENVIRONMENT = (1 << 17),
236 SCE_PASS_INDEXMA = (1 << 18),
237 SCE_PASS_DIFFUSE_DIRECT = (1 << 19),
238 SCE_PASS_DIFFUSE_INDIRECT = (1 << 20),
239 SCE_PASS_DIFFUSE_COLOR = (1 << 21),
240 SCE_PASS_GLOSSY_DIRECT = (1 << 22),
241 SCE_PASS_GLOSSY_INDIRECT = (1 << 23),
242 SCE_PASS_GLOSSY_COLOR = (1 << 24),
243 SCE_PASS_TRANSM_DIRECT = (1 << 25),
244 SCE_PASS_TRANSM_INDIRECT = (1 << 26),
245 SCE_PASS_TRANSM_COLOR = (1 << 27),
246 SCE_PASS_SUBSURFACE_DIRECT = (1 << 28),
247 SCE_PASS_SUBSURFACE_INDIRECT = (1 << 29),
248 SCE_PASS_SUBSURFACE_COLOR = (1 << 30),
249 SCE_PASS_DEBUG = (1 << 31), /* This is a virtual pass. */
252 /* note, srl->passflag is treestore element 'nr' in outliner, short still... */
254 /* View - MultiView */
255 typedef struct SceneRenderView {
256 struct SceneRenderView *next, *prev;
258 char name[64]; /* MAX_NAME */
259 char suffix[64]; /* MAX_NAME */
268 #define SCE_VIEW_DISABLE (1<<0)
270 /* scene.render.views_format */
272 SCE_VIEWS_FORMAT_STEREO_3D = 0,
273 SCE_VIEWS_FORMAT_MULTIVIEW = 1,
276 /* ImageFormatData.views_output */
278 R_IMF_VIEWS_INDIVIDUAL = 0,
279 R_IMF_VIEWS_STEREO_3D = 1,
280 R_IMF_VIEWS_MULTIVIEW = 2,
283 typedef struct Stereo3dFormat {
285 char display_mode; /* encoding mode */
286 char anaglyph_type; /* anaglyph scheme for the user display */
287 char interlace_type; /* interlace type for the user display */
291 /* Stereo3dFormat.display_mode */
292 typedef enum eStereoDisplayMode {
293 S3D_DISPLAY_ANAGLYPH = 0,
294 S3D_DISPLAY_INTERLACE = 1,
295 S3D_DISPLAY_PAGEFLIP = 2,
296 S3D_DISPLAY_SIDEBYSIDE = 3,
297 S3D_DISPLAY_TOPBOTTOM = 4,
298 } eStereoDisplayMode;
300 /* Stereo3dFormat.flag */
301 typedef enum eStereo3dFlag {
302 S3D_INTERLACE_SWAP = (1 << 0),
303 S3D_SIDEBYSIDE_CROSSEYED = (1 << 1),
304 S3D_SQUEEZED_FRAME = (1 << 2),
307 /* Stereo3dFormat.anaglyph_type */
308 typedef enum eStereo3dAnaglyphType {
309 S3D_ANAGLYPH_REDCYAN = 0,
310 S3D_ANAGLYPH_GREENMAGENTA = 1,
311 S3D_ANAGLYPH_YELLOWBLUE = 2,
312 } eStereo3dAnaglyphType;
314 /* Stereo3dFormat.interlace_type */
315 typedef enum eStereo3dInterlaceType {
316 S3D_INTERLACE_ROW = 0,
317 S3D_INTERLACE_COLUMN = 1,
318 S3D_INTERLACE_CHECKERBOARD = 2,
319 } eStereo3dInterlaceType;
321 /* *************************************************************** */
323 /* Generic image format settings,
324 * this is used for NodeImageFile and IMAGE_OT_save_as operator too.
326 * note: its a bit strange that even though this is an image format struct
327 * the imtype can still be used to select video formats.
328 * RNA ensures these enum's are only selectable for render output.
330 typedef struct ImageFormatData {
331 char imtype; /* R_IMF_IMTYPE_PNG, R_... */
332 /* note, video types should only ever be set from this
333 * structure when used from RenderData */
334 char depth; /* bits per channel, R_IMF_CHAN_DEPTH_8 -> 32,
335 * not a flag, only set 1 at a time */
337 char planes; /* - R_IMF_PLANES_BW, R_IMF_PLANES_RGB, R_IMF_PLANES_RGBA */
338 char flag; /* generic options for all image types, alpha zbuffer */
340 char quality; /* (0 - 100), eg: jpeg quality */
341 char compress; /* (0 - 100), eg: png compression */
344 /* --- format specific --- */
351 short cineon_white, cineon_black;
365 Stereo3dFormat stereo3d_format;
367 /* color management */
368 ColorManagedViewSettings view_settings;
369 ColorManagedDisplaySettings display_settings;
373 /* ImageFormatData.imtype */
374 #define R_IMF_IMTYPE_TARGA 0
375 #define R_IMF_IMTYPE_IRIS 1
376 /* #define R_HAMX 2 */ /* hamx is nomore */
377 /* #define R_FTYPE 3 */ /* ftype is nomore */
378 #define R_IMF_IMTYPE_JPEG90 4
379 /* #define R_MOVIE 5 */ /* movie is nomore */
380 #define R_IMF_IMTYPE_IRIZ 7
381 #define R_IMF_IMTYPE_RAWTGA 14
382 #define R_IMF_IMTYPE_AVIRAW 15
383 #define R_IMF_IMTYPE_AVIJPEG 16
384 #define R_IMF_IMTYPE_PNG 17
385 /* #define R_IMF_IMTYPE_AVICODEC 18 */ /* avicodec is nomore */
386 #define R_IMF_IMTYPE_QUICKTIME 19
387 #define R_IMF_IMTYPE_BMP 20
388 #define R_IMF_IMTYPE_RADHDR 21
389 #define R_IMF_IMTYPE_TIFF 22
390 #define R_IMF_IMTYPE_OPENEXR 23
391 #define R_IMF_IMTYPE_FFMPEG 24
392 #define R_IMF_IMTYPE_FRAMESERVER 25
393 #define R_IMF_IMTYPE_CINEON 26
394 #define R_IMF_IMTYPE_DPX 27
395 #define R_IMF_IMTYPE_MULTILAYER 28
396 #define R_IMF_IMTYPE_DDS 29
397 #define R_IMF_IMTYPE_JP2 30
398 #define R_IMF_IMTYPE_H264 31
399 #define R_IMF_IMTYPE_XVID 32
400 #define R_IMF_IMTYPE_THEORA 33
401 #define R_IMF_IMTYPE_PSD 34
403 #define R_IMF_IMTYPE_INVALID 255
405 /* ImageFormatData.flag */
406 #define R_IMF_FLAG_ZBUF (1<<0) /* was R_OPENEXR_ZBUF */
407 #define R_IMF_FLAG_PREVIEW_JPG (1<<1) /* was R_PREVIEW_JPG */
409 /* return values from BKE_imtype_valid_depths, note this is depts per channel */
410 #define R_IMF_CHAN_DEPTH_1 (1<<0) /* 1bits (unused) */
411 #define R_IMF_CHAN_DEPTH_8 (1<<1) /* 8bits (default) */
412 #define R_IMF_CHAN_DEPTH_10 (1<<2) /* 10bits (uncommon, Cineon/DPX support) */
413 #define R_IMF_CHAN_DEPTH_12 (1<<3) /* 12bits (uncommon, jp2/DPX support) */
414 #define R_IMF_CHAN_DEPTH_16 (1<<4) /* 16bits (tiff, halff float exr) */
415 #define R_IMF_CHAN_DEPTH_24 (1<<5) /* 24bits (unused) */
416 #define R_IMF_CHAN_DEPTH_32 (1<<6) /* 32bits (full float exr) */
418 /* ImageFormatData.planes */
419 #define R_IMF_PLANES_RGB 24
420 #define R_IMF_PLANES_RGBA 32
421 #define R_IMF_PLANES_BW 8
423 /* ImageFormatData.exr_codec */
424 #define R_IMF_EXR_CODEC_NONE 0
425 #define R_IMF_EXR_CODEC_PXR24 1
426 #define R_IMF_EXR_CODEC_ZIP 2
427 #define R_IMF_EXR_CODEC_PIZ 3
428 #define R_IMF_EXR_CODEC_RLE 4
429 #define R_IMF_EXR_CODEC_ZIPS 5
430 #define R_IMF_EXR_CODEC_B44 6
431 #define R_IMF_EXR_CODEC_B44A 7
432 #define R_IMF_EXR_CODEC_DWAA 8
433 #define R_IMF_EXR_CODEC_DWAB 9
434 #define R_IMF_EXR_CODEC_MAX 10
436 /* ImageFormatData.jp2_flag */
437 #define R_IMF_JP2_FLAG_YCC (1<<0) /* when disabled use RGB */ /* was R_JPEG2K_YCC */
438 #define R_IMF_JP2_FLAG_CINE_PRESET (1<<1) /* was R_JPEG2K_CINE_PRESET */
439 #define R_IMF_JP2_FLAG_CINE_48 (1<<2) /* was R_JPEG2K_CINE_48FPS */
441 /* ImageFormatData.jp2_codec */
442 #define R_IMF_JP2_CODEC_JP2 0
443 #define R_IMF_JP2_CODEC_J2K 1
445 /* ImageFormatData.cineon_flag */
446 #define R_IMF_CINEON_FLAG_LOG (1<<0) /* was R_CINEON_LOG */
448 /* ImageFormatData.tiff_codec */
450 R_IMF_TIFF_CODEC_DEFLATE = 0,
451 R_IMF_TIFF_CODEC_LZW = 1,
452 R_IMF_TIFF_CODEC_PACKBITS = 2,
453 R_IMF_TIFF_CODEC_NONE = 3,
456 typedef struct BakeData {
457 struct ImageFormatData im_format;
459 char filepath[1024]; /* FILE_MAX */
464 float cage_extrusion;
467 char normal_swizzle[3];
473 char cage[64]; /* MAX_NAME */
476 /* (char) normal_swizzle */
477 typedef enum BakeNormalSwizzle {
486 /* (char) save_mode */
487 typedef enum BakeSaveMode {
488 R_BAKE_SAVE_INTERNAL = 0,
489 R_BAKE_SAVE_EXTERNAL = 1,
492 /* bake->pass_filter */
493 typedef enum BakePassFilter {
494 R_BAKE_PASS_FILTER_NONE = 0,
495 R_BAKE_PASS_FILTER_AO = (1 << 0),
496 R_BAKE_PASS_FILTER_EMIT = (1 << 1),
497 R_BAKE_PASS_FILTER_DIFFUSE = (1 << 2),
498 R_BAKE_PASS_FILTER_GLOSSY = (1 << 3),
499 R_BAKE_PASS_FILTER_TRANSM = (1 << 4),
500 R_BAKE_PASS_FILTER_SUBSURFACE = (1 << 5),
501 R_BAKE_PASS_FILTER_DIRECT = (1 << 6),
502 R_BAKE_PASS_FILTER_INDIRECT = (1 << 7),
503 R_BAKE_PASS_FILTER_COLOR = (1 << 8),
506 #define R_BAKE_PASS_FILTER_ALL (~0)
508 /* *************************************************************** */
511 typedef struct RenderData {
512 struct ImageFormatData im_format;
514 struct AviCodecData *avicodecdata;
515 struct QuicktimeCodecData *qtcodecdata;
516 struct QuicktimeCodecSettings qtcodecsettings;
517 struct FFMpegCodecData ffcodecdata;
519 int cfra, sfra, efra; /* frames as in 'images' */
520 float subframe; /* subframe offset from cfra, in 0.0-1.0 */
521 int psfra, pefra; /* start+end frames of preview range */
523 int images, framapto;
526 float framelen, blurfac;
528 /** For UR edge rendering: give the edges this color */
529 float edgeR, edgeG, edgeB;
532 /* standalone player */ // XXX deprecated since 2.5
533 short fullscreen DNA_DEPRECATED, xplay DNA_DEPRECATED, yplay DNA_DEPRECATED;
534 short freqplay DNA_DEPRECATED;
535 /* standalone player */ // XXX deprecated since 2.5
536 short depth DNA_DEPRECATED, attrib DNA_DEPRECATED;
539 int frame_step; /* frames to jump during render/playback */
541 short stereomode DNA_DEPRECATED; /* standalone player stereo settings */ // XXX deprecated since 2.5
543 short dimensionspreset; /* for the dimensions presets menu */
545 short filtertype; /* filter is box, tent, gauss, mitch, etc */
547 short size; /* size in % */
549 short maximsize DNA_DEPRECATED; /* max in Kb */
555 * The desired number of pixels in the x direction
559 * The desired number of pixels in the y direction
564 * The number of part to use in the x direction
566 short xparts DNA_DEPRECATED;
568 * The number of part to use in the y direction
570 short yparts DNA_DEPRECATED;
573 * render tile dimensions
577 short planes DNA_DEPRECATED, imtype DNA_DEPRECATED, subimtype DNA_DEPRECATED, quality DNA_DEPRECATED; /*deprecated!*/
580 * Render to image editor, fullscreen or to new window.
583 char use_lock_interface;
587 * Flags for render settings. Use bit-masking to access the settings.
592 * Flags for render settings. Use bit-masking to access the settings.
597 * Flags for raytrace settings. Use bit-masking to access the settings.
599 int raytrace_options;
602 * Raytrace acceleration structure
604 short raytrace_structure;
608 /* octree resolution */
613 * What to do with the sky/background. Picks sky/premul/key
614 * blending for the background
619 * The number of samples to use per pixel.
623 short frs_sec, edgeint;
626 /* safety, border and display rect */
630 /* information on different layers to be rendered */
634 /* number of mblur samples */
638 * Adjustment factors for the aspect ratio in the x direction, was a short in 2.45
645 * Value used to define filter size for all filter options */
649 /* color management settings - color profiles, gamma correction, etc */
652 /** post-production settings. deprecated, but here for upwards compat (initialized to 1) */
653 float postgamma, posthue, postsat;
655 /* Dither noise intensity */
656 float dither_intensity;
658 /* Bake Render options */
659 short bake_osa, bake_filter, bake_mode, bake_flag;
660 short bake_normal_space, bake_quad_split;
661 float bake_maxdist, bake_biasdist;
662 short bake_samples, bake_pad;
663 float bake_user_scale, bake_pad1;
665 /* path to render output */
666 char pic[1024]; /* 1024 = FILE_MAX */
670 short stamp_font_id, pad3; /* select one of blenders bitmap fonts */
672 /* stamp info user data. */
673 char stamp_udata[768];
675 /* foreground/background color. */
679 /* sequencer options */
682 char seq_flag; /* flag use for sequence render/draw */
685 /* render simplify */
687 short simplify_subsurf;
688 short simplify_subsurf_render;
689 short simplify_shadowsamples, pad9;
690 float simplify_particles;
691 float simplify_particles_render;
692 float simplify_aosss;
695 short cineonwhite DNA_DEPRECATED, cineonblack DNA_DEPRECATED; /*deprecated*/
696 float cineongamma DNA_DEPRECATED; /*deprecated*/
699 short jp2_preset DNA_DEPRECATED, jp2_depth DNA_DEPRECATED; /*deprecated*/
702 /* Dome variables */ // XXX deprecated since 2.5
703 short domeres DNA_DEPRECATED, domemode DNA_DEPRECATED; // XXX deprecated since 2.5
704 short domeangle DNA_DEPRECATED, dometilt DNA_DEPRECATED; // XXX deprecated since 2.5
705 float domeresbuf DNA_DEPRECATED; // XXX deprecated since 2.5
707 struct Text *dometext DNA_DEPRECATED; // XXX deprecated since 2.5
709 /* Freestyle line thickness options */
710 int line_thickness_mode;
711 float unit_line_thickness; /* in pixels */
717 struct BakeData bake;
719 int preview_start_resolution;
721 /* Type of the debug pass to use.
722 * Only used when built with debug passes support.
724 short debug_pass_type;
729 ListBase views; /* SceneRenderView */
734 /* Motion blur shutter */
735 struct CurveMapping mblur_shutter_curve;
738 /* *************************************************************** */
739 /* Render Conversion/Simplfication Settings */
741 /* control render convert and shading engine */
742 typedef struct RenderProfile {
743 struct RenderProfile *next, *prev;
748 short shadbufsample_max;
751 float ao_error, pad2;
755 /* *************************************************************** */
756 /* Game Engine - Dome */
758 typedef struct GameDome {
762 struct Text *warptext;
765 #define DOME_FISHEYE 1
766 #define DOME_TRUNCATED_FRONT 2
767 #define DOME_TRUNCATED_REAR 3
768 #define DOME_ENVMAP 4
769 #define DOME_PANORAM_SPH 5
770 #define DOME_NUM_MODES 6
772 /* *************************************************************** */
775 typedef struct GameFraming {
777 char type, pad1, pad2, pad3;
780 #define SCE_GAMEFRAMING_BARS 0
781 #define SCE_GAMEFRAMING_EXTEND 1
782 #define SCE_GAMEFRAMING_SCALE 2
784 typedef struct RecastData {
794 float regionmergesize;
796 float detailsampledist;
797 float detailsamplemaxerror;
801 typedef struct GameData {
803 /* standalone player */
804 struct GameFraming framing;
805 short playerflag, xplay, yplay, freqplay;
806 short depth, attrib, rt1, rt2;
807 short aasamples, pad4[3];
809 /* stereo/dome mode */
810 struct GameDome dome;
811 short stereoflag, stereomode;
813 RecastData recastData;
816 /* physics (it was in world)*/
817 float gravity; /*Gravitation constant for the game world*/
820 * Radius of the activity bubble, in Manhattan length. Objects
821 * outside the box are activity-culled. */
822 float activityBoxRadius;
825 * bit 3: (gameengine): Activity culling is enabled.
826 * bit 5: (gameengine) : enable Bullet DBVT tree for view frustum culling
830 short occlusionRes; /* resolution of occlusion Z buffer in pixel */
833 short vsync; /* Controls vsync: off, on, or adaptive (if supported) */
834 short ticrate, maxlogicstep, physubstep, maxphystep;
835 short obstacleSimulation;
836 short raster_storage;
838 float deactivationtime, lineardeactthreshold, angulardeactthreshold;
842 int scehysteresis, pad5;
846 #define STEREO_NOSTEREO 1
847 #define STEREO_ENABLED 2
848 #define STEREO_DOME 3
850 //#define STEREO_NOSTEREO 1
851 #define STEREO_QUADBUFFERED 2
852 #define STEREO_ABOVEBELOW 3
853 #define STEREO_INTERLACED 4
854 #define STEREO_ANAGLYPH 5
855 #define STEREO_SIDEBYSIDE 6
856 #define STEREO_VINTERLACE 7
857 //#define STEREO_DOME 8
858 #define STEREO_3DTVTOPBOTTOM 9
862 #define WOPHY_BULLET 5
864 /* obstacleSimulation */
865 #define OBSTSIMULATION_NONE 0
866 #define OBSTSIMULATION_TOI_rays 1
867 #define OBSTSIMULATION_TOI_cells 2
870 #define RAS_STORE_AUTO 0
871 #define RAS_STORE_IMMEDIATE 1
872 #define RAS_STORE_VA 2
873 #define RAS_STORE_VBO 3
878 #define VSYNC_ADAPTIVE 2
881 #define GAME_RESTRICT_ANIM_UPDATES (1 << 0)
882 #define GAME_ENABLE_ALL_FRAMES (1 << 1)
883 #define GAME_SHOW_DEBUG_PROPS (1 << 2)
884 #define GAME_SHOW_FRAMERATE (1 << 3)
885 #define GAME_SHOW_PHYSICS (1 << 4)
886 #define GAME_DISPLAY_LISTS (1 << 5)
887 #define GAME_GLSL_NO_LIGHTS (1 << 6)
888 #define GAME_GLSL_NO_SHADERS (1 << 7)
889 #define GAME_GLSL_NO_SHADOWS (1 << 8)
890 #define GAME_GLSL_NO_RAMPS (1 << 9)
891 #define GAME_GLSL_NO_NODES (1 << 10)
892 #define GAME_GLSL_NO_EXTRA_TEX (1 << 11)
893 #define GAME_IGNORE_DEPRECATION_WARNINGS (1 << 12)
894 #define GAME_ENABLE_ANIMATION_RECORD (1 << 13)
895 #define GAME_SHOW_MOUSE (1 << 14)
896 #define GAME_GLSL_NO_COLOR_MANAGEMENT (1 << 15)
897 #define GAME_SHOW_OBSTACLE_SIMULATION (1 << 16)
898 #define GAME_NO_MATERIAL_CACHING (1 << 17)
899 /* Note: GameData.flag is now an int (max 32 flags). A short could only take 16 flags */
901 /* GameData.playerflag */
902 #define GAME_PLAYER_FULLSCREEN (1 << 0)
903 #define GAME_PLAYER_DESKTOP_RESOLUTION (1 << 1)
905 /* GameData.matmode */
907 #ifdef DNA_DEPRECATED
908 GAME_MAT_TEXFACE = 0, /* deprecated */
910 GAME_MAT_MULTITEX = 1,
914 /* GameData.lodflag */
915 #define SCE_LOD_USE_HYST (1 << 0)
918 #define UV_SCULPT_LOCK_BORDERS 1
919 #define UV_SCULPT_ALL_ISLANDS 2
921 #define UV_SCULPT_TOOL_PINCH 1
922 #define UV_SCULPT_TOOL_RELAX 2
923 #define UV_SCULPT_TOOL_GRAB 3
925 #define UV_SCULPT_TOOL_RELAX_LAPLACIAN 1
926 #define UV_SCULPT_TOOL_RELAX_HC 2
929 #define STEREO_RIGHT_NAME "right"
930 #define STEREO_LEFT_NAME "left"
931 #define STEREO_RIGHT_SUFFIX "_R"
932 #define STEREO_LEFT_SUFFIX "_L"
934 typedef enum StereoViews {
941 /* *************************************************************** */
944 typedef struct TimeMarker {
945 struct TimeMarker *next, *prev;
949 struct Object *camera;
952 /* *************************************************************** */
953 /* Paint Mode/Tool Data */
955 #define PAINT_MAX_INPUT_SAMPLES 64
957 /* Paint Tool Base */
958 typedef struct Paint {
960 struct Palette *palette;
961 struct CurveMapping *cavity_curve; /* cavity curve */
963 /* WM Paint cursor */
965 unsigned char paint_cursor_col[4];
967 /* enum PaintFlags */
970 /* Paint stroke can use up to PAINT_MAX_INPUT_SAMPLES inputs to
971 * smooth the stroke */
972 int num_input_samples;
974 /* flags used for symmetry */
977 float tile_offset[3];
981 /* ------------------------------------------- */
984 /* Texture/Image Editor */
985 typedef struct ImagePaintSettings {
988 short flag, missing_data;
990 /* for projection painting only */
991 short seam_bleed, normal_angle;
992 short screen_grab_size[2]; /* capture size for re-projection */
994 int mode; /* mode used for texture painting */
996 void *paintcursor; /* wm handle */
997 struct Image *stencil; /* workaround until we support true layer masks */
998 struct Image *clone; /* clone layer for image mode for projective texture painting */
999 struct Image *canvas; /* canvas when the explicit system is used for painting */
1000 float stencil_col[3];
1001 float dither; /* dither amount used when painting on byte images */
1002 } ImagePaintSettings;
1004 /* ------------------------------------------- */
1007 /* Settings for a Particle Editing Brush */
1008 typedef struct ParticleBrushData {
1009 short size; /* common setting */
1010 short step, invert, count; /* for specific brushes only */
1013 } ParticleBrushData;
1015 /* Particle Edit Mode Settings */
1016 typedef struct ParticleEditSettings {
1022 ParticleBrushData brush[7]; /* 7 = PE_TOT_BRUSH */
1023 void *paintcursor; /* runtime */
1025 float emitterdist, rt;
1030 int draw_step, fade_frames;
1032 struct Scene *scene;
1033 struct Object *object;
1034 struct Object *shape_object;
1035 } ParticleEditSettings;
1037 /* ------------------------------------------- */
1041 typedef struct Sculpt {
1044 /* For rotating around a pivot point */
1045 //float pivot[3]; XXX not used?
1048 /* Control tablet input */
1049 //char tablet_size, tablet_strength; XXX not used?
1052 /* Maximum edge length for dynamic topology sculpting (in pixels) */
1055 /* Direction used for SCULPT_OT_symmetrize operator */
1056 int symmetrize_direction;
1058 /* gravity factor for sculpting */
1059 float gravity_factor;
1061 /* scale for constant detail size */
1062 float constant_detail;
1063 float detail_percent;
1066 struct Object *gravity_object;
1069 typedef struct UvSculpt {
1073 /* ------------------------------------------- */
1077 typedef struct VPaint {
1081 int tot; /* allocation size of prev buffers */
1082 unsigned int *vpaint_prev; /* previous mesh colors */
1083 struct MDeformVert *wpaint_prev; /* previous vertex weights */
1085 void *paintcursor; /* wm handle */
1090 // VP_COLINDEX = (1 << 0), /* only paint onto active material*/ /* deprecated since before 2.49 */
1091 // VP_AREA = (1 << 1), /* deprecated since 2.70 */
1092 VP_NORMALS = (1 << 3),
1093 VP_SPRAY = (1 << 4),
1094 // VP_MIRROR_X = (1 << 5), /* deprecated in 2.5x use (me->editflag & ME_EDIT_MIRROR_X) */
1095 VP_ONLYVGROUP = (1 << 7) /* weight paint only */
1098 /* ------------------------------------------- */
1099 /* GPencil Stroke Sculpting */
1102 typedef enum eGP_EditBrush_Types {
1103 GP_EDITBRUSH_TYPE_SMOOTH = 0,
1104 GP_EDITBRUSH_TYPE_THICKNESS = 1,
1105 GP_EDITBRUSH_TYPE_GRAB = 2,
1106 GP_EDITBRUSH_TYPE_PUSH = 3,
1107 GP_EDITBRUSH_TYPE_TWIST = 4,
1108 GP_EDITBRUSH_TYPE_PINCH = 5,
1109 GP_EDITBRUSH_TYPE_RANDOMIZE = 6,
1110 GP_EDITBRUSH_TYPE_SUBDIVIDE = 7,
1111 GP_EDITBRUSH_TYPE_SIMPLIFY = 8,
1112 GP_EDITBRUSH_TYPE_CLONE = 9,
1114 /* !!! Update GP_EditBrush_Data brush[###]; below !!! */
1115 TOT_GP_EDITBRUSH_TYPES
1116 } eGP_EditBrush_Types;
1119 /* Settings for a GPencil Stroke Sculpting Brush */
1120 typedef struct GP_EditBrush_Data {
1121 short size; /* radius of brush */
1122 short flag; /* eGP_EditBrush_Flag */
1123 float strength; /* strength of effect */
1124 } GP_EditBrush_Data;
1126 /* GP_EditBrush_Data.flag */
1127 typedef enum eGP_EditBrush_Flag {
1128 /* invert the effect of the brush */
1129 GP_EDITBRUSH_FLAG_INVERT = (1 << 0),
1130 /* adjust strength using pen pressure */
1131 GP_EDITBRUSH_FLAG_USE_PRESSURE = (1 << 1),
1133 /* strength of brush falls off with distance from cursor */
1134 GP_EDITBRUSH_FLAG_USE_FALLOFF = (1 << 2),
1136 /* smooth brush affects pressure values as well */
1137 GP_EDITBRUSH_FLAG_SMOOTH_PRESSURE = (1 << 3)
1138 } eGP_EditBrush_Flag;
1142 /* GPencil Stroke Sculpting Settings */
1143 typedef struct GP_BrushEdit_Settings {
1144 GP_EditBrush_Data brush[10]; /* TOT_GP_EDITBRUSH_TYPES */
1145 void *paintcursor; /* runtime */
1147 int brushtype; /* eGP_EditBrush_Types */
1148 int flag; /* eGP_BrushEdit_SettingsFlag */
1149 } GP_BrushEdit_Settings;
1151 /* GP_BrushEdit_Settings.flag */
1152 typedef enum eGP_BrushEdit_SettingsFlag {
1153 /* only affect selected points */
1154 GP_BRUSHEDIT_FLAG_SELECT_MASK = (1 << 0)
1155 } eGP_BrushEdit_SettingsFlag;
1157 /* *************************************************************** */
1158 /* Transform Orientations */
1160 typedef struct TransformOrientation {
1161 struct TransformOrientation *next, *prev;
1162 char name[64]; /* MAX_NAME */
1165 } TransformOrientation;
1167 /* *************************************************************** */
1168 /* Unified Paint Settings
1171 /* These settings can override the equivalent fields in the active
1172 * Brush for any paint mode; the flag field controls whether these
1173 * values are used */
1174 typedef struct UnifiedPaintSettings {
1175 /* unified radius of brush in pixels */
1178 /* unified radius of brush in Blender units */
1179 float unprojected_radius;
1181 /* unified strength of brush */
1184 /* unified brush weight, [0, 1] */
1187 /* unified brush color */
1189 /* unified brush secondary color */
1190 float secondary_rgb[3];
1192 /* user preferences for sculpt and paint */
1197 /* record movement of mouse so that rake can start at an intuitive angle */
1199 float last_rake_angle;
1201 int last_stroke_valid;
1202 float average_stroke_accum[3];
1203 int average_stroke_counter;
1206 float brush_rotation;
1207 float brush_rotation_sec;
1209 /*********************************************************************************
1210 * all data below are used to communicate with cursor drawing and tex sampling *
1211 *********************************************************************************/
1214 float overlap_factor; /* normalization factor due to accumulated value of curve along spacing.
1215 * Calculated when brush spacing changes to dampen strength of stroke
1216 * if space attenuation is used*/
1218 /* check is there an ongoing stroke right now */
1222 char do_linear_conversion;
1224 /* store last location of stroke or whether the mesh was hit. Valid only while stroke is active */
1225 float last_location[3];
1228 float anchored_initial_mouse[2];
1230 /* radius of brush, premultiplied with pressure.
1231 * In case of anchored brushes contains the anchored radius */
1234 /* drawing pressure */
1235 float size_pressure_value;
1237 /* position of mouse, used to sample the texture */
1240 /* position of mouse, used to sample the mask texture */
1241 float mask_tex_mouse[2];
1243 /* ColorSpace cache to avoid locking up during sampling */
1244 struct ColorSpace *colorspace;
1245 } UnifiedPaintSettings;
1248 UNIFIED_PAINT_SIZE = (1 << 0),
1249 UNIFIED_PAINT_ALPHA = (1 << 1),
1250 UNIFIED_PAINT_WEIGHT = (1 << 5),
1251 UNIFIED_PAINT_COLOR = (1 << 6),
1253 /* only used if unified size is enabled, mirrors the brush flags
1254 * BRUSH_LOCK_SIZE and BRUSH_SIZE_PRESSURE */
1255 UNIFIED_PAINT_BRUSH_LOCK_SIZE = (1 << 2),
1256 UNIFIED_PAINT_BRUSH_SIZE_PRESSURE = (1 << 3),
1258 /* only used if unified alpha is enabled, mirrors the brush flag
1259 * BRUSH_ALPHA_PRESSURE */
1260 UNIFIED_PAINT_BRUSH_ALPHA_PRESSURE = (1 << 4)
1261 } UnifiedPaintSettingsFlags;
1263 /* *************************************************************** */
1266 /* Stats for Meshes */
1267 typedef struct MeshStatVis {
1273 float overhang_min, overhang_max;
1276 float thickness_min, thickness_max;
1277 char thickness_samples;
1281 float distort_min, distort_max;
1284 float sharp_min, sharp_max;
1288 /* *************************************************************** */
1291 typedef struct ToolSettings {
1292 VPaint *vpaint; /* vertex paint */
1293 VPaint *wpaint; /* weight paint */
1295 UvSculpt *uvsculpt; /* uv smooth */
1297 /* Vertex group weight - used only for editmode, not weight
1299 float vgroup_weight;
1301 float doublimit; /* remove doubles limit */
1302 float normalsize; /* size of normals */
1305 /* Selection Mode for Mesh */
1308 /* UV Calculation */
1314 float uvcalc_margin;
1317 short autoik_chainlen; /* runtime only */
1320 char gpencil_flags; /* flags/options for how the tool works */
1321 char gpencil_src; /* for main 3D view Grease Pencil, where data comes from */
1323 char gpencil_v3d_align; /* stroke placement settings: 3D View */
1324 char gpencil_v2d_align; /* : General 2D Editor */
1325 char gpencil_seq_align; /* : Sequencer Preview */
1326 char gpencil_ima_align; /* : Image Editor */
1328 /* Grease Pencil Sculpt */
1329 struct GP_BrushEdit_Settings gp_sculpt;
1331 /* Image Paint (8 byttse aligned please!) */
1332 struct ImagePaintSettings imapaint;
1334 /* Particle Editing */
1335 struct ParticleEditSettings particle;
1337 /* Transform Proportional Area of Effect */
1338 float proportional_size;
1340 /* Select Group Threshold */
1341 float select_thresh;
1343 /* Auto-Keying Mode */
1344 short autokey_mode, autokey_flag; /* defines in DNA_userdef_types.h */
1347 char multires_subdiv_type;
1350 /* Skeleton generation */
1351 short skgen_resolution;
1352 float skgen_threshold_internal;
1353 float skgen_threshold_external;
1354 float skgen_length_ratio;
1355 float skgen_length_limit;
1356 float skgen_angle_limit;
1357 float skgen_correlation_limit;
1358 float skgen_symmetry_limit;
1359 float skgen_retarget_angle_weight;
1360 float skgen_retarget_length_weight;
1361 float skgen_retarget_distance_weight;
1362 short skgen_options;
1364 char skgen_postpro_passes;
1365 char skgen_subdivisions[3];
1366 char skgen_multi_level;
1368 /* Skeleton Sketching */
1369 struct Object *skgen_template;
1370 char bone_sketching;
1371 char bone_sketching_convert;
1372 char skgen_subdivision_number;
1373 char skgen_retarget_options;
1374 char skgen_retarget_roll;
1375 char skgen_side_string[8];
1376 char skgen_num_string[8];
1378 /* Alt+RMB option */
1380 char edge_mode_live_unwrap;
1383 char snap_mode, snap_node_mode;
1385 short snap_flag, snap_target;
1386 short proportional, prop_mode;
1387 char proportional_objects; /* proportional edit, object mode */
1388 char proportional_mask; /* proportional edit, mask editing */
1389 char proportional_action; /* proportional edit, action editor */
1390 char proportional_fcurve; /* proportional edit, graph editor */
1391 char lock_markers; /* lock marker editing */
1394 char auto_normalize; /*auto normalizing mode in wpaint*/
1395 char multipaint; /* paint multiple bones in wpaint */
1397 char vgroupsubset; /* subset selection filter in wpaint */
1401 int uv_sculpt_settings;
1403 int uv_relax_method;
1404 /* XXX: these sculpt_paint_* fields are deprecated, use the
1405 * unified_paint_settings field instead! */
1406 short sculpt_paint_settings DNA_DEPRECATED; short pad5;
1407 int sculpt_paint_unified_size DNA_DEPRECATED;
1408 float sculpt_paint_unified_unprojected_radius DNA_DEPRECATED;
1409 float sculpt_paint_unified_alpha DNA_DEPRECATED;
1411 /* Unified Paint Settings */
1412 struct UnifiedPaintSettings unified_paint_settings;
1414 struct MeshStatVis statvis;
1417 /* *************************************************************** */
1418 /* Assorted Scene Data */
1420 /* ------------------------------------------- */
1421 /* Stats (show in Info header) */
1423 typedef struct bStats {
1424 /* scene totals for visible layers */
1425 int totobj, totlamp, totobjsel, totcurve, totmesh, totarmature;
1426 int totvert, totface;
1429 /* ------------------------------------------- */
1432 typedef struct UnitSettings {
1433 /* Display/Editing unit options for each scene */
1434 float scale_length; /* maybe have other unit conversions? */
1435 char system; /* imperial, metric etc */
1436 char system_rotation; /* not implemented as a proper unit system yet */
1440 /* ------------------------------------------- */
1441 /* Global/Common Physics Settings */
1443 typedef struct PhysicsSettings {
1445 int flag, quick_cache_step, rt;
1448 /* ------------------------------------------- */
1449 /* Safe Area options used in Camera View & VSE
1451 typedef struct DisplaySafeAreas {
1452 /* each value represents the (x,y) margins as a multiplier.
1453 * 'center' in this context is just the name for a different kind of safe-area */
1455 float title[2]; /* Title Safe */
1456 float action[2]; /* Image/Graphics Safe */
1458 /* use for alternate aspect ratio */
1459 float title_center[2];
1460 float action_center[2];
1463 /* *************************************************************** */
1464 /* Scene ID-Block */
1466 typedef struct Scene {
1468 struct AnimData *adt; /* animation data (must be immediately after id for utilities to use it) */
1470 struct Object *camera;
1471 struct World *world;
1476 struct Base *basact; /* active base */
1477 struct Object *obedit; /* name replaces old G.obedit */
1479 float cursor[3]; /* 3d cursor location */
1480 float twcent[3]; /* center for transform widget */
1481 float twmin[3], twmax[3]; /* boundbox of selection for transform widget */
1483 unsigned int lay; /* bitflags for layer visibility */
1484 int layact; /* active layer */
1485 unsigned int lay_updated; /* runtime flag, has layer ever been updated since load? */
1487 short flag; /* various settings */
1492 struct bNodeTree *nodetree;
1494 struct Editing *ed; /* sequence editor data is allocated here */
1496 struct ToolSettings *toolsettings; /* default allocated now */
1497 struct SceneStats *stats; /* default allocated now */
1498 struct DisplaySafeAreas safe_areas;
1500 /* migrate or replace? depends on some internal things... */
1501 /* no, is on the right place (ton) */
1502 struct RenderData r;
1503 struct AudioData audio;
1506 ListBase transform_spaces;
1509 void *playback_handle;
1510 void *sound_scrub_handle;
1511 void *speaker_handles;
1513 void *fps_info; /* (runtime) info/cache used for presenting playback framerate info to the user */
1515 /* none of the dependency graph vars is mean to be saved */
1516 struct Depsgraph *depsgraph;
1518 struct DagForest *theDag;
1522 /* User-Defined KeyingSets */
1523 int active_keyingset; /* index of the active KeyingSet. first KeyingSet has index 1, 'none' active is 0, 'add new' is -1 */
1524 ListBase keyingsets; /* KeyingSets for this scene */
1527 struct GameFraming framing DNA_DEPRECATED; // XXX deprecated since 2.5
1531 struct UnitSettings unit;
1534 struct bGPdata *gpd;
1536 /* Physics simulation settings */
1537 struct PhysicsSettings physics_settings;
1539 /* Movie Tracking */
1540 struct MovieClip *clip; /* active movie clip */
1542 uint64_t customdata_mask; /* XXX. runtime flag for drawing, actually belongs in the window, only used by BKE_object_handle_update() */
1543 uint64_t customdata_mask_modal; /* XXX. same as above but for temp operator use (gl renders) */
1545 /* Color Management */
1546 ColorManagedViewSettings view_settings;
1547 ColorManagedDisplaySettings display_settings;
1548 ColorManagedColorspaceSettings sequencer_colorspace_settings;
1550 /* RigidBody simulation world+settings */
1551 struct RigidBodyWorld *rigidbody_world;
1553 struct PreviewImage *preview;
1556 /* **************** RENDERDATA ********************* */
1559 /* use preview range */
1560 #define SCER_PRV_RANGE (1<<0)
1561 #define SCER_LOCK_FRAME_SELECTION (1<<1)
1562 /* timeline/keyframe jumping - only selected items (on by default) */
1563 #define SCE_KEYS_NO_SELONLY (1<<2)
1565 /* mode (int now) */
1566 #define R_OSA 0x0001
1567 #define R_SHADOW 0x0002
1568 #define R_GAMMA 0x0004
1569 #define R_ORTHO 0x0008
1570 #define R_ENVMAP 0x0010
1571 #define R_EDGE 0x0020
1572 #define R_FIELDS 0x0040
1573 #define R_FIELDSTILL 0x0080
1574 /*#define R_RADIO 0x0100 */ /* deprecated */
1575 #define R_BORDER 0x0200
1576 #define R_PANORAMA 0x0400 /* deprecated as scene option, still used in renderer */
1577 #define R_CROP 0x0800
1578 /*#define R_COSMO 0x1000 deprecated */
1579 #define R_ODDFIELD 0x2000
1580 #define R_MBLUR 0x4000
1581 /* unified was here */
1582 #define R_RAYTRACE 0x10000
1583 /* R_GAUSS is obsolete, but used to retrieve setting from old files */
1584 #define R_GAUSS 0x20000
1585 /* fbuf obsolete... */
1586 /*#define R_FBUF 0x40000*/
1587 /* threads obsolete... is there for old files, now use for autodetect threads */
1588 #define R_THREADS 0x80000
1589 /* Use the same flag for autothreads */
1590 #define R_FIXED_THREADS 0x80000
1592 #define R_SPEED 0x100000
1593 #define R_SSS 0x200000
1594 #define R_NO_OVERWRITE 0x400000 /* skip existing files */
1595 #define R_TOUCH 0x800000 /* touch files before rendering */
1596 #define R_SIMPLIFY 0x1000000
1597 #define R_EDGE_FRS 0x2000000 /* R_EDGE reserved for Freestyle */
1598 #define R_PERSISTENT_DATA 0x4000000 /* keep data around for re-render */
1601 #define R_SEQ_GL_PREV 1
1602 // #define R_SEQ_GL_REND 2 // UNUSED, opengl render has its own operator now.
1603 #define R_SEQ_SOLID_TEX 4
1607 #define R_OUTPUT_SCREEN 0
1608 #define R_OUTPUT_AREA 1
1609 #define R_OUTPUT_WINDOW 2
1610 #define R_OUTPUT_NONE 3
1611 /*#define R_OUTPUT_FORKED 4*/
1614 #define R_FILTER_BOX 0
1615 #define R_FILTER_TENT 1
1616 #define R_FILTER_QUAD 2
1617 #define R_FILTER_CUBIC 3
1618 #define R_FILTER_CATROM 4
1619 #define R_FILTER_GAUSS 5
1620 #define R_FILTER_MITCH 6
1621 #define R_FILTER_FAST_GAUSS 7 /* note, this is only used for nodes at the moment */
1623 /* raytrace structure */
1624 #define R_RAYSTRUCTURE_AUTO 0
1625 #define R_RAYSTRUCTURE_OCTREE 1
1626 #define R_RAYSTRUCTURE_BLIBVH 2 /* removed */
1627 #define R_RAYSTRUCTURE_VBVH 3
1628 #define R_RAYSTRUCTURE_SIMD_SVBVH 4 /* needs SIMD */
1629 #define R_RAYSTRUCTURE_SIMD_QBVH 5 /* needs SIMD */
1631 /* raytrace_options */
1632 #define R_RAYTRACE_USE_LOCAL_COORDS 0x0001
1633 #define R_RAYTRACE_USE_INSTANCES 0x0002
1635 /* scemode (int now) */
1636 #define R_DOSEQ 0x0001
1637 #define R_BG_RENDER 0x0002
1638 /* passepartout is camera option now, keep this for backward compatibility */
1639 #define R_PASSEPARTOUT 0x0004
1640 #define R_BUTS_PREVIEW 0x0008
1641 #define R_EXTENSION 0x0010
1642 #define R_MATNODE_PREVIEW 0x0020
1643 #define R_DOCOMP 0x0040
1644 #define R_COMP_CROP 0x0080
1645 #define R_FREE_IMAGE 0x0100
1646 #define R_SINGLE_LAYER 0x0200
1647 #define R_EXR_TILE_FILE 0x0400
1648 #define R_COMP_FREE 0x0800
1649 #define R_NO_IMAGE_LOAD 0x1000
1650 #define R_NO_TEX 0x2000
1651 #define R_NO_FRAME_UPDATE 0x4000
1652 #define R_FULL_SAMPLE 0x8000
1653 /* #define R_DEPRECATED 0x10000 */
1654 /* #define R_RECURS_PROTECTION 0x20000 */
1655 #define R_TEXNODE_PREVIEW 0x40000
1656 #define R_VIEWPORT_PREVIEW 0x80000
1657 #define R_EXR_CACHE_FILE 0x100000
1658 #define R_MULTIVIEW 0x200000
1661 #define R_STAMP_TIME 0x0001
1662 #define R_STAMP_FRAME 0x0002
1663 #define R_STAMP_DATE 0x0004
1664 #define R_STAMP_CAMERA 0x0008
1665 #define R_STAMP_SCENE 0x0010
1666 #define R_STAMP_NOTE 0x0020
1667 #define R_STAMP_DRAW 0x0040 /* draw in the image */
1668 #define R_STAMP_MARKER 0x0080
1669 #define R_STAMP_FILENAME 0x0100
1670 #define R_STAMP_SEQSTRIP 0x0200
1671 #define R_STAMP_RENDERTIME 0x0400
1672 #define R_STAMP_CAMERALENS 0x0800
1673 #define R_STAMP_STRIPMETA 0x1000
1674 #define R_STAMP_ALL (R_STAMP_TIME|R_STAMP_FRAME|R_STAMP_DATE|R_STAMP_CAMERA|R_STAMP_SCENE| \
1675 R_STAMP_NOTE|R_STAMP_MARKER|R_STAMP_FILENAME|R_STAMP_SEQSTRIP| \
1676 R_STAMP_RENDERTIME|R_STAMP_CAMERALENS)
1680 #define R_ALPHAPREMUL 1
1681 /*#define R_ALPHAKEY 2*/ /* deprecated, shouldn't be used */
1683 /* color_mgt_flag */
1685 R_COLOR_MANAGEMENT = (1 << 0), /* deprecated, should only be used in versioning code only */
1686 /*R_COLOR_MANAGEMENT_PREDIVIDE = (1 << 1)*/ /* deprecated, shouldn't be used */
1689 #ifdef DNA_DEPRECATED
1690 /* subimtype, flag options for imtype */
1692 R_OPENEXR_HALF = 1, /*deprecated*/
1693 R_OPENEXR_ZBUF = 2, /*deprecated*/
1694 R_PREVIEW_JPG = 4, /*deprecated*/
1695 R_CINEON_LOG = 8, /*deprecated*/
1696 R_TIFF_16BIT = 16, /*deprecated*/
1698 R_JPEG2K_12BIT = 32, /* Jpeg2000 */ /*deprecated*/
1699 R_JPEG2K_16BIT = 64, /*deprecated*/
1700 R_JPEG2K_YCC = 128, /* when disabled use RGB */ /*deprecated*/
1701 R_JPEG2K_CINE_PRESET = 256, /*deprecated*/
1702 R_JPEG2K_CINE_48FPS = 512, /*deprecated*/
1706 /* bake_mode: same as RE_BAKE_xxx defines */
1708 #define R_BAKE_CLEAR 1
1709 #define R_BAKE_OSA 2
1710 #define R_BAKE_TO_ACTIVE 4
1711 #define R_BAKE_NORMALIZE 8
1712 #define R_BAKE_MULTIRES 16
1713 #define R_BAKE_LORES_MESH 32
1714 #define R_BAKE_VCOL 64
1715 #define R_BAKE_USERSCALE 128
1716 #define R_BAKE_CAGE 256
1717 #define R_BAKE_SPLIT_MAT 512
1718 #define R_BAKE_AUTO_NAME 1024
1720 /* bake_normal_space */
1721 #define R_BAKE_SPACE_CAMERA 0
1722 #define R_BAKE_SPACE_WORLD 1
1723 #define R_BAKE_SPACE_OBJECT 2
1724 #define R_BAKE_SPACE_TANGENT 3
1727 #define R_SIMPLE_NO_TRIANGULATE 1
1729 /* line_thickness_mode */
1730 #define R_LINE_THICKNESS_ABSOLUTE 1
1731 #define R_LINE_THICKNESS_RELATIVE 2
1733 /* sequencer seq_prev_type seq_rend_type */
1735 /* scene->r.engine (scene.c) */
1736 extern const char *RE_engine_id_BLENDER_RENDER;
1737 extern const char *RE_engine_id_BLENDER_GAME;
1738 extern const char *RE_engine_id_CYCLES;
1740 /* **************** SCENE ********************* */
1742 /* for general use */
1743 #define MAXFRAME 300000
1744 #define MAXFRAMEF 300000.0f
1747 #define MINFRAMEF 0.0f
1749 /* (minimum frame number for current-frame) */
1750 #define MINAFRAME -300000
1751 #define MINAFRAMEF -300000.0f
1753 /* depricate this! */
1754 #define TESTBASE(v3d, base) ( \
1755 ((base)->flag & SELECT) && \
1756 ((base)->lay & v3d->lay) && \
1757 (((base)->object->restrictflag & OB_RESTRICT_VIEW) == 0))
1758 #define TESTBASELIB(v3d, base) ( \
1759 ((base)->flag & SELECT) && \
1760 ((base)->lay & v3d->lay) && \
1761 ((base)->object->id.lib == NULL) && \
1762 (((base)->object->restrictflag & OB_RESTRICT_VIEW) == 0))
1763 #define TESTBASELIB_BGMODE(v3d, scene, base) ( \
1764 ((base)->flag & SELECT) && \
1765 ((base)->lay & (v3d ? v3d->lay : scene->lay)) && \
1766 ((base)->object->id.lib == NULL) && \
1767 (((base)->object->restrictflag & OB_RESTRICT_VIEW) == 0))
1768 #define BASE_EDITABLE_BGMODE(v3d, scene, base) ( \
1769 ((base)->lay & (v3d ? v3d->lay : scene->lay)) && \
1770 ((base)->object->id.lib == NULL) && \
1771 (((base)->object->restrictflag & OB_RESTRICT_VIEW) == 0))
1772 #define BASE_SELECTABLE(v3d, base) ( \
1773 (base->lay & v3d->lay) && \
1774 (base->object->restrictflag & (OB_RESTRICT_SELECT | OB_RESTRICT_VIEW)) == 0)
1775 #define BASE_VISIBLE(v3d, base) ( \
1776 (base->lay & v3d->lay) && \
1777 (base->object->restrictflag & OB_RESTRICT_VIEW) == 0)
1778 #define BASE_VISIBLE_BGMODE(v3d, scene, base) ( \
1779 (base->lay & (v3d ? v3d->lay : scene->lay)) && \
1780 (base->object->restrictflag & OB_RESTRICT_VIEW) == 0)
1782 #define FIRSTBASE scene->base.first
1783 #define LASTBASE scene->base.last
1784 #define BASACT (scene->basact)
1785 #define OBACT (BASACT ? BASACT->object: NULL)
1787 #define V3D_CAMERA_LOCAL(v3d) ((!(v3d)->scenelock && (v3d)->camera) ? (v3d)->camera : NULL)
1788 #define V3D_CAMERA_SCENE(scene, v3d) ((!(v3d)->scenelock && (v3d)->camera) ? (v3d)->camera : (scene)->camera)
1790 #define CFRA (scene->r.cfra)
1791 #define SUBFRA (scene->r.subframe)
1792 #define SFRA (scene->r.sfra)
1793 #define EFRA (scene->r.efra)
1794 #define PRVRANGEON (scene->r.flag & SCER_PRV_RANGE)
1795 #define PSFRA ((PRVRANGEON) ? (scene->r.psfra) : (scene->r.sfra))
1796 #define PEFRA ((PRVRANGEON) ? (scene->r.pefra) : (scene->r.efra))
1797 #define FRA2TIME(a) ((((double) scene->r.frs_sec_base) * (double)(a)) / (double)scene->r.frs_sec)
1798 #define TIME2FRA(a) ((((double) scene->r.frs_sec) * (double)(a)) / (double)scene->r.frs_sec_base)
1799 #define FPS (((double) scene->r.frs_sec) / (double)scene->r.frs_sec_base)
1801 /* base->flag is in DNA_object_types.h */
1803 /* toolsettings->snap_flag */
1805 #define SCE_SNAP_ROTATE 2
1806 #define SCE_SNAP_PEEL_OBJECT 4
1807 #define SCE_SNAP_PROJECT 8
1808 #define SCE_SNAP_NO_SELF 16
1809 #define SCE_SNAP_ABS_GRID 32
1811 /* toolsettings->snap_target */
1812 #define SCE_SNAP_TARGET_CLOSEST 0
1813 #define SCE_SNAP_TARGET_CENTER 1
1814 #define SCE_SNAP_TARGET_MEDIAN 2
1815 #define SCE_SNAP_TARGET_ACTIVE 3
1816 /* toolsettings->snap_mode */
1817 #define SCE_SNAP_MODE_INCREMENT 0
1818 #define SCE_SNAP_MODE_VERTEX 1
1819 #define SCE_SNAP_MODE_EDGE 2
1820 #define SCE_SNAP_MODE_FACE 3
1821 #define SCE_SNAP_MODE_VOLUME 4
1822 #define SCE_SNAP_MODE_NODE_X 5
1823 #define SCE_SNAP_MODE_NODE_Y 6
1824 #define SCE_SNAP_MODE_NODE_XY 7
1825 #define SCE_SNAP_MODE_GRID 8
1827 /* toolsettings->selectmode */
1828 #define SCE_SELECT_VERTEX 1 /* for mesh */
1829 #define SCE_SELECT_EDGE 2
1830 #define SCE_SELECT_FACE 4
1832 /* toolsettings->statvis->type */
1833 #define SCE_STATVIS_OVERHANG 0
1834 #define SCE_STATVIS_THICKNESS 1
1835 #define SCE_STATVIS_INTERSECT 2
1836 #define SCE_STATVIS_DISTORT 3
1837 #define SCE_STATVIS_SHARP 4
1839 /* toolsettings->particle.selectmode for particles */
1840 #define SCE_SELECT_PATH 1
1841 #define SCE_SELECT_POINT 2
1842 #define SCE_SELECT_END 4
1844 /* toolsettings->prop_mode (proportional falloff) */
1845 #define PROP_SMOOTH 0
1846 #define PROP_SPHERE 1
1848 #define PROP_SHARP 3
1850 #define PROP_CONST 5
1851 #define PROP_RANDOM 6
1852 #define PROP_INVSQUARE 7
1853 #define PROP_MODE_MAX 8
1855 /* toolsettings->proportional */
1856 #define PROP_EDIT_OFF 0
1857 #define PROP_EDIT_ON 1
1858 #define PROP_EDIT_CONNECTED 2
1859 #define PROP_EDIT_PROJECTED 3
1861 /* toolsettings->weightuser */
1863 OB_DRAW_GROUPUSER_NONE = 0,
1864 OB_DRAW_GROUPUSER_ACTIVE = 1,
1865 OB_DRAW_GROUPUSER_ALL = 2
1868 /* toolsettings->vgroupsubset */
1869 /* object_vgroup.c */
1870 typedef enum eVGroupSelect {
1872 WT_VGROUP_ACTIVE = 1,
1873 WT_VGROUP_BONE_SELECT = 2,
1874 WT_VGROUP_BONE_DEFORM = 3,
1875 WT_VGROUP_BONE_DEFORM_OFF = 4
1878 #define WT_VGROUP_MASK_ALL \
1879 ((1 << WT_VGROUP_ACTIVE) | \
1880 (1 << WT_VGROUP_BONE_SELECT) | \
1881 (1 << WT_VGROUP_BONE_DEFORM) | \
1882 (1 << WT_VGROUP_BONE_DEFORM_OFF) | \
1883 (1 << WT_VGROUP_ALL))
1887 #define SCE_DS_SELECTED (1<<0)
1888 #define SCE_DS_COLLAPSED (1<<1)
1889 #define SCE_NLA_EDIT_ON (1<<2)
1890 #define SCE_FRAME_DROP (1<<3)
1893 /* return flag BKE_scene_base_iter_next functions */
1894 /* #define F_ERROR -1 */ /* UNUSED */
1900 #define AUDIO_MUTE (1<<0)
1901 #define AUDIO_SYNC (1<<1)
1902 #define AUDIO_SCRUB (1<<2)
1903 #define AUDIO_VOLUME_ANIMATED (1<<3)
1906 #ifdef DNA_DEPRECATED
1907 FFMPEG_MULTIPLEX_AUDIO = 1, /* deprecated, you can choose none as audiocodec now */
1909 FFMPEG_AUTOSPLIT_OUTPUT = 2,
1910 FFMPEG_LOSSLESS_OUTPUT = 4,
1915 PAINT_SHOW_BRUSH = (1 << 0),
1916 PAINT_FAST_NAVIGATE = (1 << 1),
1917 PAINT_SHOW_BRUSH_ON_SURFACE = (1 << 2),
1918 PAINT_USE_CAVITY_MASK = (1 << 3)
1921 /* Paint.symmetry_flags
1922 * (for now just a duplicate of sculpt symmetry flags) */
1923 typedef enum SymmetryFlags {
1924 PAINT_SYMM_X = (1 << 0),
1925 PAINT_SYMM_Y = (1 << 1),
1926 PAINT_SYMM_Z = (1 << 2),
1927 PAINT_SYMMETRY_FEATHER = (1 << 3),
1928 PAINT_TILE_X = (1 << 4),
1929 PAINT_TILE_Y = (1 << 5),
1930 PAINT_TILE_Z = (1 << 6),
1933 #define PAINT_SYMM_AXIS_ALL (PAINT_SYMM_X | PAINT_SYMM_Y | PAINT_SYMM_Z)
1936 /* These can eventually be moved to paint flags? */
1937 typedef enum SculptFlags {
1938 #ifdef DNA_DEPRECATED
1939 /* deprecated, part of paint struct symmetry_flags now */
1940 SCULPT_SYMM_X = (1 << 0),
1941 SCULPT_SYMM_Y = (1 << 1),
1942 SCULPT_SYMM_Z = (1 << 2),
1945 SCULPT_LOCK_X = (1 << 3),
1946 SCULPT_LOCK_Y = (1 << 4),
1947 SCULPT_LOCK_Z = (1 << 5),
1948 /* deprecated, part of paint struct symmetry_flags now */
1949 SCULPT_SYMMETRY_FEATHER = (1 << 6),
1951 SCULPT_USE_OPENMP = (1 << 7),
1952 SCULPT_ONLY_DEFORM = (1 << 8),
1953 SCULPT_SHOW_DIFFUSE = (1 << 9),
1955 /* If set, the mesh will be drawn with smooth-shading in
1956 * dynamic-topology mode */
1957 SCULPT_DYNTOPO_SMOOTH_SHADING = (1 << 10),
1959 /* If set, dynamic-topology brushes will subdivide short edges */
1960 SCULPT_DYNTOPO_SUBDIVIDE = (1 << 12),
1961 /* If set, dynamic-topology brushes will collapse short edges */
1962 SCULPT_DYNTOPO_COLLAPSE = (1 << 11),
1964 /* If set, dynamic-topology detail size will be constant in object space */
1965 SCULPT_DYNTOPO_DETAIL_CONSTANT = (1 << 13),
1966 SCULPT_DYNTOPO_DETAIL_BRUSH = (1 << 14),
1969 typedef enum ImagePaintMode {
1970 IMAGEPAINT_MODE_MATERIAL, /* detect texture paint slots from the material */
1971 IMAGEPAINT_MODE_IMAGE, /* select texture paint image directly */
1974 /* ImagePaintSettings.flag */
1975 #define IMAGEPAINT_DRAWING 1
1976 // #define IMAGEPAINT_DRAW_TOOL 2 // deprecated
1977 // #define IMAGEPAINT_DRAW_TOOL_DRAWING 4 // deprecated
1979 /* projection painting only */
1980 #define IMAGEPAINT_PROJECT_XRAY (1 << 4)
1981 #define IMAGEPAINT_PROJECT_BACKFACE (1 << 5)
1982 #define IMAGEPAINT_PROJECT_FLAT (1 << 6)
1983 #define IMAGEPAINT_PROJECT_LAYER_CLONE (1 << 7)
1984 #define IMAGEPAINT_PROJECT_LAYER_STENCIL (1 << 8)
1985 #define IMAGEPAINT_PROJECT_LAYER_STENCIL_INV (1 << 9)
1988 #define IMAGEPAINT_MISSING_UVS (1 << 0)
1989 #define IMAGEPAINT_MISSING_MATERIAL (1 << 1)
1990 #define IMAGEPAINT_MISSING_TEX (1 << 2)
1991 #define IMAGEPAINT_MISSING_STENCIL (1 << 3)
1993 /* toolsettings->uvcalc_flag */
1994 #define UVCALC_FILLHOLES 1
1995 #define UVCALC_NO_ASPECT_CORRECT 2 /* would call this UVCALC_ASPECT_CORRECT, except it should be default with old file */
1996 #define UVCALC_TRANSFORM_CORRECT 4 /* adjust UV's while transforming to avoid distortion */
1997 #define UVCALC_USESUBSURF 8 /* Use mesh data after subsurf to compute UVs*/
1999 /* toolsettings->uv_flag */
2000 #define UV_SYNC_SELECTION 1
2001 #define UV_SHOW_SAME_IMAGE 2
2003 /* toolsettings->uv_selectmode */
2004 #define UV_SELECT_VERTEX 1
2005 #define UV_SELECT_EDGE 2
2006 #define UV_SELECT_FACE 4
2007 #define UV_SELECT_ISLAND 8
2009 /* toolsettings->edge_mode */
2010 #define EDGE_MODE_SELECT 0
2011 #define EDGE_MODE_TAG_SEAM 1
2012 #define EDGE_MODE_TAG_SHARP 2
2013 #define EDGE_MODE_TAG_CREASE 3
2014 #define EDGE_MODE_TAG_BEVEL 4
2015 #define EDGE_MODE_TAG_FREESTYLE 5
2017 /* toolsettings->gpencil_flags */
2018 typedef enum eGPencil_Flags {
2019 /* "Continuous Drawing" - The drawing operator enters a mode where multiple strokes can be drawn */
2020 GP_TOOL_FLAG_PAINTSESSIONS_ON = (1 << 0),
2021 /* When creating new frames, the last frame gets used as the basis for the new one */
2022 GP_TOOL_FLAG_RETAIN_LAST = (1 << 1),
2025 /* toolsettings->gpencil_src */
2026 typedef enum eGPencil_Source_3D {
2027 GP_TOOL_SOURCE_SCENE = 0,
2028 GP_TOOL_SOURCE_OBJECT = 1
2029 } eGPencil_Source_3d;
2031 /* toolsettings->gpencil_*_align - Stroke Placement mode flags */
2032 typedef enum eGPencil_Placement_Flags {
2033 /* New strokes are added in viewport/data space (i.e. not screen space) */
2034 GP_PROJECT_VIEWSPACE = (1 << 0),
2036 /* Viewport space, but relative to render canvas (Sequencer Preview Only) */
2037 GP_PROJECT_CANVAS = (1 << 1),
2039 /* Project into the screen's Z values */
2040 GP_PROJECT_DEPTH_VIEW = (1 << 2),
2041 GP_PROJECT_DEPTH_STROKE = (1 << 3),
2043 /* "Use Endpoints" */
2044 GP_PROJECT_DEPTH_STROKE_ENDPOINTS = (1 << 4),
2045 } eGPencil_Placement_Flags;
2047 /* toolsettings->particle flag */
2048 #define PE_KEEP_LENGTHS 1
2049 #define PE_LOCK_FIRST 2
2050 #define PE_DEFLECT_EMITTER 4
2051 #define PE_INTERPOLATE_ADDED 8
2052 #define PE_DRAW_PART 16
2053 /* #define PE_X_MIRROR 64 */ /* deprecated */
2054 #define PE_FADE_TIME 128
2055 #define PE_AUTO_VELOCITY 256
2057 /* toolsetting->particle brushtype */
2058 #define PE_BRUSH_NONE -1
2059 #define PE_BRUSH_COMB 0
2060 #define PE_BRUSH_CUT 1
2061 #define PE_BRUSH_LENGTH 2
2062 #define PE_BRUSH_PUFF 3
2063 #define PE_BRUSH_ADD 4
2064 #define PE_BRUSH_SMOOTH 5
2065 #define PE_BRUSH_WEIGHT 6
2067 /* this must equal ParticleEditSettings.brush array size */
2068 #define PE_TOT_BRUSH 6
2070 /* ParticleBrushData->flag */
2071 #define PE_BRUSH_DATA_PUFF_VOLUME 1
2073 /* tooksettings->particle edittype */
2074 #define PE_TYPE_PARTICLES 0
2075 #define PE_TYPE_SOFTBODY 1
2076 #define PE_TYPE_CLOTH 2
2078 /* toolsettings->skgen_options */
2079 #define SKGEN_FILTER_INTERNAL (1 << 0)
2080 #define SKGEN_FILTER_EXTERNAL (1 << 1)
2081 #define SKGEN_SYMMETRY (1 << 2)
2082 #define SKGEN_CUT_LENGTH (1 << 3)
2083 #define SKGEN_CUT_ANGLE (1 << 4)
2084 #define SKGEN_CUT_CORRELATION (1 << 5)
2085 #define SKGEN_HARMONIC (1 << 6)
2086 #define SKGEN_STICK_TO_EMBEDDING (1 << 7)
2087 #define SKGEN_ADAPTIVE_DISTANCE (1 << 8)
2088 #define SKGEN_FILTER_SMART (1 << 9)
2089 #define SKGEN_DISP_LENGTH (1 << 10)
2090 #define SKGEN_DISP_WEIGHT (1 << 11)
2091 #define SKGEN_DISP_ORIG (1 << 12)
2092 #define SKGEN_DISP_EMBED (1 << 13)
2093 #define SKGEN_DISP_INDEX (1 << 14)
2095 #define SKGEN_SUB_LENGTH 0
2096 #define SKGEN_SUB_ANGLE 1
2097 #define SKGEN_SUB_CORRELATION 2
2098 #define SKGEN_SUB_TOTAL 3
2100 /* toolsettings->skgen_postpro */
2101 #define SKGEN_SMOOTH 0
2102 #define SKGEN_AVERAGE 1
2103 #define SKGEN_SHARPEN 2
2105 /* toolsettings->bone_sketching */
2106 #define BONE_SKETCHING 1
2107 #define BONE_SKETCHING_QUICK 2
2108 #define BONE_SKETCHING_ADJUST 4
2110 /* toolsettings->bone_sketching_convert */
2111 #define SK_CONVERT_CUT_FIXED 0
2112 #define SK_CONVERT_CUT_LENGTH 1
2113 #define SK_CONVERT_CUT_ADAPTATIVE 2
2114 #define SK_CONVERT_RETARGET 3
2116 /* toolsettings->skgen_retarget_options */
2117 #define SK_RETARGET_AUTONAME 1
2119 /* toolsettings->skgen_retarget_roll */
2120 #define SK_RETARGET_ROLL_NONE 0
2121 #define SK_RETARGET_ROLL_VIEW 1
2122 #define SK_RETARGET_ROLL_JOINT 2
2124 /* physics_settings->flag */
2125 #define PHYS_GLOBAL_GRAVITY 1
2129 /* UnitSettings->system */
2130 #define USER_UNIT_NONE 0
2131 #define USER_UNIT_METRIC 1
2132 #define USER_UNIT_IMPERIAL 2
2133 /* UnitSettings->flag */
2134 #define USER_UNIT_OPT_SPLIT 1
2135 #define USER_UNIT_ROT_RADIANS 2
2141 #endif /* __DNA_SCENE_TYPES_H__ */