4 * ***** BEGIN GPL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
21 * All rights reserved.
23 * The Original Code is: all of this file.
25 * Contributor(s): none yet.
27 * ***** END GPL LICENSE BLOCK *****
29 #ifndef DNA_SCENE_TYPES_H
30 #define DNA_SCENE_TYPES_H
36 #include "DNA_brush_types.h"
37 #include "DNA_vec_types.h"
38 #include "DNA_listBase.h"
40 #include "DNA_freestyle_types.h"
55 struct Base *next, *prev;
56 unsigned int lay, selcol;
59 struct Object *object;
62 typedef struct AviCodecData {
63 void *lpFormat; /* save format */
64 void *lpParms; /* compressor options */
65 unsigned int cbFormat; /* size of lpFormat buffer */
66 unsigned int cbParms; /* size of lpParms buffer */
68 unsigned int fccType; /* stream type, for consistency */
69 unsigned int fccHandler; /* compressor */
70 unsigned int dwKeyFrameEvery; /* keyframe rate */
71 unsigned int dwQuality; /* compress quality 0-10,000 */
72 unsigned int dwBytesPerSecond; /* bytes per second */
73 unsigned int dwFlags; /* flags... see below */
74 unsigned int dwInterleaveEvery; /* for non-video streams only */
77 char avicodecname[128];
80 typedef struct QuicktimeCodecData {
82 void *cdParms; /* codec/compressor options */
83 void *pad; /* padding */
85 unsigned int cdSize; /* size of cdParms buffer */
86 unsigned int pad2; /* padding */
88 char qtcodecname[128];
91 typedef struct FFMpegCodecData {
107 IDProperty *properties;
111 typedef struct AudioData {
112 int mixrate; // 2.5: now in FFMpegCodecData: audio_mixrate
113 float main; // 2.5: now in FFMpegCodecData: audio_volume
114 float speed_of_sound;
115 float doppler_factor;
121 typedef struct SceneRenderLayer {
122 struct SceneRenderLayer *next, *prev;
126 struct Material *mat_override;
127 struct Group *light_override;
129 unsigned int lay; /* scene->lay itself has priority over this */
130 unsigned int lay_zmask; /* has to be after lay, this is for Z-masking */
135 int passflag; /* pass_xor has to be after passflag */
138 struct FreestyleConfig freestyleConfig;
143 #define SCE_LAY_SOLID 1
144 #define SCE_LAY_ZTRA 2
145 #define SCE_LAY_HALO 4
146 #define SCE_LAY_EDGE 8
147 #define SCE_LAY_SKY 16
148 #define SCE_LAY_STRAND 32
149 #define SCE_LAY_FRS 64
150 /* flags between 32 and 0x8000 are set to 1 already, for future options */
152 #define SCE_LAY_ALL_Z 0x8000
153 #define SCE_LAY_XOR 0x10000
154 #define SCE_LAY_DISABLE 0x20000
155 #define SCE_LAY_ZMASK 0x40000
156 #define SCE_LAY_NEG_ZMASK 0x80000
159 #define SCE_PASS_COMBINED 1
161 #define SCE_PASS_RGBA 4
162 #define SCE_PASS_DIFFUSE 8
163 #define SCE_PASS_SPEC 16
164 #define SCE_PASS_SHADOW 32
165 #define SCE_PASS_AO 64
166 #define SCE_PASS_REFLECT 128
167 #define SCE_PASS_NORMAL 256
168 #define SCE_PASS_VECTOR 512
169 #define SCE_PASS_REFRACT 1024
170 #define SCE_PASS_INDEXOB 2048
171 #define SCE_PASS_UV 4096
172 #define SCE_PASS_RADIO 8192 /* Radio removed, can use for new GI? */
173 #define SCE_PASS_MIST 16384
175 #define SCE_PASS_RAYHITS 32768
177 /* note, srl->passflag is treestore element 'nr' in outliner, short still... */
180 typedef struct RenderData {
182 struct AviCodecData *avicodecdata;
183 struct QuicktimeCodecData *qtcodecdata;
184 struct FFMpegCodecData ffcodecdata;
186 int cfra, sfra, efra; /* frames as in 'images' */
187 int psfra, pefra; /* start+end frames of preview range */
189 int images, framapto;
192 float ctime; /* use for calcutions */
193 float framelen, blurfac;
195 /** For UR edge rendering: give the edges this color */
196 float edgeR, edgeG, edgeB;
198 short fullscreen, xplay, yplay, freqplay; /* standalone player */ // XXX deprecated since 2.5
199 short depth, attrib, rt2; /* standalone player */ // XXX deprecated since 2.5
200 short frame_step; /* frames to jump during render/playback */
202 short stereomode; /* standalone player stereo settings */ // XXX deprecated since 2.5
204 short dimensionspreset; /* for the dimensions presets menu */
206 short filtertype; /* filter is box, tent, gauss, mitch, etc */
208 short size, maximsize; /* size in %, max in Kb */
211 * The desired number of pixels in the x direction
215 * The desired number of pixels in the y direction
219 * The number of part to use in the x direction
223 * The number of part to use in the y direction
227 short winpos, planes, imtype, subimtype;
230 /* 0: Enable backbuffering for images */
235 * Render to image editor, fullscreen or to new window.
242 * Flags for render settings. Use bit-masking to access the settings.
247 * Flags for render settings. Use bit-masking to access the settings.
252 * Flags for raytrace settings. Use bit-masking to access the settings.
254 int raytrace_options;
257 * Raytrace acceleration structure
259 short raytrace_structure;
261 /* renderer (deprecated) */
264 /* octree resolution */
269 * What to do with the sky/background. Picks sky/premul/key
270 * blending for the background
275 * The number of samples to use per pixel.
279 short frs_sec, edgeint;
282 /* safety, border and display rect */
286 /* information on different layers to be rendered */
291 * Adjustment factors for the aspect ratio in the x direction, was a short in 2.45
295 * Adjustment factors for the aspect ratio in the x direction, was a short in 2.45
302 * Value used to define filter size for all filter options */
306 /* color management settings - color profiles, gamma correction, etc */
309 /** post-production settings. Depricated, but here for upwards compat (initialized to 1) */
310 float postgamma, posthue, postsat;
312 /* Dither noise intensity */
313 float dither_intensity;
315 /* Bake Render options */
316 short bake_osa, bake_filter, bake_mode, bake_flag;
317 short bake_normal_space, bake_quad_split;
318 float bake_maxdist, bake_biasdist, bake_pad;
320 /* yafray: global panel params. TODO: move elsewhere */
321 short GIquality, GIcache, GImethod, GIphotons, GIdirect;
322 short YF_AA, YFexportxml, YF_nobump, YF_clamprgb, yfpad1;
323 int GIdepth, GIcausdepth, GIpixelspersample;
324 int GIphotoncount, GImixphotons;
325 float GIphotonradius;
326 int YF_raydepth, YF_AApasses, YF_AAsamples, yfpad2;
327 float GIshadowquality, GIrefinement, GIpower, GIindirpower;
328 float YF_gamma, YF_exposure, YF_raybias, YF_AApixelsize, YF_AAthreshold;
330 /* paths to backbufffer, output, ftype */
331 char backbuf[160], pic[160];
335 short stamp_font_id, pad3; /* select one of blenders bitmap fonts */
337 /* stamp info user data. */
338 char stamp_udata[160];
340 /* foreground/background color. */
344 /* render simplify */
345 int simplify_subsurf;
346 int simplify_shadowsamples;
347 float simplify_particles;
348 float simplify_aosss;
351 short cineonwhite, cineonblack;
355 short jp2_preset, jp2_depth;
358 /* Dome variables */ // XXX deprecated since 2.5
359 short domeres, domemode; // XXX deprecated since 2.5
360 short domeangle, dometilt; // XXX deprecated since 2.5
361 float domeresbuf; // XXX deprecated since 2.5
362 float pad2; // XXX deprecated since 2.5
363 struct Text *dometext; // XXX deprecated since 2.5
369 /* control render convert and shading engine */
370 typedef struct RenderProfile {
371 struct RenderProfile *next, *prev;
376 short shadbufsample_max;
379 float ao_error, pad2;
383 typedef struct GameDome {
387 struct Text *warptext;
390 #define DOME_FISHEYE 1
391 #define DOME_TRUNCATED_FRONT 2
392 #define DOME_TRUNCATED_REAR 3
393 #define DOME_ENVMAP 4
394 #define DOME_PANORAM_SPH 5
395 #define DOME_NUM_MODES 6
397 typedef struct GameFraming {
399 char type, pad1, pad2, pad3;
402 #define SCE_GAMEFRAMING_BARS 0
403 #define SCE_GAMEFRAMING_EXTEND 1
404 #define SCE_GAMEFRAMING_SCALE 2
406 typedef struct GameData {
408 /* physics (it was in world)*/
409 float gravity; /*Gravitation constant for the game world*/
412 * Radius of the activity bubble, in Manhattan length. Objects
413 * outside the box are activity-culled. */
414 float activityBoxRadius; //it's not being used ANYWHERE !!!!!!!!!!!!!!
416 * bit 3: (gameengine): Activity culling is enabled.
417 * bit 5: (gameengine) : enable Bullet DBVT tree for view frustrum culling
419 short mode, flag, matmode, pad[3];
420 short occlusionRes; /* resolution of occlusion Z buffer in pixel */
422 short ticrate, maxlogicstep, physubstep, maxphystep;
424 /* standalone player */
425 struct GameFraming framing;
426 short fullscreen, xplay, yplay, freqplay;
427 short depth, attrib, rt1, rt2;
429 /* stereo/dome mode */
430 struct GameDome dome;
431 short stereoflag, stereomode, xsch, ysch; //xsch and ysch can be deleted !!!
434 #define STEREO_NOSTEREO 1
435 #define STEREO_ENABLED 2
436 #define STEREO_DOME 3
438 //#define STEREO_NOSTEREO 1
439 #define STEREO_QUADBUFFERED 2
440 #define STEREO_ABOVEBELOW 3
441 #define STEREO_INTERLACED 4
442 #define STEREO_ANAGLYPH 5
443 #define STEREO_SIDEBYSIDE 6
444 #define STEREO_VINTERLACE 7
445 //#define STEREO_DOME 8
451 #define WOPHY_DYNAMO 3
453 #define WOPHY_BULLET 5
456 #define GAME_ENABLE_ALL_FRAMES (1 << 1)
457 #define GAME_SHOW_DEBUG_PROPS (1 << 2)
458 #define GAME_SHOW_FRAMERATE (1 << 3)
459 #define GAME_SHOW_PHYSICS (1 << 4)
460 #define GAME_DISPLAY_LISTS (1 << 5)
461 #define GAME_GLSL_NO_LIGHTS (1 << 6)
462 #define GAME_GLSL_NO_SHADERS (1 << 7)
463 #define GAME_GLSL_NO_SHADOWS (1 << 8)
464 #define GAME_GLSL_NO_RAMPS (1 << 9)
465 #define GAME_GLSL_NO_NODES (1 << 10)
466 #define GAME_GLSL_NO_EXTRA_TEX (1 << 11)
467 #define GAME_IGNORE_DEPRECATION_WARNINGS (1 << 12)
469 /* GameData.matmode */
470 #define GAME_MAT_TEXFACE 0
471 #define GAME_MAT_MULTITEX 1
472 #define GAME_MAT_GLSL 2
474 typedef struct TimeMarker {
475 struct TimeMarker *next, *prev;
481 typedef struct Paint {
482 /* Array of brushes selected for use in this paint mode */
484 int active_brush_index, brush_count;
486 /* WM Paint cursor */
488 unsigned char paint_cursor_col[4];
493 typedef struct ImagePaintSettings {
498 /* for projection painting only */
499 short seam_bleed, normal_angle;
501 void *paintcursor; /* wm handle */
502 } ImagePaintSettings;
504 typedef struct ParticleBrushData {
505 short size, strength; /* common settings */
506 short step, invert; /* for specific brushes only */
509 typedef struct ParticleEditSettings {
515 ParticleBrushData brush[7]; /* 7 = PE_TOT_BRUSH */
516 void *paintcursor; /* runtime */
518 float emitterdist, rt;
523 int draw_step, fade_frames;
526 struct Object *object;
527 } ParticleEditSettings;
529 typedef struct TransformOrientation {
530 struct TransformOrientation *next, *prev;
533 } TransformOrientation;
535 typedef struct Sculpt {
538 /* For rotating around a pivot point */
542 /* Control tablet input */
543 char tablet_size, tablet_strength;
547 typedef struct VPaint {
550 float gamma, mul; /* should become part of struct Brush? */
552 int tot; /* allocation size of prev buffers */
553 unsigned int *vpaint_prev; /* previous mesh colors */
554 struct MDeformVert *wpaint_prev; /* previous vertex weights */
556 void *paintcursor; /* wm handle */
560 #define VP_COLINDEX 1
565 // #define VP_MIRROR_X 32 // depricated in 2.5x use (me->editflag & ME_EDIT_MIRROR_X)
567 #define VP_ONLYVGROUP 128
570 typedef struct ToolSettings {
571 VPaint *vpaint; /* vertex paint */
572 VPaint *wpaint; /* weight paint */
578 /* Subdivide Settings */
581 /*Triangle to Quad conversion threshold*/
588 float extr_offs; /* extrude offset */
589 float doublimit; /* remove doubles limit */
590 float normalsize; /* size of normals */
593 /* Selection Mode for Mesh */
596 /* Primitive Settings */
601 /* Cylinder - Tube - Circle */
607 float uvcalc_cubesize;
610 short uvcalc_mapalign;
612 short uv_flag, uv_selectmode;
616 short autoik_chainlen;
618 /* Image Paint (8 byttse aligned please!) */
619 struct ImagePaintSettings imapaint;
621 /* Particle Editing */
622 struct ParticleEditSettings particle;
624 /* Transform Proportional Area of Effect */
625 float proportional_size;
627 /* Select Group Threshold */
633 /* Auto-Keying Mode */
634 short autokey_mode, autokey_flag; /* defines in DNA_userdef_types.h */
638 char retopo_paint_tool;
639 char line_div, ellipse_div, retopo_hotspot;
642 char multires_subdiv_type;
644 /* Skeleton generation */
645 short skgen_resolution;
646 float skgen_threshold_internal;
647 float skgen_threshold_external;
648 float skgen_length_ratio;
649 float skgen_length_limit;
650 float skgen_angle_limit;
651 float skgen_correlation_limit;
652 float skgen_symmetry_limit;
653 float skgen_retarget_angle_weight;
654 float skgen_retarget_length_weight;
655 float skgen_retarget_distance_weight;
658 char skgen_postpro_passes;
659 char skgen_subdivisions[3];
660 char skgen_multi_level;
662 /* Skeleton Sketching */
663 struct Object *skgen_template;
665 char bone_sketching_convert;
666 char skgen_subdivision_number;
667 char skgen_retarget_options;
668 char skgen_retarget_roll;
669 char skgen_side_string[8];
670 char skgen_num_string[8];
676 short snap_mode, snap_flag, snap_target;
677 short proportional, prop_mode;
679 int auto_normalize, intpad; /*auto normalizing mode in wpaint*/
682 typedef struct bStats {
683 /* scene totals for visible layers */
684 int totobj, totlamp, totobjsel, totcurve, totmesh, totarmature;
685 int totvert, totface;
688 typedef struct UnitSettings {
689 /* Display/Editing unit options for each scene */
690 float scale_length; /* maybe have other unit conversions? */
692 short flag; /* imperial, metric etc */
695 typedef struct PhysicsSettings {
700 typedef struct Scene {
702 struct AnimData *adt; /* animation data (must be immediately after id for utilities to use it) */
704 struct Object *camera;
711 struct Base *basact; /* active base */
712 struct Object *obedit; /* name replaces old G.obedit */
714 float cursor[3]; /* 3d cursor location */
715 float twcent[3]; /* center for transform widget */
716 float twmin[3], twmax[3]; /* boundbox of selection for transform widget */
720 short flag; /* various settings */
724 struct bNodeTree *nodetree;
726 struct Editing *ed; /* sequence editor data is allocated here */
728 struct ToolSettings *toolsettings; /* default allocated now */
729 struct SceneStats *stats; /* default allocated now */
731 /* migrate or replace? depends on some internal things... */
732 /* no, is on the right place (ton) */
734 struct AudioData audio;
737 ListBase transform_spaces;
739 ListBase sound_handles;
741 /* none of the dependancy graph vars is mean to be saved */
742 struct DagForest *theDag;
743 short dagisvalid, dagflags;
744 short recalc; /* recalc = counterpart of ob->recalc */
749 /* User-Defined KeyingSets */
750 int active_keyingset; /* index of the active KeyingSet. first KeyingSet has index 1, 'none' active is 0, 'add new' is -1 */
751 ListBase keyingsets; /* KeyingSets for the given frame */
754 struct GameFraming framing; // XXX deprecated since 2.5
758 struct UnitSettings unit;
763 /* Physics simulation settings */
764 struct PhysicsSettings physics_settings;
767 short freestyle_current_layer_number;
773 /* **************** RENDERDATA ********************* */
777 #define R_BACKBUFANIM 2
779 #define R_FRONTBUFANIM 8
783 #define R_SHADOW 0x0002
784 #define R_GAMMA 0x0004
785 #define R_ORTHO 0x0008
786 #define R_ENVMAP 0x0010
787 #define R_EDGE 0x0020
788 #define R_FIELDS 0x0040
789 #define R_FIELDSTILL 0x0080
790 #define R_RADIO 0x0100
791 #define R_BORDER 0x0200
792 #define R_PANORAMA 0x0400 /* deprecated as scene option, still used in renderer */
793 #define R_CROP 0x0800
794 #define R_COSMO 0x1000
795 #define R_ODDFIELD 0x2000
796 #define R_MBLUR 0x4000
797 /* unified was here */
798 #define R_RAYTRACE 0x10000
799 /* R_GAUSS is obsolete, but used to retrieve setting from old files */
800 #define R_GAUSS 0x20000
801 /* fbuf obsolete... */
802 #define R_FBUF 0x40000
803 /* threads obsolete... is there for old files, now use for autodetect threads */
804 #define R_THREADS 0x80000
805 /* Use the same flag for autothreads */
806 #define R_FIXED_THREADS 0x80000
808 #define R_SPEED 0x100000
809 #define R_SSS 0x200000
810 #define R_NO_OVERWRITE 0x400000 /* skip existing files */
811 #define R_TOUCH 0x800000 /* touch files before rendering */
812 #define R_SIMPLIFY 0x1000000
813 #define R_EDGE_FRS 0x2000000 /* R_EDGE for Freestyle */
817 #define R_OUTPUT_SCREEN 0
818 #define R_OUTPUT_AREA 1
819 #define R_OUTPUT_WINDOW 2
820 #define R_OUTPUT_FORKED 3
823 #define R_FILTER_BOX 0
824 #define R_FILTER_TENT 1
825 #define R_FILTER_QUAD 2
826 #define R_FILTER_CUBIC 3
827 #define R_FILTER_CATROM 4
828 #define R_FILTER_GAUSS 5
829 #define R_FILTER_MITCH 6
830 #define R_FILTER_FAST_GAUSS 7 /* note, this is only used for nodes at the moment */
832 /* yafray: renderer flag (not only exclusive to yafray) */
836 /* raytrace structure */
837 #define R_RAYSTRUCTURE_AUTO 0
838 #define R_RAYSTRUCTURE_OCTREE 1
839 #define R_RAYSTRUCTURE_BLIBVH 2
840 #define R_RAYSTRUCTURE_VBVH 3
841 #define R_RAYSTRUCTURE_SIMD_SVBVH 4 /* needs SIMD */
842 #define R_RAYSTRUCTURE_SIMD_QBVH 5 /* needs SIMD */
844 /* raytrace_options */
845 #define R_RAYTRACE_USE_LOCAL_COORDS 0x0001
846 #define R_RAYTRACE_USE_INSTANCES 0x0002
848 /* scemode (int now) */
849 #define R_DOSEQ 0x0001
850 #define R_BG_RENDER 0x0002
851 /* passepartout is camera option now, keep this for backward compatibility */
852 #define R_PASSEPARTOUT 0x0004
853 #define R_PREVIEWBUTS 0x0008
854 #define R_EXTENSION 0x0010
855 #define R_MATNODE_PREVIEW 0x0020
856 #define R_DOCOMP 0x0040
857 #define R_COMP_CROP 0x0080
858 #define R_FREE_IMAGE 0x0100
859 #define R_SINGLE_LAYER 0x0200
860 #define R_EXR_TILE_FILE 0x0400
861 #define R_COMP_FREE 0x0800
862 #define R_NO_IMAGE_LOAD 0x1000
863 #define R_NO_TEX 0x2000
864 #define R_STAMP_INFO 0x4000 /* deprecated */
865 #define R_FULL_SAMPLE 0x8000
866 #define R_COMP_RERENDER 0x10000
867 #define R_RECURS_PROTECTION 0x20000
868 #define R_TEXNODE_PREVIEW 0x40000
871 #define R_STAMP_TIME 0x0001
872 #define R_STAMP_FRAME 0x0002
873 #define R_STAMP_DATE 0x0004
874 #define R_STAMP_CAMERA 0x0008
875 #define R_STAMP_SCENE 0x0010
876 #define R_STAMP_NOTE 0x0020
877 #define R_STAMP_DRAW 0x0040 /* draw in the image */
878 #define R_STAMP_MARKER 0x0080
879 #define R_STAMP_FILENAME 0x0100
880 #define R_STAMP_SEQSTRIP 0x0200
881 #define R_STAMP_RENDERTIME 0x0400
882 #define R_STAMP_ALL (R_STAMP_TIME|R_STAMP_FRAME|R_STAMP_DATE|R_STAMP_CAMERA|R_STAMP_SCENE|R_STAMP_NOTE|R_STAMP_MARKER|R_STAMP_FILENAME|R_STAMP_SEQSTRIP|R_STAMP_RENDERTIME)
886 #define R_ALPHAPREMUL 1
890 #define R_PLANES24 24
891 #define R_PLANES32 32
895 #define R_COLOR_MANAGEMENT 1
901 #define R_FTYPE 3 /* ftype is nomore */
909 #define R_AVICODEC 18
910 #define R_QUICKTIME 19
916 #define R_FRAMESERVER 25
919 #define R_MULTILAYER 28
926 /* subimtype, flag options for imtype */
927 #define R_OPENEXR_HALF 1
928 #define R_OPENEXR_ZBUF 2
929 #define R_PREVIEW_JPG 4
930 #define R_CINEON_LOG 8
931 #define R_TIFF_16BIT 16
933 #define R_JPEG2K_12BIT 32 /* Jpeg2000 */
934 #define R_JPEG2K_16BIT 64
935 #define R_JPEG2K_YCC 128 /* when disabled use RGB */
936 #define R_JPEG2K_CINE_PRESET 256
937 #define R_JPEG2K_CINE_48FPS 512
940 /* bake_mode: same as RE_BAKE_xxx defines */
942 #define R_BAKE_CLEAR 1
944 #define R_BAKE_TO_ACTIVE 4
945 #define R_BAKE_NORMALIZE 8
947 /* bake_normal_space */
948 #define R_BAKE_SPACE_CAMERA 0
949 #define R_BAKE_SPACE_WORLD 1
950 #define R_BAKE_SPACE_OBJECT 2
951 #define R_BAKE_SPACE_TANGENT 3
953 /* **************** SCENE ********************* */
955 /* for general use */
956 #define MAXFRAME 300000
957 #define MAXFRAMEF 300000.0f
960 #define MINFRAMEF 1.0f
962 /* (minimum frame number for current-frame) */
963 #define MINAFRAME -300000
964 #define MINAFRAMEF -300000.0f
966 /* depricate this! */
967 #define TESTBASE(v3d, base) ( ((base)->flag & SELECT) && ((base)->lay & v3d->lay) && (((base)->object->restrictflag & OB_RESTRICT_VIEW)==0) )
968 #define TESTBASELIB(v3d, base) ( ((base)->flag & SELECT) && ((base)->lay & v3d->lay) && ((base)->object->id.lib==0) && (((base)->object->restrictflag & OB_RESTRICT_VIEW)==0))
969 #define TESTBASELIB_BGMODE(v3d, scene, base) ( ((base)->flag & SELECT) && ((base)->lay & (v3d ? v3d->lay : scene->lay)) && ((base)->object->id.lib==0) && (((base)->object->restrictflag & OB_RESTRICT_VIEW)==0))
970 #define BASE_EDITABLE_BGMODE(v3d, scene, base) (((base)->lay & (v3d ? v3d->lay : scene->lay)) && ((base)->object->id.lib==0) && (((base)->object->restrictflag & OB_RESTRICT_VIEW)==0))
971 #define BASE_SELECTABLE(v3d, base) ((base->lay & v3d->lay) && (base->object->restrictflag & (OB_RESTRICT_SELECT|OB_RESTRICT_VIEW))==0)
972 #define FIRSTBASE scene->base.first
973 #define LASTBASE scene->base.last
974 #define BASACT (scene->basact)
975 #define OBACT (BASACT? BASACT->object: 0)
977 #define ID_NEW(a) if( (a) && (a)->id.newid ) (a)= (void *)(a)->id.newid
978 #define ID_NEW_US(a) if( (a)->id.newid) {(a)= (void *)(a)->id.newid; (a)->id.us++;}
979 #define ID_NEW_US2(a) if( ((ID *)a)->newid) {(a)= ((ID *)a)->newid; ((ID *)a)->us++;}
980 #define CFRA (scene->r.cfra)
981 #define F_CFRA ((float)(scene->r.cfra))
982 #define SFRA (scene->r.sfra)
983 #define EFRA (scene->r.efra)
984 #define PSFRA ((scene->r.psfra != 0)? (scene->r.psfra): (scene->r.sfra))
985 #define PEFRA ((scene->r.psfra != 0)? (scene->r.pefra): (scene->r.efra))
986 #define FRA2TIME(a) ((((double) scene->r.frs_sec_base) * (a)) / scene->r.frs_sec)
987 #define TIME2FRA(a) ((((double) scene->r.frs_sec) * (a)) / scene->r.frs_sec_base)
988 #define FPS (((double) scene->r.frs_sec) / scene->r.frs_sec_base)
990 #define RAD_PHASE_PATCHES 1
991 #define RAD_PHASE_FACES 2
993 /* base->flag is in DNA_object_types.h */
995 /* toolsettings->snap_flag */
997 #define SCE_SNAP_ROTATE 2
998 #define SCE_SNAP_PEEL_OBJECT 4
999 #define SCE_SNAP_PROJECT 8
1000 /* toolsettings->snap_target */
1001 #define SCE_SNAP_TARGET_CLOSEST 0
1002 #define SCE_SNAP_TARGET_CENTER 1
1003 #define SCE_SNAP_TARGET_MEDIAN 2
1004 #define SCE_SNAP_TARGET_ACTIVE 3
1005 /* toolsettings->snap_mode */
1006 #define SCE_SNAP_MODE_VERTEX 0
1007 #define SCE_SNAP_MODE_EDGE 1
1008 #define SCE_SNAP_MODE_FACE 2
1009 #define SCE_SNAP_MODE_VOLUME 3
1011 /* toolsettings->selectmode */
1012 #define SCE_SELECT_VERTEX 1 /* for mesh */
1013 #define SCE_SELECT_EDGE 2
1014 #define SCE_SELECT_FACE 4
1016 /* toolsettings->particle.selectmode for particles */
1017 #define SCE_SELECT_PATH 1
1018 #define SCE_SELECT_POINT 2
1019 #define SCE_SELECT_END 4
1021 /* sce->recalc (now in use by previewrender) */
1022 #define SCE_PRV_CHANGED 1
1024 /* toolsettings->prop_mode (proportional falloff) */
1025 #define PROP_SMOOTH 0
1026 #define PROP_SPHERE 1
1028 #define PROP_SHARP 3
1030 #define PROP_CONST 5
1031 #define PROP_RANDOM 6
1033 /* toolsettings->proportional */
1034 #define PROP_EDIT_OFF 0
1035 #define PROP_EDIT_ON 1
1036 #define PROP_EDIT_CONNECTED 2
1039 #define SCE_DS_SELECTED (1<<0)
1040 #define SCE_DS_COLLAPSED (1<<1)
1041 #define SCE_NLA_EDIT_ON (1<<2)
1044 /* return flag next_object function */
1052 #define AUDIO_MUTE 1
1053 #define AUDIO_SYNC 2
1054 #define AUDIO_SCRUB 4
1056 #define FFMPEG_MULTIPLEX_AUDIO 1
1057 #define FFMPEG_AUTOSPLIT_OUTPUT 2
1060 typedef enum SculptFlags {
1064 SCULPT_INPUT_SMOOTH = 8,
1065 SCULPT_DRAW_FAST = 16,
1066 SCULPT_DRAW_BRUSH = 32,
1068 SCULPT_LOCK_Y = 128,
1072 /* ImagePaintSettings.flag */
1073 #define IMAGEPAINT_DRAWING 1
1074 #define IMAGEPAINT_DRAW_TOOL 2
1075 #define IMAGEPAINT_DRAW_TOOL_DRAWING 4
1076 /* projection painting only */
1077 #define IMAGEPAINT_PROJECT_DISABLE 8 /* Non projection 3D painting */
1078 #define IMAGEPAINT_PROJECT_XRAY 16
1079 #define IMAGEPAINT_PROJECT_BACKFACE 32
1080 #define IMAGEPAINT_PROJECT_FLAT 64
1081 #define IMAGEPAINT_PROJECT_LAYER_CLONE 128
1082 #define IMAGEPAINT_PROJECT_LAYER_MASK 256
1083 #define IMAGEPAINT_PROJECT_LAYER_MASK_INV 512
1085 /* toolsettings->uvcalc_flag */
1086 #define UVCALC_FILLHOLES 1
1087 #define UVCALC_NO_ASPECT_CORRECT 2 /* would call this UVCALC_ASPECT_CORRECT, except it should be default with old file */
1088 #define UVCALC_TRANSFORM_CORRECT 4 /* adjust UV's while transforming to avoid distortion */
1090 /* toolsettings->uv_flag */
1091 #define UV_SYNC_SELECTION 1
1092 #define UV_SHOW_SAME_IMAGE 2
1094 /* toolsettings->uv_selectmode */
1095 #define UV_SELECT_VERTEX 1
1096 #define UV_SELECT_EDGE 2
1097 #define UV_SELECT_FACE 4
1098 #define UV_SELECT_ISLAND 8
1100 /* toolsettings->edge_mode */
1101 #define EDGE_MODE_SELECT 0
1102 #define EDGE_MODE_TAG_SEAM 1
1103 #define EDGE_MODE_TAG_SHARP 2
1104 #define EDGE_MODE_TAG_CREASE 3
1105 #define EDGE_MODE_TAG_BEVEL 4
1107 /* toolsettings->particle flag */
1108 #define PE_KEEP_LENGTHS 1
1109 #define PE_LOCK_FIRST 2
1110 #define PE_DEFLECT_EMITTER 4
1111 #define PE_INTERPOLATE_ADDED 8
1112 #define PE_DRAW_PART 16
1113 #define PE_X_MIRROR 64
1114 #define PE_FADE_TIME 128
1115 #define PE_AUTO_VELOCITY 256
1117 /* toolsetting->particle brushtype */
1118 #define PE_BRUSH_NONE -1
1119 #define PE_BRUSH_COMB 0
1120 #define PE_BRUSH_CUT 1
1121 #define PE_BRUSH_LENGTH 2
1122 #define PE_BRUSH_PUFF 3
1123 #define PE_BRUSH_ADD 4
1124 #define PE_BRUSH_SMOOTH 5
1126 /* this must equal ParticleEditSettings.brush array size */
1127 #define PE_TOT_BRUSH 6
1129 /* tooksettings->particle edittype */
1130 #define PE_TYPE_PARTICLES 0
1131 #define PE_TYPE_SOFTBODY 1
1132 #define PE_TYPE_CLOTH 2
1134 /* toolsettings->retopo_mode */
1136 #define RETOPO_PAINT 2
1138 /* toolsettings->retopo_paint_tool */
1139 #define RETOPO_PEN 1
1140 #define RETOPO_LINE 2
1141 #define RETOPO_ELLIPSE 4
1143 /* toolsettings->skgen_options */
1144 #define SKGEN_FILTER_INTERNAL (1 << 0)
1145 #define SKGEN_FILTER_EXTERNAL (1 << 1)
1146 #define SKGEN_SYMMETRY (1 << 2)
1147 #define SKGEN_CUT_LENGTH (1 << 3)
1148 #define SKGEN_CUT_ANGLE (1 << 4)
1149 #define SKGEN_CUT_CORRELATION (1 << 5)
1150 #define SKGEN_HARMONIC (1 << 6)
1151 #define SKGEN_STICK_TO_EMBEDDING (1 << 7)
1152 #define SKGEN_ADAPTIVE_DISTANCE (1 << 8)
1153 #define SKGEN_FILTER_SMART (1 << 9)
1154 #define SKGEN_DISP_LENGTH (1 << 10)
1155 #define SKGEN_DISP_WEIGHT (1 << 11)
1156 #define SKGEN_DISP_ORIG (1 << 12)
1157 #define SKGEN_DISP_EMBED (1 << 13)
1158 #define SKGEN_DISP_INDEX (1 << 14)
1160 #define SKGEN_SUB_LENGTH 0
1161 #define SKGEN_SUB_ANGLE 1
1162 #define SKGEN_SUB_CORRELATION 2
1163 #define SKGEN_SUB_TOTAL 3
1165 /* toolsettings->skgen_postpro */
1166 #define SKGEN_SMOOTH 0
1167 #define SKGEN_AVERAGE 1
1168 #define SKGEN_SHARPEN 2
1170 /* toolsettings->bone_sketching */
1171 #define BONE_SKETCHING 1
1172 #define BONE_SKETCHING_QUICK 2
1173 #define BONE_SKETCHING_ADJUST 4
1175 /* toolsettings->bone_sketching_convert */
1176 #define SK_CONVERT_CUT_FIXED 0
1177 #define SK_CONVERT_CUT_LENGTH 1
1178 #define SK_CONVERT_CUT_ADAPTATIVE 2
1179 #define SK_CONVERT_RETARGET 3
1181 /* toolsettings->skgen_retarget_options */
1182 #define SK_RETARGET_AUTONAME 1
1184 /* toolsettings->skgen_retarget_roll */
1185 #define SK_RETARGET_ROLL_NONE 0
1186 #define SK_RETARGET_ROLL_VIEW 1
1187 #define SK_RETARGET_ROLL_JOINT 2
1189 /* physics_settings->flag */
1190 #define PHYS_GLOBAL_GRAVITY 1
1194 /* UnitSettings->system */
1195 #define USER_UNIT_NONE 0
1196 #define USER_UNIT_METRIC 1
1197 #define USER_UNIT_IMPERIAL 2
1198 /* UnitSettings->flag */
1199 #define USER_UNIT_OPT_SPLIT 1