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_collection_types.h"
51 #include "DNA_layer_types.h"
52 #include "DNA_material_types.h"
53 #include "DNA_userdef_types.h"
54 #include "DNA_view3d_types.h"
71 struct SceneCollection;
73 /* ************************************************************* */
76 /* ************************************************************* */
77 /* Output Format Data */
79 typedef struct AviCodecData {
82 /** Compressor options. */
84 /** Size of lpFormat buffer. */
85 unsigned int cbFormat;
86 /** Size of lpParms buffer. */
89 /** Stream type, for consistency. */
92 unsigned int fccHandler;
94 unsigned int dwKeyFrameEvery;
95 /** Compress quality 0-10,000. */
96 unsigned int dwQuality;
97 /** Bytes per second. */
98 unsigned int dwBytesPerSecond;
99 /** Flags... see below. */
100 unsigned int dwFlags;
101 /** For non-video streams only. */
102 unsigned int dwInterleaveEvery;
105 char avicodecname[128];
108 typedef enum eFFMpegPreset {
111 #ifdef DNA_DEPRECATED
112 /* Previously used by h.264 to control encoding speed vs. file size. */
113 FFM_PRESET_ULTRAFAST, /* DEPRECATED */
114 FFM_PRESET_SUPERFAST, /* DEPRECATED */
115 FFM_PRESET_VERYFAST, /* DEPRECATED */
116 FFM_PRESET_FASTER, /* DEPRECATED */
117 FFM_PRESET_FAST, /* DEPRECATED */
118 FFM_PRESET_MEDIUM, /* DEPRECATED */
119 FFM_PRESET_SLOW, /* DEPRECATED */
120 FFM_PRESET_SLOWER, /* DEPRECATED */
121 FFM_PRESET_VERYSLOW, /* DEPRECATED */
124 /* Used by WEBM/VP9 and h.264 to control encoding speed vs. file size.
125 * WEBM/VP9 use these values directly, whereas h.264 map those to
126 * respectively the MEDIUM, SLOWER, and SUPERFAST presets.
128 FFM_PRESET_GOOD = 10, /* the default and recommended for most applications */
129 FFM_PRESET_BEST, /* recommended if you have lots of time and want the best compression efficiency */
130 FFM_PRESET_REALTIME, /* recommended for live / fast encoding */
133 /* Mapping from easily-understandable descriptions to CRF values.
134 * Assumes we output 8-bit video. Needs to be remapped if 10-bit
136 * We use a slightly wider than "subjectively sane range" according
137 * to https://trac.ffmpeg.org/wiki/Encode/H.264#a1.ChooseaCRFvalue
139 typedef enum eFFMpegCrf {
141 FFM_CRF_LOSSLESS = 0,
142 FFM_CRF_PERC_LOSSLESS = 17,
146 FFM_CRF_VERYLOW = 29,
150 typedef enum eFFMpegAudioChannels {
151 FFM_CHANNELS_MONO = 1,
152 FFM_CHANNELS_STEREO = 2,
153 FFM_CHANNELS_SURROUND4 = 4,
154 FFM_CHANNELS_SURROUND51 = 6,
155 FFM_CHANNELS_SURROUND71 = 8,
156 } eFFMpegAudioChannels;
158 typedef struct FFMpegCodecData {
169 /** Only used if FFMPEG_USE_MAX_B_FRAMES flag is set. */
172 int constant_rate_factor;
173 /** See eFFMpegPreset. */
183 IDProperty *properties;
186 /* ************************************************************* */
189 typedef struct AudioData {
190 int mixrate; // 2.5: now in FFMpegCodecData: audio_mixrate
191 float main; // 2.5: now in FFMpegCodecData: audio_volume
192 float speed_of_sound;
193 float doppler_factor;
201 /* *************************************************************** */
205 typedef struct SceneRenderLayer {
206 struct SceneRenderLayer *next, *prev;
209 char name[64] DNA_DEPRECATED;
211 /** Converted to ViewLayer setting. */
212 struct Material *mat_override DNA_DEPRECATED;
214 /** Converted to LayerCollection cycles camera visibility override. */
215 unsigned int lay DNA_DEPRECATED;
216 /** Converted to LayerCollection cycles holdout override. */
217 unsigned int lay_zmask DNA_DEPRECATED;
218 unsigned int lay_exclude DNA_DEPRECATED;
219 /** Converted to ViewLayer layflag and flag. */
220 int layflag DNA_DEPRECATED;
222 /* pass_xor has to be after passflag */
223 /** Pass_xor has to be after passflag. */
224 int passflag DNA_DEPRECATED;
225 /** Converted to ViewLayer passflag and flag. */
226 int pass_xor DNA_DEPRECATED;
228 /** Converted to ViewLayer setting. */
229 int samples DNA_DEPRECATED;
230 /** Converted to ViewLayer pass_alpha_threshold. */
231 float pass_alpha_threshold DNA_DEPRECATED;
233 /** Converted to ViewLayer id_properties. */
234 IDProperty *prop DNA_DEPRECATED;
236 /** Converted to ViewLayer freestyleConfig. */
237 struct FreestyleConfig freestyleConfig DNA_DEPRECATED;
240 /* SceneRenderLayer.layflag */
241 #define SCE_LAY_SOLID (1 << 0)
242 #define SCE_LAY_ZTRA (1 << 1)
243 #define SCE_LAY_HALO (1 << 2)
244 #define SCE_LAY_EDGE (1 << 3)
245 #define SCE_LAY_SKY (1 << 4)
246 #define SCE_LAY_STRAND (1 << 5)
247 #define SCE_LAY_FRS (1 << 6)
248 #define SCE_LAY_AO (1 << 7)
249 /* flags between (1 << 8) and (1 << 15) are set to 1 already, for future options */
251 #define SCE_LAY_ALL_Z (1 << 15)
252 #define SCE_LAY_XOR (1 << 16)
253 #define SCE_LAY_DISABLE (1 << 17)
254 #define SCE_LAY_ZMASK (1 << 18)
255 #define SCE_LAY_NEG_ZMASK (1 << 19)
257 /* SceneRenderLayer.passflag */
258 typedef enum eScenePassType {
259 SCE_PASS_COMBINED = (1 << 0),
260 SCE_PASS_Z = (1 << 1),
261 SCE_PASS_DEPRECATED_1 = (1 << 2), /* RGBA */
262 SCE_PASS_DEPRECATED_2 = (1 << 3), /* DIFFUSE */
263 SCE_PASS_DEPRECATED_3 = (1 << 4), /* SPEC */
264 SCE_PASS_SHADOW = (1 << 5),
265 SCE_PASS_AO = (1 << 6),
266 SCE_PASS_DEPRECATED_4 = (1 << 7), /* REFLECT */
267 SCE_PASS_NORMAL = (1 << 8),
268 SCE_PASS_VECTOR = (1 << 9),
269 SCE_PASS_DEPRECATED_5 = (1 << 10), /* REFRACT */
270 SCE_PASS_INDEXOB = (1 << 11),
271 SCE_PASS_UV = (1 << 12),
272 SCE_PASS_DEPRECATED_6 = (1 << 13), /* INDIRECT */
273 SCE_PASS_MIST = (1 << 14),
274 SCE_PASS_RAYHITS = (1 << 15),
275 SCE_PASS_EMIT = (1 << 16),
276 SCE_PASS_ENVIRONMENT = (1 << 17),
277 SCE_PASS_INDEXMA = (1 << 18),
278 SCE_PASS_DIFFUSE_DIRECT = (1 << 19),
279 SCE_PASS_DIFFUSE_INDIRECT = (1 << 20),
280 SCE_PASS_DIFFUSE_COLOR = (1 << 21),
281 SCE_PASS_GLOSSY_DIRECT = (1 << 22),
282 SCE_PASS_GLOSSY_INDIRECT = (1 << 23),
283 SCE_PASS_GLOSSY_COLOR = (1 << 24),
284 SCE_PASS_TRANSM_DIRECT = (1 << 25),
285 SCE_PASS_TRANSM_INDIRECT = (1 << 26),
286 SCE_PASS_TRANSM_COLOR = (1 << 27),
287 SCE_PASS_SUBSURFACE_DIRECT = (1 << 28),
288 SCE_PASS_SUBSURFACE_INDIRECT = (1 << 29),
289 SCE_PASS_SUBSURFACE_COLOR = (1 << 30),
290 SCE_PASS_ROUGHNESS = (1u << 31u),
293 #define RE_PASSNAME_DEPRECATED "Deprecated"
295 #define RE_PASSNAME_COMBINED "Combined"
296 #define RE_PASSNAME_Z "Depth"
297 #define RE_PASSNAME_VECTOR "Vector"
298 #define RE_PASSNAME_NORMAL "Normal"
299 #define RE_PASSNAME_UV "UV"
300 #define RE_PASSNAME_EMIT "Emit"
301 #define RE_PASSNAME_SHADOW "Shadow"
303 #define RE_PASSNAME_AO "AO"
304 #define RE_PASSNAME_ENVIRONMENT "Env"
305 #define RE_PASSNAME_INDEXOB "IndexOB"
306 #define RE_PASSNAME_INDEXMA "IndexMA"
307 #define RE_PASSNAME_MIST "Mist"
309 #define RE_PASSNAME_RAYHITS "RayHits"
310 #define RE_PASSNAME_DIFFUSE_DIRECT "DiffDir"
311 #define RE_PASSNAME_DIFFUSE_INDIRECT "DiffInd"
312 #define RE_PASSNAME_DIFFUSE_COLOR "DiffCol"
313 #define RE_PASSNAME_GLOSSY_DIRECT "GlossDir"
314 #define RE_PASSNAME_GLOSSY_INDIRECT "GlossInd"
315 #define RE_PASSNAME_GLOSSY_COLOR "GlossCol"
316 #define RE_PASSNAME_TRANSM_DIRECT "TransDir"
317 #define RE_PASSNAME_TRANSM_INDIRECT "TransInd"
318 #define RE_PASSNAME_TRANSM_COLOR "TransCol"
320 #define RE_PASSNAME_SUBSURFACE_DIRECT "SubsurfaceDir"
321 #define RE_PASSNAME_SUBSURFACE_INDIRECT "SubsurfaceInd"
322 #define RE_PASSNAME_SUBSURFACE_COLOR "SubsurfaceCol"
325 /* View - MultiView */
326 typedef struct SceneRenderView {
327 struct SceneRenderView *next, *prev;
340 /* SceneRenderView.viewflag */
341 #define SCE_VIEW_DISABLE (1<<0)
343 /* RenderData.views_format */
345 SCE_VIEWS_FORMAT_STEREO_3D = 0,
346 SCE_VIEWS_FORMAT_MULTIVIEW = 1,
349 /* ImageFormatData.views_format (also used for Sequence.views_format) */
351 R_IMF_VIEWS_INDIVIDUAL = 0,
352 R_IMF_VIEWS_STEREO_3D = 1,
353 R_IMF_VIEWS_MULTIVIEW = 2,
356 typedef struct Stereo3dFormat {
358 /** Encoding mode. */
360 /** Anaglyph scheme for the user display. */
362 /** Interlace type for the user display. */
367 /* Stereo3dFormat.display_mode */
368 typedef enum eStereoDisplayMode {
369 S3D_DISPLAY_ANAGLYPH = 0,
370 S3D_DISPLAY_INTERLACE = 1,
371 S3D_DISPLAY_PAGEFLIP = 2,
372 S3D_DISPLAY_SIDEBYSIDE = 3,
373 S3D_DISPLAY_TOPBOTTOM = 4,
374 } eStereoDisplayMode;
376 /* Stereo3dFormat.flag */
377 typedef enum eStereo3dFlag {
378 S3D_INTERLACE_SWAP = (1 << 0),
379 S3D_SIDEBYSIDE_CROSSEYED = (1 << 1),
380 S3D_SQUEEZED_FRAME = (1 << 2),
383 /* Stereo3dFormat.anaglyph_type */
384 typedef enum eStereo3dAnaglyphType {
385 S3D_ANAGLYPH_REDCYAN = 0,
386 S3D_ANAGLYPH_GREENMAGENTA = 1,
387 S3D_ANAGLYPH_YELLOWBLUE = 2,
388 } eStereo3dAnaglyphType;
390 /* Stereo3dFormat.interlace_type */
391 typedef enum eStereo3dInterlaceType {
392 S3D_INTERLACE_ROW = 0,
393 S3D_INTERLACE_COLUMN = 1,
394 S3D_INTERLACE_CHECKERBOARD = 2,
395 } eStereo3dInterlaceType;
397 /* *************************************************************** */
399 /* Generic image format settings,
400 * this is used for NodeImageFile and IMAGE_OT_save_as operator too.
402 * note: its a bit strange that even though this is an image format struct
403 * the imtype can still be used to select video formats.
404 * RNA ensures these enum's are only selectable for render output.
406 typedef struct ImageFormatData {
408 * R_IMF_IMTYPE_PNG, R_...
409 * \note, video types should only ever be set from this structure when used from RenderData.
413 * bits per channel, R_IMF_CHAN_DEPTH_8 -> 32,
414 * not a flag, only set 1 at a time. */
417 /** R_IMF_PLANES_BW, R_IMF_PLANES_RGB, R_IMF_PLANES_RGBA. */
419 /** Generic options for all image types, alpha zbuffer. */
422 /** (0 - 100), eg: jpeg quality. */
424 /** (0 - 100), eg: png compression. */
428 /* --- format specific --- */
435 short cineon_white, cineon_black;
449 Stereo3dFormat stereo3d_format;
451 /* color management */
452 ColorManagedViewSettings view_settings;
453 ColorManagedDisplaySettings display_settings;
457 /* ImageFormatData.imtype */
458 #define R_IMF_IMTYPE_TARGA 0
459 #define R_IMF_IMTYPE_IRIS 1
460 /* #define R_HAMX 2 */ /* hamx is nomore */
461 /* #define R_FTYPE 3 */ /* ftype is nomore */
462 #define R_IMF_IMTYPE_JPEG90 4
463 /* #define R_MOVIE 5 */ /* movie is nomore */
464 #define R_IMF_IMTYPE_IRIZ 7
465 #define R_IMF_IMTYPE_RAWTGA 14
466 #define R_IMF_IMTYPE_AVIRAW 15
467 #define R_IMF_IMTYPE_AVIJPEG 16
468 #define R_IMF_IMTYPE_PNG 17
469 /* #define R_IMF_IMTYPE_AVICODEC 18 */ /* avicodec is nomore */
470 /* #define R_IMF_IMTYPE_QUICKTIME 19 */ /* quicktime is nomore */
471 #define R_IMF_IMTYPE_BMP 20
472 #define R_IMF_IMTYPE_RADHDR 21
473 #define R_IMF_IMTYPE_TIFF 22
474 #define R_IMF_IMTYPE_OPENEXR 23
475 #define R_IMF_IMTYPE_FFMPEG 24
476 /* #define R_IMF_IMTYPE_FRAMESERVER 25 */ /* frame server is nomore */
477 #define R_IMF_IMTYPE_CINEON 26
478 #define R_IMF_IMTYPE_DPX 27
479 #define R_IMF_IMTYPE_MULTILAYER 28
480 #define R_IMF_IMTYPE_DDS 29
481 #define R_IMF_IMTYPE_JP2 30
482 #define R_IMF_IMTYPE_H264 31
483 #define R_IMF_IMTYPE_XVID 32
484 #define R_IMF_IMTYPE_THEORA 33
485 #define R_IMF_IMTYPE_PSD 34
487 #define R_IMF_IMTYPE_INVALID 255
489 /* ImageFormatData.flag */
490 #define R_IMF_FLAG_ZBUF (1<<0) /* was R_OPENEXR_ZBUF */
491 #define R_IMF_FLAG_PREVIEW_JPG (1<<1) /* was R_PREVIEW_JPG */
493 /* return values from BKE_imtype_valid_depths, note this is depts per channel */
494 #define R_IMF_CHAN_DEPTH_1 (1<<0) /* 1bits (unused) */
495 #define R_IMF_CHAN_DEPTH_8 (1<<1) /* 8bits (default) */
496 #define R_IMF_CHAN_DEPTH_10 (1<<2) /* 10bits (uncommon, Cineon/DPX support) */
497 #define R_IMF_CHAN_DEPTH_12 (1<<3) /* 12bits (uncommon, jp2/DPX support) */
498 #define R_IMF_CHAN_DEPTH_16 (1<<4) /* 16bits (tiff, halff float exr) */
499 #define R_IMF_CHAN_DEPTH_24 (1<<5) /* 24bits (unused) */
500 #define R_IMF_CHAN_DEPTH_32 (1<<6) /* 32bits (full float exr) */
502 /* ImageFormatData.planes */
503 #define R_IMF_PLANES_RGB 24
504 #define R_IMF_PLANES_RGBA 32
505 #define R_IMF_PLANES_BW 8
507 /* ImageFormatData.exr_codec */
508 #define R_IMF_EXR_CODEC_NONE 0
509 #define R_IMF_EXR_CODEC_PXR24 1
510 #define R_IMF_EXR_CODEC_ZIP 2
511 #define R_IMF_EXR_CODEC_PIZ 3
512 #define R_IMF_EXR_CODEC_RLE 4
513 #define R_IMF_EXR_CODEC_ZIPS 5
514 #define R_IMF_EXR_CODEC_B44 6
515 #define R_IMF_EXR_CODEC_B44A 7
516 #define R_IMF_EXR_CODEC_DWAA 8
517 #define R_IMF_EXR_CODEC_DWAB 9
518 #define R_IMF_EXR_CODEC_MAX 10
520 /* ImageFormatData.jp2_flag */
521 #define R_IMF_JP2_FLAG_YCC (1<<0) /* when disabled use RGB */ /* was R_JPEG2K_YCC */
522 #define R_IMF_JP2_FLAG_CINE_PRESET (1<<1) /* was R_JPEG2K_CINE_PRESET */
523 #define R_IMF_JP2_FLAG_CINE_48 (1<<2) /* was R_JPEG2K_CINE_48FPS */
525 /* ImageFormatData.jp2_codec */
526 #define R_IMF_JP2_CODEC_JP2 0
527 #define R_IMF_JP2_CODEC_J2K 1
529 /* ImageFormatData.cineon_flag */
530 #define R_IMF_CINEON_FLAG_LOG (1<<0) /* was R_CINEON_LOG */
532 /* ImageFormatData.tiff_codec */
534 R_IMF_TIFF_CODEC_DEFLATE = 0,
535 R_IMF_TIFF_CODEC_LZW = 1,
536 R_IMF_TIFF_CODEC_PACKBITS = 2,
537 R_IMF_TIFF_CODEC_NONE = 3,
540 typedef struct BakeData {
541 struct ImageFormatData im_format;
549 float cage_extrusion;
552 char normal_swizzle[3];
558 struct Object *cage_object;
561 /* BakeData.normal_swizzle (char) */
562 typedef enum eBakeNormalSwizzle {
569 } eBakeNormalSwizzle;
571 /* BakeData.save_mode (char) */
572 typedef enum eBakeSaveMode {
573 R_BAKE_SAVE_INTERNAL = 0,
574 R_BAKE_SAVE_EXTERNAL = 1,
577 /* BakeData.pass_filter */
578 typedef enum eBakePassFilter {
579 R_BAKE_PASS_FILTER_NONE = 0,
580 R_BAKE_PASS_FILTER_AO = (1 << 0),
581 R_BAKE_PASS_FILTER_EMIT = (1 << 1),
582 R_BAKE_PASS_FILTER_DIFFUSE = (1 << 2),
583 R_BAKE_PASS_FILTER_GLOSSY = (1 << 3),
584 R_BAKE_PASS_FILTER_TRANSM = (1 << 4),
585 R_BAKE_PASS_FILTER_SUBSURFACE = (1 << 5),
586 R_BAKE_PASS_FILTER_DIRECT = (1 << 6),
587 R_BAKE_PASS_FILTER_INDIRECT = (1 << 7),
588 R_BAKE_PASS_FILTER_COLOR = (1 << 8),
591 #define R_BAKE_PASS_FILTER_ALL (~0)
593 /* RenderEngineSettingsClay.options */
594 typedef enum ClayFlagSettings {
595 CLAY_USE_AO = (1 << 0),
596 CLAY_USE_HSV = (1 << 1),
599 /* *************************************************************** */
602 typedef struct RenderData {
603 struct ImageFormatData im_format;
605 struct AviCodecData *avicodecdata;
606 struct FFMpegCodecData ffcodecdata;
608 /** Frames as in 'images'. */
609 int cfra, sfra, efra;
610 /** Subframe offset from cfra, in 0.0-1.0. */
612 /** Start+end frames of preview range. */
615 int images, framapto;
618 float framelen, blurfac;
620 /** Frames to jump during render/playback. */
623 /** Standalone player stereo settings */ // XXX deprecated since .2.5
624 short stereomode DNA_DEPRECATED;
626 /** For the dimensions presets menu. */
627 short dimensionspreset;
636 * The desired number of pixels in the x direction
640 * The desired number of pixels in the y direction
645 * render tile dimensions
649 short planes DNA_DEPRECATED;
650 short imtype DNA_DEPRECATED;
651 short subimtype DNA_DEPRECATED;
652 short quality DNA_DEPRECATED;
655 * Render to image editor, fullscreen or to new window.
658 char use_lock_interface;
662 * Flags for render settings. Use bit-masking to access the settings.
667 * Flags for render settings. Use bit-masking to access the settings.
672 * What to do with the sky/background. Picks sky/premul/key
673 * blending for the background
678 * The number of samples to use per pixel.
682 short frs_sec, pad[7];
685 /* safety, border and display rect */
689 /* information on different layers to be rendered */
690 /** Converted to Scene->view_layers. */
691 ListBase layers DNA_DEPRECATED;
692 /** Converted to Scene->active_layer. */
693 short actlay DNA_DEPRECATED;
697 * Adjustment factors for the aspect ratio in the x direction, was a short in 2.45
704 * Value used to define filter size for all filter options */
708 /* color management settings - color profiles, gamma correction, etc */
711 /* Dither noise intensity */
712 float dither_intensity;
714 /* Bake Render options */
715 short bake_mode, bake_flag;
716 short bake_filter, bake_samples;
717 float bake_biasdist, bake_user_scale;
719 /* path to render output */
720 /** 1024 = FILE_MAX. */
725 /** Select one of blenders bitmap fonts. */
726 short stamp_font_id, pad3;
728 /* stamp info user data. */
729 char stamp_udata[768];
731 /* foreground/background color. */
735 /* sequencer options */
739 /** Flag use for sequence render/draw. */
743 /* render simplify */
744 short simplify_subsurf;
745 short simplify_subsurf_render;
746 short simplify_gpencil;
748 float simplify_particles;
749 float simplify_particles_render;
751 /* Freestyle line thickness options */
752 int line_thickness_mode;
754 float unit_line_thickness;
761 struct BakeData bake;
763 int preview_start_resolution;
764 short preview_pixel_size;
766 /* Type of the debug pass to use.
767 * Only used when built with debug passes support.
769 short debug_pass_type;
772 /** SceneRenderView. */
778 short hair_type, hair_subdiv;
780 /* Motion blur shutter */
781 struct CurveMapping mblur_shutter_curve;
784 /* RenderData.hair_type */
785 typedef enum eHairType {
786 SCE_HAIR_SHAPE_STRAND = 0,
787 SCE_HAIR_SHAPE_STRIP = 1,
791 /* *************************************************************** */
792 /* Render Conversion/Simplfication Settings */
794 /* control render convert and shading engine */
795 typedef struct RenderProfile {
796 struct RenderProfile *next, *prev;
801 short shadbufsample_max;
804 float ao_error, pad2;
809 /* ToolSettings.uv_sculpt_settings */
810 #define UV_SCULPT_LOCK_BORDERS 1
811 #define UV_SCULPT_ALL_ISLANDS 2
813 /* ToolSettings.uv_sculpt_tool */
814 #define UV_SCULPT_TOOL_PINCH 1
815 #define UV_SCULPT_TOOL_RELAX 2
816 #define UV_SCULPT_TOOL_GRAB 3
818 /* ToolSettings.uv_relax_method */
819 #define UV_SCULPT_TOOL_RELAX_LAPLACIAN 1
820 #define UV_SCULPT_TOOL_RELAX_HC 2
823 #define STEREO_RIGHT_NAME "right"
824 #define STEREO_LEFT_NAME "left"
825 #define STEREO_RIGHT_SUFFIX "_R"
826 #define STEREO_LEFT_SUFFIX "_L"
828 /* View3D.stereo3d_camera / View3D.multiview_eye / ImageUser.multiview_eye */
829 typedef enum eStereoViews {
836 /* *************************************************************** */
839 typedef struct TimeMarker {
840 struct TimeMarker *next, *prev;
844 struct Object *camera;
847 /* *************************************************************** */
848 /* Paint Mode/Tool Data */
850 #define PAINT_MAX_INPUT_SAMPLES 64
852 typedef struct Paint_Runtime {
853 /* Avoid having to compare with scene pointer everywhere. */
854 unsigned int tool_offset;
855 unsigned short ob_mode;
859 /* We might want to store other things here. */
860 typedef struct PaintToolSlot {
864 /* Paint Tool Base */
865 typedef struct Paint {
868 /* Each tool has it's own active brush,
869 * The currently active tool is defined by the current 'brush'. */
870 struct PaintToolSlot *tool_slots;
874 struct Palette *palette;
876 struct CurveMapping *cavity_curve;
878 /* WM Paint cursor */
880 unsigned char paint_cursor_col[4];
882 /* enum ePaintFlags */
885 /* Paint stroke can use up to PAINT_MAX_INPUT_SAMPLES inputs to
886 * smooth the stroke */
887 int num_input_samples;
889 /* flags used for symmetry */
892 float tile_offset[3];
895 struct Paint_Runtime runtime;
898 /* ------------------------------------------- */
901 /* Texture/Image Editor */
902 typedef struct ImagePaintSettings {
905 short flag, missing_data;
907 /* for projection painting only */
908 short seam_bleed, normal_angle;
909 /** Capture size for re-projection. */
910 short screen_grab_size[2];
912 /** Mode used for texture painting. */
917 /** Workaround until we support true layer masks. */
918 struct Image *stencil;
919 /** Clone layer for image mode for projective texture painting. */
921 /** Canvas when the explicit system is used for painting. */
922 struct Image *canvas;
923 float stencil_col[3];
924 /** Dither amount used when painting on byte images. */
926 } ImagePaintSettings;
928 /* ------------------------------------------- */
931 /* Settings for a Particle Editing Brush */
932 typedef struct ParticleBrushData {
933 /** Common setting. */
935 /** For specific brushes only. */
936 short step, invert, count;
941 /* Particle Edit Mode Settings */
942 typedef struct ParticleEditSettings {
948 ParticleBrushData brush[7];
952 float emitterdist, rt;
957 int draw_step, fade_frames;
960 struct Object *object;
961 struct Object *shape_object;
962 } ParticleEditSettings;
964 /* ------------------------------------------- */
968 typedef struct Sculpt {
971 /* For rotating around a pivot point */
972 //float pivot[3]; XXX not used?
975 /* Control tablet input */
976 //char tablet_size, tablet_strength; XXX not used?
979 /* Maximum edge length for dynamic topology sculpting (in pixels) */
982 /* Direction used for SCULPT_OT_symmetrize operator */
983 int symmetrize_direction;
985 /* gravity factor for sculpting */
986 float gravity_factor;
988 /* scale for constant detail size */
989 /** Constant detail resolution (Blender unit / constant_detail). */
990 float constant_detail;
991 float detail_percent;
994 struct Object *gravity_object;
997 typedef struct UvSculpt {
1001 /* grease pencil drawing brushes */
1002 typedef struct GpPaint {
1006 /* ------------------------------------------- */
1010 typedef struct VPaint {
1014 /** For mirrored painting. */
1020 /* weight paint only */
1021 VP_FLAG_VGROUP_RESTRICT = (1 << 7)
1024 /* ------------------------------------------- */
1025 /* GPencil Stroke Sculpting */
1027 /* GP_Sculpt_Settings.brushtype */
1028 typedef enum eGP_Sculpt_Types {
1029 GP_SCULPT_TYPE_SMOOTH = 0,
1030 GP_SCULPT_TYPE_THICKNESS = 1,
1031 GP_SCULPT_TYPE_STRENGTH = 2,
1032 GP_SCULPT_TYPE_GRAB = 3,
1033 GP_SCULPT_TYPE_PUSH = 4,
1034 GP_SCULPT_TYPE_TWIST = 5,
1035 GP_SCULPT_TYPE_PINCH = 6,
1036 GP_SCULPT_TYPE_RANDOMIZE = 7,
1037 GP_SCULPT_TYPE_CLONE = 8,
1038 GP_SCULPT_TYPE_SUBDIVIDE = 9,
1039 GP_SCULPT_TYPE_SIMPLIFY = 10,
1040 /* add any sculpt brush above this value */
1041 GP_SCULPT_TYPE_WEIGHT = 11,
1042 /* add any weight paint brush below this value. Do no mix brushes */
1044 /* !!! Update GP_Sculpt_Data brush[###]; below !!! */
1048 /* GP_Sculpt_Settings.lock_axis */
1049 typedef enum eGP_Lockaxis_Types {
1050 GP_LOCKAXIS_VIEW = 0,
1054 } eGP_Lockaxis_Types;
1056 /* Settings for a GPencil Stroke Sculpting Brush */
1057 typedef struct GP_Sculpt_Data {
1058 /** Radius of brush. */
1060 /** EGP_Sculpt_Flag. */
1062 /** Strength of effect. */
1064 /** Cursor color for add. */
1065 float curcolor_add[3];
1066 /** Cursor color for sub. */
1067 float curcolor_sub[3];
1068 /** Target weight. */
1073 /* GP_Sculpt_Data.flag */
1074 typedef enum eGP_Sculpt_Flag {
1075 /* invert the effect of the brush */
1076 GP_SCULPT_FLAG_INVERT = (1 << 0),
1077 /* adjust strength using pen pressure */
1078 GP_SCULPT_FLAG_USE_PRESSURE = (1 << 1),
1080 /* strength of brush falls off with distance from cursor */
1081 GP_SCULPT_FLAG_USE_FALLOFF = (1 << 2),
1083 /* smooth brush affects pressure values as well */
1084 GP_SCULPT_FLAG_SMOOTH_PRESSURE = (1 << 3),
1085 /* enable screen cursor */
1086 GP_SCULPT_FLAG_ENABLE_CURSOR = (1 << 4),
1087 /* temporary invert action */
1088 GP_SCULPT_FLAG_TMP_INVERT = (1 << 5),
1089 /* adjust radius using pen pressure */
1090 GP_SCULPT_FLAG_PRESSURE_RADIUS = (1 << 6),
1093 /* GPencil Stroke Sculpting Settings */
1094 typedef struct GP_Sculpt_Settings {
1095 /** GP_SCULPT_TYPE_MAX. */
1096 GP_Sculpt_Data brush[12];
1100 /** #eGP_Sculpt_Types (sculpt). */
1102 /** #eGP_Sculpt_SettingsFlag. */
1104 /** #eGP_Lockaxis_Types lock drawing to one axis. */
1108 /* weight paint is a submode of sculpt but use its own index. All weight paint
1109 * brushes must be defined at the end of the brush array.
1111 /** #eGP_Sculpt_Types (weight paint). */
1114 /** Multiframe edit falloff effect by frame. */
1115 struct CurveMapping *cur_falloff;
1116 /** Curve used for primitve tools. */
1117 struct CurveMapping *cur_primitive;
1118 } GP_Sculpt_Settings;
1120 /* GP_Sculpt_Settings.flag */
1121 typedef enum eGP_Sculpt_SettingsFlag {
1122 /* only affect selected points */
1123 GP_SCULPT_SETT_FLAG_SELECT_MASK = (1 << 0),
1124 /* apply brush to position */
1125 GP_SCULPT_SETT_FLAG_APPLY_POSITION = (1 << 1),
1126 /* apply brush to strength */
1127 GP_SCULPT_SETT_FLAG_APPLY_STRENGTH = (1 << 2),
1128 /* apply brush to thickness */
1129 GP_SCULPT_SETT_FLAG_APPLY_THICKNESS = (1 << 3),
1130 /* apply brush to thickness */
1131 GP_SCULPT_SETT_FLAG_WEIGHT_MODE = (1 << 4),
1132 /* enable falloff for multiframe editing */
1133 GP_SCULPT_SETT_FLAG_FRAME_FALLOFF = (1 << 5),
1134 /* apply brush to uv data */
1135 GP_SCULPT_SETT_FLAG_APPLY_UV = (1 << 6),
1136 /* apply primitve curve */
1137 GP_SCULPT_SETT_FLAG_PRIMITIVE_CURVE = (1 << 7),
1138 } eGP_Sculpt_SettingsFlag;
1140 /* Settings for GP Interpolation Operators */
1141 typedef struct GP_Interpolate_Settings {
1142 /** #eGP_Interpolate_SettingsFlag. */
1145 /** #eGP_Interpolate_Type - Interpolation Mode. */
1147 /** #eBezTriple_Easing - Easing mode (if easing equation used). */
1150 /** BEZT_IPO_BACK. */
1152 /** BEZT_IPO_ELASTIC. */
1153 float amplitude, period;
1155 /** Custom interpolation curve (for use with GP_IPO_CURVEMAP). */
1156 struct CurveMapping *custom_ipo;
1157 } GP_Interpolate_Settings;
1159 /* GP_Interpolate_Settings.flag */
1160 typedef enum eGP_Interpolate_SettingsFlag {
1161 /* apply interpolation to all layers */
1162 GP_TOOLFLAG_INTERPOLATE_ALL_LAYERS = (1 << 0),
1163 /* apply interpolation to only selected */
1164 GP_TOOLFLAG_INTERPOLATE_ONLY_SELECTED = (1 << 1),
1165 } eGP_Interpolate_SettingsFlag;
1167 /* GP_Interpolate_Settings.type */
1168 typedef enum eGP_Interpolate_Type {
1169 /* Traditional Linear Interpolation */
1172 /* CurveMap Defined Interpolation */
1173 GP_IPO_CURVEMAP = 1,
1175 /* Easing Equations */
1186 } eGP_Interpolate_Type;
1188 /* *************************************************************** */
1189 /* Unified Paint Settings
1192 /* These settings can override the equivalent fields in the active
1193 * Brush for any paint mode; the flag field controls whether these
1194 * values are used */
1195 typedef struct UnifiedPaintSettings {
1196 /* unified radius of brush in pixels */
1199 /* unified radius of brush in Blender units */
1200 float unprojected_radius;
1202 /* unified strength of brush */
1205 /* unified brush weight, [0, 1] */
1208 /* unified brush color */
1210 /* unified brush secondary color */
1211 float secondary_rgb[3];
1213 /* user preferences for sculpt and paint */
1218 /* record movement of mouse so that rake can start at an intuitive angle */
1220 float last_rake_angle;
1222 int last_stroke_valid;
1223 float average_stroke_accum[3];
1224 int average_stroke_counter;
1227 float brush_rotation;
1228 float brush_rotation_sec;
1230 /*******************************************************************************
1231 * all data below are used to communicate with cursor drawing and tex sampling *
1232 *******************************************************************************/
1236 * Normalization factor due to accumulated value of curve along spacing.
1237 * Calculated when brush spacing changes to dampen strength of stroke
1238 * if space attenuation is used.
1240 float overlap_factor;
1242 /* check is there an ongoing stroke right now */
1246 char do_linear_conversion;
1248 /* store last location of stroke or whether the mesh was hit. Valid only while stroke is active */
1249 float last_location[3];
1252 float anchored_initial_mouse[2];
1254 /* radius of brush, premultiplied with pressure.
1255 * In case of anchored brushes contains the anchored radius */
1258 /* drawing pressure */
1259 float size_pressure_value;
1261 /* position of mouse, used to sample the texture */
1264 /* position of mouse, used to sample the mask texture */
1265 float mask_tex_mouse[2];
1267 /* ColorSpace cache to avoid locking up during sampling */
1268 struct ColorSpace *colorspace;
1269 } UnifiedPaintSettings;
1271 /* UnifiedPaintSettings.flag */
1273 UNIFIED_PAINT_SIZE = (1 << 0),
1274 UNIFIED_PAINT_ALPHA = (1 << 1),
1275 UNIFIED_PAINT_WEIGHT = (1 << 5),
1276 UNIFIED_PAINT_COLOR = (1 << 6),
1278 /* only used if unified size is enabled, mirrors the brush flags
1279 * BRUSH_LOCK_SIZE and BRUSH_SIZE_PRESSURE */
1280 UNIFIED_PAINT_BRUSH_LOCK_SIZE = (1 << 2),
1281 UNIFIED_PAINT_BRUSH_SIZE_PRESSURE = (1 << 3),
1283 /* only used if unified alpha is enabled, mirrors the brush flag
1284 * BRUSH_ALPHA_PRESSURE */
1285 UNIFIED_PAINT_BRUSH_ALPHA_PRESSURE = (1 << 4)
1286 } eUnifiedPaintSettingsFlags;
1289 typedef struct CurvePaintSettings {
1296 short error_threshold;
1297 float radius_min, radius_max;
1298 float radius_taper_start, radius_taper_end;
1299 float surface_offset;
1301 } CurvePaintSettings;
1303 /* CurvePaintSettings.flag */
1305 CURVE_PAINT_FLAG_CORNERS_DETECT = (1 << 0),
1306 CURVE_PAINT_FLAG_PRESSURE_RADIUS = (1 << 1),
1307 CURVE_PAINT_FLAG_DEPTH_STROKE_ENDPOINTS = (1 << 2),
1308 CURVE_PAINT_FLAG_DEPTH_STROKE_OFFSET_ABS = (1 << 3),
1311 /* CurvePaintSettings.fit_method */
1313 CURVE_PAINT_FIT_METHOD_REFIT = 0,
1314 CURVE_PAINT_FIT_METHOD_SPLIT = 1,
1317 /* CurvePaintSettings.depth_mode */
1319 CURVE_PAINT_PROJECT_CURSOR = 0,
1320 CURVE_PAINT_PROJECT_SURFACE = 1,
1323 /* CurvePaintSettings.surface_plane */
1325 CURVE_PAINT_SURFACE_PLANE_NORMAL_VIEW = 0,
1326 CURVE_PAINT_SURFACE_PLANE_NORMAL_SURFACE = 1,
1327 CURVE_PAINT_SURFACE_PLANE_VIEW = 2,
1331 /* *************************************************************** */
1334 /* Stats for Meshes */
1335 typedef struct MeshStatVis {
1341 float overhang_min, overhang_max;
1344 float thickness_min, thickness_max;
1345 char thickness_samples;
1349 float distort_min, distort_max;
1352 float sharp_min, sharp_max;
1356 /* *************************************************************** */
1359 typedef struct ToolSettings {
1360 /** Vertex paint. */
1362 /** Weight paint. */
1367 /** Gpencil paint. */
1370 /* Vertex group weight - used only for editmode, not weight
1372 float vgroup_weight;
1374 /** Remove doubles limit. */
1379 /* Selection Mode for Mesh */
1382 /* UV Calculation */
1388 float uvcalc_margin;
1391 /** Runtime only. */
1392 short autoik_chainlen;
1395 /** Flags/options for how the tool works. */
1398 /** Stroke placement settings: 3D View. */
1399 char gpencil_v3d_align;
1400 /** General 2D Editor. */
1401 char gpencil_v2d_align;
1402 /** Sequencer Preview. */
1403 char gpencil_seq_align;
1404 /** Image Editor. */
1405 char gpencil_ima_align;
1408 /** Stroke placement settings - 3D View. */
1409 char annotate_v3d_align;
1411 /** Default stroke thickness for annotation strokes. */
1412 short annotate_thickness;
1413 /** Stroke selection mode. */
1414 short gpencil_selectmode;
1416 /* Grease Pencil Sculpt */
1417 struct GP_Sculpt_Settings gp_sculpt;
1419 /* Grease Pencil Interpolation Tool(s) */
1420 struct GP_Interpolate_Settings gp_interpolate;
1422 /* Image Paint (8 bytes aligned please!) */
1423 struct ImagePaintSettings imapaint;
1425 /* Particle Editing */
1426 struct ParticleEditSettings particle;
1428 /* Transform Proportional Area of Effect */
1429 float proportional_size;
1431 /* Select Group Threshold */
1432 float select_thresh;
1434 /* Auto-Keying Mode */
1435 /** Defines in DNA_userdef_types.h. */
1438 /** Keyframe type (see DNA_curve_types.h). */
1442 char multires_subdiv_type;
1444 /* Alt+RMB option */
1446 char edge_mode_live_unwrap;
1448 /* SCE_GIZMO_SHOW_* */
1452 char transform_pivot_point;
1453 char transform_flag;
1454 char snap_mode, snap_node_mode;
1458 char snap_transform_mode_flag;
1461 char proportional, prop_mode;
1462 /** Proportional edit, object mode. */
1463 char proportional_objects;
1464 /** Proportional edit, mask editing. */
1465 char proportional_mask;
1466 /** Proportional edit, action editor. */
1467 char proportional_action;
1468 /** Proportional edit, graph editor. */
1469 char proportional_fcurve;
1470 /** Lock marker editing. */
1473 /**aUto normalizing mode in wpain.t*/
1474 char auto_normalize;
1475 /** Paint multiple bones in wpaint. */
1478 /** Subset selection filter in wpaint. */
1484 char uv_sculpt_settings;
1485 char uv_sculpt_tool;
1486 char uv_relax_method;
1487 /* XXX: these sculpt_paint_* fields are deprecated, use the
1488 * unified_paint_settings field instead! */
1489 short sculpt_paint_settings DNA_DEPRECATED; short pad5;
1490 int sculpt_paint_unified_size DNA_DEPRECATED;
1491 float sculpt_paint_unified_unprojected_radius DNA_DEPRECATED;
1492 float sculpt_paint_unified_alpha DNA_DEPRECATED;
1494 /* Unified Paint Settings */
1495 struct UnifiedPaintSettings unified_paint_settings;
1497 struct CurvePaintSettings curve_paint_settings;
1499 struct MeshStatVis statvis;
1501 /* Normal Editing */
1502 float normal_vector[3];
1506 /* *************************************************************** */
1507 /* Assorted Scene Data */
1509 /* ------------------------------------------- */
1510 /* Stats (show in Info header) */
1512 typedef struct bStats {
1513 /* scene totals for visible layers */
1514 int totobj, totlamp, totobjsel, totcurve, totmesh, totarmature;
1515 int totvert, totface;
1518 /* ------------------------------------------- */
1521 typedef struct UnitSettings {
1522 /* Display/Editing unit options for each scene */
1523 /** Maybe have other unit conversions?. */
1525 /** Imperial, metric etc. */
1527 /** Not implemented as a proper unit system yet. */
1528 char system_rotation;
1538 /* ------------------------------------------- */
1539 /* Global/Common Physics Settings */
1541 typedef struct PhysicsSettings {
1543 int flag, quick_cache_step, rt;
1546 /* ------------------------------------------- */
1547 /* Safe Area options used in Camera View & VSE
1549 typedef struct DisplaySafeAreas {
1550 /* each value represents the (x,y) margins as a multiplier.
1551 * 'center' in this context is just the name for a different kind of safe-area */
1555 /** Image/Graphics Safe. */
1558 /* use for alternate aspect ratio */
1559 float title_center[2];
1560 float action_center[2];
1563 /* ------------------------------------------- */
1564 /* Scene Display - used for store scene specific display settings for the 3d view */
1565 typedef struct SceneDisplay {
1566 /** Light direction for shadows/highlight. */
1567 float light_direction[3];
1568 float shadow_shift, shadow_focus;
1570 /** Settings for Cavity Shader. */
1571 float matcap_ssao_distance;
1572 float matcap_ssao_attenuation;
1573 int matcap_ssao_samples;
1575 /** OpenGL render engine settings. */
1576 View3DShading shading;
1579 typedef struct SceneEEVEE {
1581 int gi_diffuse_bounces;
1582 int gi_cubemap_resolution;
1583 int gi_visibility_resolution;
1584 float gi_irradiance_smoothing;
1585 float gi_glossy_clamp;
1586 float gi_filter_quality;
1589 float gi_cubemap_draw_size;
1590 float gi_irradiance_draw_size;
1593 int taa_render_samples;
1595 float sss_jitter_threshold;
1598 float ssr_max_roughness;
1599 float ssr_thickness;
1600 float ssr_border_fade;
1601 float ssr_firefly_fac;
1603 float volumetric_start;
1604 float volumetric_end;
1605 int volumetric_tile_size;
1606 int volumetric_samples;
1607 float volumetric_sample_distribution;
1608 float volumetric_light_clamp;
1609 int volumetric_shadow_samples;
1611 float gtao_distance;
1615 float bokeh_max_size;
1616 float bokeh_threshold;
1618 float bloom_color[3];
1619 float bloom_threshold;
1621 float bloom_intensity;
1625 int motion_blur_samples;
1626 float motion_blur_shutter;
1629 int shadow_cube_size;
1630 int shadow_cascade_size;
1632 struct LightCache *light_cache;
1633 char light_cache_info[64];
1636 float light_threshold;
1639 /* *************************************************************** */
1640 /* Scene ID-Block */
1642 typedef struct TransformOrientationSlot {
1647 } TransformOrientationSlot;
1649 /* Indices when used in Scene.orientation. */
1651 SCE_ORIENT_DEFAULT = 0,
1652 SCE_ORIENT_TRANSLATE = 1,
1653 SCE_ORIENT_ROTATE = 2,
1654 SCE_ORIENT_SCALE = 3,
1657 typedef struct Scene {
1659 /** Animation data (must be immediately after id for utilities to use it). */
1660 struct AnimData *adt;
1662 struct Object *camera;
1663 struct World *world;
1667 ListBase base DNA_DEPRECATED;
1669 struct Base *basact DNA_DEPRECATED;
1672 /** 3d cursor location. */
1673 View3DCursor cursor;
1675 /** Bitflags for layer visibility (deprecated). */
1676 unsigned int lay DNA_DEPRECATED;
1677 /** Active layer (deprecated) */
1678 int layact DNA_DEPRECATED;
1681 /** Various settings. */
1687 struct bNodeTree *nodetree;
1689 /** Sequence editor data is allocated here. */
1692 /** Default allocated now. */
1693 struct ToolSettings *toolsettings;
1695 struct DisplaySafeAreas safe_areas;
1697 /* migrate or replace? depends on some internal things... */
1698 /* no, is on the right place (ton) */
1699 struct RenderData r;
1700 struct AudioData audio;
1703 ListBase transform_spaces;
1705 /** First is the [scene, translate, rotate, scale]. */
1706 TransformOrientationSlot orientation_slots[4];
1709 void *playback_handle;
1710 void *sound_scrub_handle;
1711 void *speaker_handles;
1713 /** (runtime) info/cache used for presenting playback framerate info to the user. */
1716 /* none of the dependency graph vars is mean to be saved */
1717 struct GHash *depsgraph_hash;
1720 /* User-Defined KeyingSets */
1722 * Index of the active KeyingSet.
1723 * first KeyingSet has index 1, 'none' active is 0, 'add new' is -1
1725 int active_keyingset;
1726 /** KeyingSets for this scene */
1727 ListBase keyingsets;
1730 struct UnitSettings unit;
1732 /* Grease Pencil - Annotations */
1733 struct bGPdata *gpd;
1735 /* Movie Tracking */
1736 /** Active movie clip. */
1737 struct MovieClip *clip;
1739 /* Physics simulation settings */
1740 struct PhysicsSettings physics_settings;
1743 /* XXX. runtime flag for drawing, actually belongs in the window,
1744 * only used by BKE_object_handle_update() */
1745 uint64_t customdata_mask;
1746 /* XXX. same as above but for temp operator use (gl renders) */
1747 uint64_t customdata_mask_modal;
1750 /* Color Management */
1751 ColorManagedViewSettings view_settings;
1752 ColorManagedDisplaySettings display_settings;
1753 ColorManagedColorspaceSettings sequencer_colorspace_settings;
1755 /* RigidBody simulation world+settings */
1756 struct RigidBodyWorld *rigidbody_world;
1758 struct PreviewImage *preview;
1760 ListBase view_layers;
1761 /* Not an actual datablock, but memory owned by scene. */
1762 Collection *master_collection;
1763 struct SceneCollection *collection DNA_DEPRECATED;
1765 /** Settings to be override by workspaces. */
1766 IDProperty *layer_properties;
1768 struct SceneDisplay display;
1769 struct SceneEEVEE eevee;
1772 /* **************** RENDERDATA ********************* */
1774 /* RenderData.flag */
1775 /* use preview range */
1776 #define SCER_PRV_RANGE (1<<0)
1777 #define SCER_LOCK_FRAME_SELECTION (1<<1)
1778 /* show/use subframes (for checking motion blur) */
1779 #define SCER_SHOW_SUBFRAME (1<<3)
1781 /* RenderData.mode */
1782 #define R_OSA (1 << 0)
1783 #define R_MODE_DEPRECATED_1 (1 << 1) /* cleared */
1784 #define R_MODE_DEPRECATED_2 (1 << 2) /* cleared */
1785 #define R_MODE_DEPRECATED_3 (1 << 3) /* cleared */
1786 #define R_MODE_DEPRECATED_4 (1 << 4) /* cleared */
1787 #define R_MODE_DEPRECATED_5 (1 << 5) /* cleared */
1788 #define R_MODE_DEPRECATED_6 (1 << 6) /* cleared */
1789 #define R_MODE_DEPRECATED_7 (1 << 7) /* cleared */
1790 #define R_MODE_DEPRECATED_8 (1 << 8) /* cleared */
1791 #define R_BORDER (1 << 9)
1792 #define R_MODE_DEPRECATED_10 (1 << 10) /* cleared */
1793 #define R_CROP (1 << 11)
1794 /* Disable camera switching: runtime (DURIAN_CAMERA_SWITCH) */
1795 #define R_NO_CAMERA_SWITCH (1 << 12)
1796 #define R_MODE_DEPRECATED_13 (1 << 13) /* cleared */
1797 #define R_MBLUR (1 << 14)
1798 /* unified was here */
1799 #define R_MODE_DEPRECATED_16 (1 << 16) /* cleared */
1800 #define R_MODE_DEPRECATED_17 (1 << 17) /* cleared */
1801 #define R_MODE_DEPRECATED_18 (1 << 18) /* cleared */
1802 #define R_MODE_DEPRECATED_19 (1 << 19) /* cleared */
1803 #define R_FIXED_THREADS (1 << 19)
1805 #define R_MODE_DEPRECATED_20 (1 << 20) /* cleared */
1806 #define R_MODE_DEPRECATED_21 (1 << 21) /* cleared */
1807 #define R_NO_OVERWRITE (1 << 22) /* skip existing files */
1808 #define R_TOUCH (1 << 23) /* touch files before rendering */
1809 #define R_SIMPLIFY (1 << 24)
1810 #define R_EDGE_FRS (1 << 25) /* R_EDGE reserved for Freestyle */
1811 #define R_PERSISTENT_DATA (1 << 26) /* keep data around for re-render */
1812 #define R_MODE_DEPRECATED_27 (1 << 27) /* cleared */
1814 /* RenderData.seq_flag */
1816 // R_SEQ_GL_PREV = (1 << 1), // UNUSED, we just use setting from seq_prev_type now.
1817 // R_SEQ_GL_REND = (1 << 2), // UNUSED, opengl render has its own operator now.
1818 R_SEQ_SOLID_TEX = (1 << 3),
1819 R_SEQ_CAMERA_DOF = (1 << 4),
1822 /* RenderData.displaymode */
1823 #define R_OUTPUT_SCREEN 0
1824 #define R_OUTPUT_AREA 1
1825 #define R_OUTPUT_WINDOW 2
1826 #define R_OUTPUT_NONE 3
1827 /*#define R_OUTPUT_FORKED 4*/
1829 /* RenderData.filtertype (used for nodes) */
1830 #define R_FILTER_BOX 0
1831 #define R_FILTER_TENT 1
1832 #define R_FILTER_QUAD 2
1833 #define R_FILTER_CUBIC 3
1834 #define R_FILTER_CATROM 4
1835 #define R_FILTER_GAUSS 5
1836 #define R_FILTER_MITCH 6
1837 #define R_FILTER_FAST_GAUSS 7
1839 /* RenderData.scemode */
1840 #define R_DOSEQ (1 << 0)
1841 #define R_BG_RENDER (1 << 1)
1842 /* passepartout is camera option now, keep this for backward compatibility */
1843 #define R_PASSEPARTOUT (1 << 2)
1844 #define R_BUTS_PREVIEW (1 << 3)
1845 #define R_EXTENSION (1 << 4)
1846 #define R_MATNODE_PREVIEW (1 << 5)
1847 #define R_DOCOMP (1 << 6)
1848 #define R_COMP_CROP (1 << 7)
1849 #define R_SCEMODE_DEPRECATED_8 (1 << 8) /* cleared */
1850 #define R_SINGLE_LAYER (1 << 9)
1851 #define R_EXR_TILE_FILE (1 << 10)
1852 #define R_SCEMODE_DEPRECATED_11 (1 << 11) /* cleared */
1853 #define R_NO_IMAGE_LOAD (1 << 12)
1854 #define R_SCEMODE_DEPRECATED_13 (1 << 13) /* cleared */
1855 #define R_NO_FRAME_UPDATE (1 << 14)
1856 #define R_FULL_SAMPLE (1 << 15)
1857 #define R_SCEMODE_DEPRECATED_16 (1 << 16) /* cleared */
1858 #define R_SCEMODE_DEPRECATED_17 (1 << 17) /* cleared */
1859 #define R_TEXNODE_PREVIEW (1 << 18)
1860 #define R_SCEMODE_DEPRECATED_19 (1 << 19) /* cleared */
1861 #define R_EXR_CACHE_FILE (1 << 20)
1862 #define R_MULTIVIEW (1 << 21)
1864 /* RenderData.stamp */
1865 #define R_STAMP_TIME (1 << 0)
1866 #define R_STAMP_FRAME (1 << 1)
1867 #define R_STAMP_DATE (1 << 2)
1868 #define R_STAMP_CAMERA (1 << 3)
1869 #define R_STAMP_SCENE (1 << 4)
1870 #define R_STAMP_NOTE (1 << 5)
1871 #define R_STAMP_DRAW (1 << 6) /* draw in the image */
1872 #define R_STAMP_MARKER (1 << 7)
1873 #define R_STAMP_FILENAME (1 << 8)
1874 #define R_STAMP_SEQSTRIP (1 << 9)
1875 #define R_STAMP_RENDERTIME (1 << 10)
1876 #define R_STAMP_CAMERALENS (1 << 11)
1877 #define R_STAMP_STRIPMETA (1 << 12)
1878 #define R_STAMP_MEMORY (1 << 13)
1879 #define R_STAMP_HIDE_LABELS (1 << 14)
1880 #define R_STAMP_FRAME_RANGE (1 << 15)
1881 #define R_STAMP_HOSTNAME (1 << 16)
1882 #define R_STAMP_ALL (R_STAMP_TIME|R_STAMP_FRAME|R_STAMP_DATE|R_STAMP_CAMERA|R_STAMP_SCENE| \
1883 R_STAMP_NOTE|R_STAMP_MARKER|R_STAMP_FILENAME|R_STAMP_SEQSTRIP| \
1884 R_STAMP_RENDERTIME|R_STAMP_CAMERALENS|R_STAMP_MEMORY| \
1885 R_STAMP_HIDE_LABELS|R_STAMP_FRAME_RANGE|R_STAMP_HOSTNAME)
1887 /* RenderData.alphamode */
1889 #define R_ALPHAPREMUL 1
1890 /*#define R_ALPHAKEY 2*/ /* deprecated, shouldn't be used */
1892 /* RenderData.color_mgt_flag */
1894 R_COLOR_MANAGEMENT = (1 << 0), /* deprecated, should only be used in versioning code only */
1895 /*R_COLOR_MANAGEMENT_PREDIVIDE = (1 << 1)*/ /* deprecated, shouldn't be used */
1898 #ifdef DNA_DEPRECATED
1899 /* RenderData.subimtype flag options for imtype */
1901 R_OPENEXR_HALF = (1 << 0), /*deprecated*/
1902 R_OPENEXR_ZBUF = (1 << 1), /*deprecated*/
1903 R_PREVIEW_JPG = (1 << 2), /*deprecated*/
1904 R_CINEON_LOG = (1 << 3), /*deprecated*/
1905 R_TIFF_16BIT = (1 << 4), /*deprecated*/
1907 R_JPEG2K_12BIT = (1 << 5), /* Jpeg2000 */ /*deprecated*/
1908 R_JPEG2K_16BIT = (1 << 6), /*deprecated*/
1909 R_JPEG2K_YCC = (1 << 7), /* when disabled use RGB */ /*deprecated*/
1910 R_JPEG2K_CINE_PRESET = (1 << 8), /*deprecated*/
1911 R_JPEG2K_CINE_48FPS = (1 << 9), /*deprecated*/
1915 /* bake_mode: same as RE_BAKE_xxx defines */
1916 /* RenderData.bake_flag */
1917 #define R_BAKE_CLEAR (1 << 0)
1918 /* #define R_BAKE_OSA (1 << 1) */ /* deprecated */
1919 #define R_BAKE_TO_ACTIVE (1 << 2)
1920 /* #define R_BAKE_NORMALIZE (1 << 3) */ /* deprecated */
1921 #define R_BAKE_MULTIRES (1 << 4)
1922 #define R_BAKE_LORES_MESH (1 << 5)
1923 /* #define R_BAKE_VCOL (1 << 6) */ /* deprecated */
1924 #define R_BAKE_USERSCALE (1 << 7)
1925 #define R_BAKE_CAGE (1 << 8)
1926 #define R_BAKE_SPLIT_MAT (1 << 9)
1927 #define R_BAKE_AUTO_NAME (1 << 10)
1929 /* RenderData.bake_normal_space */
1930 #define R_BAKE_SPACE_CAMERA 0
1931 #define R_BAKE_SPACE_WORLD 1
1932 #define R_BAKE_SPACE_OBJECT 2
1933 #define R_BAKE_SPACE_TANGENT 3
1935 /* RenderData.line_thickness_mode */
1936 #define R_LINE_THICKNESS_ABSOLUTE 1
1937 #define R_LINE_THICKNESS_RELATIVE 2
1939 /* sequencer seq_prev_type seq_rend_type */
1941 /* RenderData.engine (scene.c) */
1942 extern const char *RE_engine_id_BLENDER_EEVEE;
1943 extern const char *RE_engine_id_BLENDER_WORKBENCH;
1944 extern const char *RE_engine_id_CYCLES;
1946 /* **************** SCENE ********************* */
1948 /* note that much higher maxframes give imprecise sub-frames, see: T46859 */
1949 /* Current precision is 16 for the sub-frames closer to MAXFRAME. */
1951 /* for general use */
1952 #define MAXFRAME 1048574
1953 #define MAXFRAMEF 1048574.0f
1956 #define MINFRAMEF 0.0f
1958 /* (minimum frame number for current-frame) */
1959 #define MINAFRAME -1048574
1960 #define MINAFRAMEF -1048574.0f
1962 #define BASE_VISIBLE(v3d, base) ( \
1963 ((v3d == NULL) || ((v3d)->localvd == NULL) || ((v3d)->local_view_uuid & (base)->local_view_bits)) && \
1964 ((v3d == NULL) || (((1 << (base)->object->type) & (v3d)->object_type_exclude_viewport) == 0)) && \
1965 (((base)->flag & BASE_VISIBLE) != 0))
1966 #define BASE_SELECTABLE(v3d, base) ( \
1967 BASE_VISIBLE(v3d, base) && \
1968 ((v3d == NULL) || (((1 << (base)->object->type) & (v3d)->object_type_exclude_select) == 0)) && \
1969 (((base)->flag & BASE_SELECTABLE) != 0))
1970 #define BASE_SELECTED(v3d, base) \
1971 (BASE_VISIBLE(v3d, base) && (((base)->flag & BASE_SELECTED) != 0))
1972 #define BASE_EDITABLE(v3d, base) \
1973 (BASE_VISIBLE(v3d, base) && ((base)->object->id.lib == NULL))
1974 #define BASE_SELECTED_EDITABLE(v3d, base) \
1975 (BASE_EDITABLE(v3d, base) && (((base)->flag & BASE_SELECTED) != 0))
1977 /* deprecate this! */
1978 #define FIRSTBASE(_view_layer) ((_view_layer)->object_bases.first)
1979 #define LASTBASE(_view_layer) ((_view_layer)->object_bases.last)
1980 #define BASACT(_view_layer) ((_view_layer)->basact)
1981 #define OBACT(_view_layer) (BASACT(_view_layer) ? BASACT(_view_layer)->object: NULL)
1983 #define OBEDIT_FROM_WORKSPACE(workspace, _view_layer) \
1984 (((workspace)->object_mode & OD_MODE_EDIT) ? OBACT(_view_layer) : NULL)
1985 #define OBEDIT_FROM_OBACT(ob) \
1986 ((ob) ? (((ob)->mode & OB_MODE_EDIT) ? ob : NULL) : NULL)
1987 #define OBPOSE_FROM_OBACT(ob) \
1988 ((ob) ? (((ob)->mode & OB_MODE_POSE) ? ob : NULL) : NULL)
1989 #define OBEDIT_FROM_VIEW_LAYER(view_layer) \
1990 OBEDIT_FROM_OBACT(OBACT(view_layer))
1992 #define V3D_CAMERA_LOCAL(v3d) ((!(v3d)->scenelock && (v3d)->camera) ? (v3d)->camera : NULL)
1993 #define V3D_CAMERA_SCENE(scene, v3d) ((!(v3d)->scenelock && (v3d)->camera) ? (v3d)->camera : (scene)->camera)
1995 #define CFRA (scene->r.cfra)
1996 #define SUBFRA (scene->r.subframe)
1997 #define SFRA (scene->r.sfra)
1998 #define EFRA (scene->r.efra)
1999 #define PRVRANGEON (scene->r.flag & SCER_PRV_RANGE)
2000 #define PSFRA ((PRVRANGEON) ? (scene->r.psfra) : (scene->r.sfra))
2001 #define PEFRA ((PRVRANGEON) ? (scene->r.pefra) : (scene->r.efra))
2002 #define FRA2TIME(a) ((((double) scene->r.frs_sec_base) * (double)(a)) / (double)scene->r.frs_sec)
2003 #define TIME2FRA(a) ((((double) scene->r.frs_sec) * (double)(a)) / (double)scene->r.frs_sec_base)
2004 #define FPS (((double) scene->r.frs_sec) / (double)scene->r.frs_sec_base)
2006 /* Base.flag is in DNA_object_types.h */
2008 /* ToolSettings.transform_flag */
2010 SCE_XFORM_AXIS_ALIGN = (1 << 0),
2013 /* ToolSettings.object_flag */
2015 SCE_OBJECT_MODE_LOCK = (1 << 0),
2018 /* ToolSettings.snap_flag */
2019 #define SCE_SNAP (1 << 0)
2020 #define SCE_SNAP_ROTATE (1 << 1)
2021 #define SCE_SNAP_PEEL_OBJECT (1 << 2)
2022 #define SCE_SNAP_PROJECT (1 << 3)
2023 #define SCE_SNAP_NO_SELF (1 << 4)
2024 #define SCE_SNAP_ABS_GRID (1 << 5)
2026 /* ToolSettings.snap_target */
2027 #define SCE_SNAP_TARGET_CLOSEST 0
2028 #define SCE_SNAP_TARGET_CENTER 1
2029 #define SCE_SNAP_TARGET_MEDIAN 2
2030 #define SCE_SNAP_TARGET_ACTIVE 3
2032 /* ToolSettings.snap_mode */
2033 #define SCE_SNAP_MODE_VERTEX (1 << 0)
2034 #define SCE_SNAP_MODE_EDGE (1 << 1)
2035 #define SCE_SNAP_MODE_FACE (1 << 2)
2036 #define SCE_SNAP_MODE_VOLUME (1 << 3)
2037 #define SCE_SNAP_MODE_INCREMENT (1 << 4)
2039 /* ToolSettings.snap_node_mode */
2040 #define SCE_SNAP_MODE_GRID (1 << 5)
2041 #define SCE_SNAP_MODE_NODE_X (1 << 6)
2042 #define SCE_SNAP_MODE_NODE_Y (1 << 7)
2044 /** #ToolSettings.snap_transform_mode_flag */
2046 SCE_SNAP_TRANSFORM_MODE_TRANSLATE = (1 << 0),
2047 SCE_SNAP_TRANSFORM_MODE_ROTATE = (1 << 1),
2048 SCE_SNAP_TRANSFORM_MODE_SCALE = (1 << 2),
2051 /* ToolSettings.selectmode */
2052 #define SCE_SELECT_VERTEX (1 << 0) /* for mesh */
2053 #define SCE_SELECT_EDGE (1 << 1)
2054 #define SCE_SELECT_FACE (1 << 2)
2056 /* MeshStatVis.type */
2057 #define SCE_STATVIS_OVERHANG 0
2058 #define SCE_STATVIS_THICKNESS 1
2059 #define SCE_STATVIS_INTERSECT 2
2060 #define SCE_STATVIS_DISTORT 3
2061 #define SCE_STATVIS_SHARP 4
2063 /* ParticleEditSettings.selectmode for particles */
2064 #define SCE_SELECT_PATH (1 << 0)
2065 #define SCE_SELECT_POINT (1 << 1)
2066 #define SCE_SELECT_END (1 << 2)
2068 /* ToolSettings.prop_mode (proportional falloff) */
2069 #define PROP_SMOOTH 0
2070 #define PROP_SPHERE 1
2072 #define PROP_SHARP 3
2074 #define PROP_CONST 5
2075 #define PROP_RANDOM 6
2076 #define PROP_INVSQUARE 7
2077 #define PROP_MODE_MAX 8
2079 /* ToolSettings.proportional */
2080 #define PROP_EDIT_OFF 0
2081 #define PROP_EDIT_ON 1
2082 #define PROP_EDIT_CONNECTED 2
2083 #define PROP_EDIT_PROJECTED 3
2085 /* ToolSettings.weightuser */
2087 OB_DRAW_GROUPUSER_NONE = 0,
2088 OB_DRAW_GROUPUSER_ACTIVE = 1,
2089 OB_DRAW_GROUPUSER_ALL = 2
2092 /* toolsettings->face_strength */
2094 FACE_STRENGTH_WEAK = -16384,
2095 FACE_STRENGTH_MEDIUM = 0,
2096 FACE_STRENGTH_STRONG = 16384,
2099 /* object_vgroup.c */
2100 /* ToolSettings.vgroupsubset */
2101 typedef enum eVGroupSelect {
2103 WT_VGROUP_ACTIVE = 1,
2104 WT_VGROUP_BONE_SELECT = 2,
2105 WT_VGROUP_BONE_DEFORM = 3,
2106 WT_VGROUP_BONE_DEFORM_OFF = 4
2109 #define WT_VGROUP_MASK_ALL \
2110 ((1 << WT_VGROUP_ACTIVE) | \
2111 (1 << WT_VGROUP_BONE_SELECT) | \
2112 (1 << WT_VGROUP_BONE_DEFORM) | \
2113 (1 << WT_VGROUP_BONE_DEFORM_OFF) | \
2114 (1 << WT_VGROUP_ALL))
2118 #define SCE_DS_SELECTED (1<<0)
2119 #define SCE_DS_COLLAPSED (1<<1)
2120 #define SCE_NLA_EDIT_ON (1<<2)
2121 #define SCE_FRAME_DROP (1<<3)
2122 #define SCE_KEYS_NO_SELONLY (1<<4)
2124 /* return flag BKE_scene_base_iter_next functions */
2125 /* #define F_ERROR -1 */ /* UNUSED */
2130 /* AudioData.flag */
2131 #define AUDIO_MUTE (1<<0)
2132 #define AUDIO_SYNC (1<<1)
2133 #define AUDIO_SCRUB (1<<2)
2134 #define AUDIO_VOLUME_ANIMATED (1<<3)
2136 /* FFMpegCodecData.flags */
2138 #ifdef DNA_DEPRECATED
2139 FFMPEG_MULTIPLEX_AUDIO = (1 << 0), /* deprecated, you can choose none as audiocodec now */
2141 FFMPEG_AUTOSPLIT_OUTPUT = (1 << 1),
2142 FFMPEG_LOSSLESS_OUTPUT = (1 << 2),
2143 FFMPEG_USE_MAX_B_FRAMES = (1 << 3),
2147 typedef enum ePaintFlags {
2148 PAINT_SHOW_BRUSH = (1 << 0),
2149 PAINT_FAST_NAVIGATE = (1 << 1),
2150 PAINT_SHOW_BRUSH_ON_SURFACE = (1 << 2),
2151 PAINT_USE_CAVITY_MASK = (1 << 3)
2154 /* Paint.symmetry_flags
2155 * (for now just a duplicate of sculpt symmetry flags) */
2156 typedef enum ePaintSymmetryFlags {
2157 PAINT_SYMM_X = (1 << 0),
2158 PAINT_SYMM_Y = (1 << 1),
2159 PAINT_SYMM_Z = (1 << 2),
2160 PAINT_SYMMETRY_FEATHER = (1 << 3),
2161 PAINT_TILE_X = (1 << 4),
2162 PAINT_TILE_Y = (1 << 5),
2163 PAINT_TILE_Z = (1 << 6),
2164 } ePaintSymmetryFlags;
2166 #define PAINT_SYMM_AXIS_ALL (PAINT_SYMM_X | PAINT_SYMM_Y | PAINT_SYMM_Z)
2169 /* These can eventually be moved to paint flags? */
2170 typedef enum eSculptFlags {
2171 SCULPT_FLAG_DEPRECATED_0 = (1 << 0), /* cleared */
2172 SCULPT_FLAG_DEPRECATED_1 = (1 << 1), /* cleared */
2173 SCULPT_FLAG_DEPRECATED_2 = (1 << 2), /* cleared */
2175 SCULPT_LOCK_X = (1 << 3),
2176 SCULPT_LOCK_Y = (1 << 4),
2177 SCULPT_LOCK_Z = (1 << 5),
2179 /* deprecated, part of paint struct symmetry_flags now */
2180 SCULPT_SYMMETRY_FEATHER = (1 << 6),
2182 SCULPT_USE_OPENMP = (1 << 7),
2183 SCULPT_ONLY_DEFORM = (1 << 8),
2184 SCULPT_SHOW_DIFFUSE = (1 << 9),
2186 /* If set, the mesh will be drawn with smooth-shading in
2187 * dynamic-topology mode */
2188 SCULPT_DYNTOPO_SMOOTH_SHADING = (1 << 10),
2190 /* If set, dynamic-topology brushes will subdivide short edges */
2191 SCULPT_DYNTOPO_SUBDIVIDE = (1 << 12),
2192 /* If set, dynamic-topology brushes will collapse short edges */
2193 SCULPT_DYNTOPO_COLLAPSE = (1 << 11),
2195 /* If set, dynamic-topology detail size will be constant in object space */
2196 SCULPT_DYNTOPO_DETAIL_CONSTANT = (1 << 13),
2197 SCULPT_DYNTOPO_DETAIL_BRUSH = (1 << 14),
2198 SCULPT_DYNTOPO_DETAIL_MANUAL = (1 << 16),
2200 /* Don't display mask in viewport, but still use it for strokes. */
2201 SCULPT_HIDE_MASK = (1 << 15),
2204 /* ImagePaintSettings.mode */
2205 typedef enum eImagePaintMode {
2206 IMAGEPAINT_MODE_MATERIAL, /* detect texture paint slots from the material */
2207 IMAGEPAINT_MODE_IMAGE, /* select texture paint image directly */
2210 /* ImagePaintSettings.flag */
2211 #define IMAGEPAINT_DRAWING (1 << 0)
2212 // #define IMAGEPAINT_DRAW_TOOL (1 << 1) // deprecated
2213 // #define IMAGEPAINT_DRAW_TOOL_DRAWING (1 << 2) // deprecated
2215 /* projection painting only */
2216 /* ImagePaintSettings.flag */
2217 #define IMAGEPAINT_PROJECT_XRAY (1 << 4)
2218 #define IMAGEPAINT_PROJECT_BACKFACE (1 << 5)
2219 #define IMAGEPAINT_PROJECT_FLAT (1 << 6)
2220 #define IMAGEPAINT_PROJECT_LAYER_CLONE (1 << 7)
2221 #define IMAGEPAINT_PROJECT_LAYER_STENCIL (1 << 8)
2222 #define IMAGEPAINT_PROJECT_LAYER_STENCIL_INV (1 << 9)
2224 /* ImagePaintSettings.missing_data */
2225 #define IMAGEPAINT_MISSING_UVS (1 << 0)
2226 #define IMAGEPAINT_MISSING_MATERIAL (1 << 1)
2227 #define IMAGEPAINT_MISSING_TEX (1 << 2)
2228 #define IMAGEPAINT_MISSING_STENCIL (1 << 3)
2230 /* ToolSettings.uvcalc_flag */
2231 #define UVCALC_FILLHOLES (1 << 0)
2232 #define UVCALC_NO_ASPECT_CORRECT (1 << 1) /* would call this UVCALC_ASPECT_CORRECT, except it should be default with old file */
2233 #define UVCALC_TRANSFORM_CORRECT (1 << 2) /* adjust UV's while transforming to avoid distortion */
2234 #define UVCALC_USESUBSURF (1 << 3) /* Use mesh data after subsurf to compute UVs*/
2236 /* ToolSettings.uv_flag */
2237 #define UV_SYNC_SELECTION 1
2238 #define UV_SHOW_SAME_IMAGE 2
2240 /* ToolSettings.uv_selectmode */
2241 #define UV_SELECT_VERTEX 1
2242 #define UV_SELECT_EDGE 2
2243 #define UV_SELECT_FACE 4
2244 #define UV_SELECT_ISLAND 8
2246 /* ToolSettings.edge_mode */
2247 #define EDGE_MODE_SELECT 0
2248 #define EDGE_MODE_TAG_SEAM 1
2249 #define EDGE_MODE_TAG_SHARP 2
2250 #define EDGE_MODE_TAG_CREASE 3
2251 #define EDGE_MODE_TAG_BEVEL 4
2252 #define EDGE_MODE_TAG_FREESTYLE 5
2254 /* ToolSettings.gizmo_flag */
2256 SCE_GIZMO_SHOW_TRANSLATE = (1 << 0),
2257 SCE_GIZMO_SHOW_ROTATE = (1 << 1),
2258 SCE_GIZMO_SHOW_SCALE = (1 << 2),
2261 /* ToolSettings.gpencil_flags */
2262 typedef enum eGPencil_Flags {
2263 /* When creating new frames, the last frame gets used as the basis for the new one */
2264 GP_TOOL_FLAG_RETAIN_LAST = (1 << 1),
2265 /* Add the strokes below all strokes in the layer */
2266 GP_TOOL_FLAG_PAINT_ONBACK = (1 << 2),
2267 /* Show compact list of colors */
2268 GP_TOOL_FLAG_THUMBNAIL_LIST = (1 << 3),
2269 /* Generate wheight data for new strokes */
2270 GP_TOOL_FLAG_CREATE_WEIGHTS = (1 << 4),
2273 /* scene->r.simplify_gpencil */
2274 typedef enum eGPencil_SimplifyFlags {
2276 SIMPLIFY_GPENCIL_ENABLE = (1 << 0),
2277 /* Simplify on play */
2278 SIMPLIFY_GPENCIL_ON_PLAY = (1 << 1),
2279 /* Simplify fill on viewport */
2280 SIMPLIFY_GPENCIL_FILL = (1 << 2),
2281 /* Simplify modifier on viewport */
2282 SIMPLIFY_GPENCIL_MODIFIER = (1 << 3),
2283 /* Remove fill external line */
2284 SIMPLIFY_GPENCIL_REMOVE_FILL_LINE = (1 << 4),
2285 /* Simplify Shader FX */
2286 SIMPLIFY_GPENCIL_FX = (1 << 5),
2287 /* Simplify layer blending */
2288 SIMPLIFY_GPENCIL_BLEND = (1 << 6),
2289 } eGPencil_SimplifyFlags;
2291 /* ToolSettings.gpencil_*_align - Stroke Placement mode flags */
2292 typedef enum eGPencil_Placement_Flags {
2293 /* New strokes are added in viewport/data space (i.e. not screen space) */
2294 GP_PROJECT_VIEWSPACE = (1 << 0),
2296 /* Viewport space, but relative to render canvas (Sequencer Preview Only) */
2297 GP_PROJECT_CANVAS = (1 << 1),
2299 /* Project into the screen's Z values */
2300 GP_PROJECT_DEPTH_VIEW = (1 << 2),
2301 GP_PROJECT_DEPTH_STROKE = (1 << 3),
2303 /* "Use Endpoints" */
2304 GP_PROJECT_DEPTH_STROKE_ENDPOINTS = (1 << 4),
2305 GP_PROJECT_CURSOR = (1 << 5),
2306 GP_PROJECT_DEPTH_STROKE_FIRST = (1 << 6),
2307 } eGPencil_Placement_Flags;
2309 /* ToolSettings.gpencil_selectmode */
2310 typedef enum eGPencil_Selectmode_types {
2311 GP_SELECTMODE_POINT = 0,
2312 GP_SELECTMODE_STROKE = 1
2313 } eGPencil_Selectmode_types;
2315 /* ToolSettings.particle flag */
2316 #define PE_KEEP_LENGTHS (1 << 0)
2317 #define PE_LOCK_FIRST (1 << 1)
2318 #define PE_DEFLECT_EMITTER (1 << 2)
2319 #define PE_INTERPOLATE_ADDED (1 << 3)
2320 #define PE_DRAW_PART (1 << 4)
2321 /* #define PE_X_MIRROR (1 << 6) */ /* deprecated */
2322 #define PE_FADE_TIME (1 << 7)
2323 #define PE_AUTO_VELOCITY (1 << 8)
2325 /* ParticleEditSettings.brushtype */
2326 #define PE_BRUSH_NONE -1
2327 #define PE_BRUSH_COMB 0
2328 #define PE_BRUSH_CUT 1
2329 #define PE_BRUSH_LENGTH 2
2330 #define PE_BRUSH_PUFF 3
2331 #define PE_BRUSH_ADD 4
2332 #define PE_BRUSH_SMOOTH 5
2333 #define PE_BRUSH_WEIGHT 6
2335 /* ParticleBrushData.flag */
2336 #define PE_BRUSH_DATA_PUFF_VOLUME 1
2338 /* ParticleBrushData.edittype */
2339 #define PE_TYPE_PARTICLES 0
2340 #define PE_TYPE_SOFTBODY 1
2341 #define PE_TYPE_CLOTH 2
2343 /* PhysicsSettings.flag */
2344 #define PHYS_GLOBAL_GRAVITY 1
2348 #define USER_UNIT_ADAPTIVE 0xFF
2349 /* UnitSettings.system */
2350 #define USER_UNIT_NONE 0
2351 #define USER_UNIT_METRIC 1
2352 #define USER_UNIT_IMPERIAL 2
2353 /* UnitSettings.flag */
2354 #define USER_UNIT_OPT_SPLIT 1
2355 #define USER_UNIT_ROT_RADIANS 2
2357 /* SceneEEVEE->flag */
2359 SCE_EEVEE_VOLUMETRIC_ENABLED = (1 << 0),
2360 SCE_EEVEE_VOLUMETRIC_LIGHTS = (1 << 1),
2361 SCE_EEVEE_VOLUMETRIC_SHADOWS = (1 << 2),
2362 // SCE_EEVEE_VOLUMETRIC_COLORED = (1 << 3), /* Unused */
2363 SCE_EEVEE_GTAO_ENABLED = (1 << 4),
2364 SCE_EEVEE_GTAO_BENT_NORMALS = (1 << 5),
2365 SCE_EEVEE_GTAO_BOUNCE = (1 << 6),
2366 SCE_EEVEE_DOF_ENABLED = (1 << 7),
2367 SCE_EEVEE_BLOOM_ENABLED = (1 << 8),
2368 SCE_EEVEE_MOTION_BLUR_ENABLED = (1 << 9),
2369 SCE_EEVEE_SHADOW_HIGH_BITDEPTH = (1 << 10),
2370 SCE_EEVEE_TAA_REPROJECTION = (1 << 11),
2371 SCE_EEVEE_SSS_ENABLED = (1 << 12),
2372 SCE_EEVEE_SSS_SEPARATE_ALBEDO = (1 << 13),
2373 SCE_EEVEE_SSR_ENABLED = (1 << 14),
2374 SCE_EEVEE_SSR_REFRACTION = (1 << 15),
2375 SCE_EEVEE_SSR_HALF_RESOLUTION = (1 << 16),
2376 SCE_EEVEE_SHOW_IRRADIANCE = (1 << 17),
2377 SCE_EEVEE_SHOW_CUBEMAPS = (1 << 18),
2378 SCE_EEVEE_GI_AUTOBAKE = (1 << 19),
2379 SCE_EEVEE_SHADOW_SOFT = (1 << 20),
2380 SCE_EEVEE_OVERSCAN = (1 << 21),
2383 /* SceneEEVEE->shadow_method */
2387 SHADOW_METHOD_MAX = 3,
2394 #endif /* __DNA_SCENE_TYPES_H__ */