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
33 #define DURIAN_CAMERA_SWITCH
39 #include "DNA_brush_types.h"
40 #include "DNA_vec_types.h"
41 #include "DNA_listBase.h"
57 struct Base *next, *prev;
58 unsigned int lay, selcol;
61 struct Object *object;
64 typedef struct AviCodecData {
65 void *lpFormat; /* save format */
66 void *lpParms; /* compressor options */
67 unsigned int cbFormat; /* size of lpFormat buffer */
68 unsigned int cbParms; /* size of lpParms buffer */
70 unsigned int fccType; /* stream type, for consistency */
71 unsigned int fccHandler; /* compressor */
72 unsigned int dwKeyFrameEvery; /* keyframe rate */
73 unsigned int dwQuality; /* compress quality 0-10,000 */
74 unsigned int dwBytesPerSecond; /* bytes per second */
75 unsigned int dwFlags; /* flags... see below */
76 unsigned int dwInterleaveEvery; /* for non-video streams only */
79 char avicodecname[128];
82 typedef struct QuicktimeCodecData {
83 /*Old quicktime implementation compatibility fields, read only in 2.5 - deprecated*/
84 void *cdParms; /* codec/compressor options */
85 void *pad; /* padding */
87 unsigned int cdSize; /* size of cdParms buffer */
88 unsigned int pad2; /* padding */
90 char qtcodecname[128];
93 typedef struct QuicktimeCodecSettings {
94 /* Codec settings detailed for 2.5 implementation*/
95 int codecType; /* Types defined in quicktime_export.h */
96 int codecSpatialQuality; /* in 0-100 scale, to be translated in 0-1024 for qt use */
98 /* Settings not available in current QTKit API */
102 int codecTemporalQuality; /* in 0-100 scale, to be translated in 0-1024 for qt use */
103 int minSpatialQuality; /* in 0-100 scale, to be translated in 0-1024 for qt use */
104 int minTemporalQuality; /* in 0-100 scale, to be translated in 0-1024 for qt use */
106 int bitRate; /* bitrate in bps */
107 } QuicktimeCodecSettings;
109 typedef struct FFMpegCodecData {
125 IDProperty *properties;
129 typedef struct AudioData {
130 int mixrate; // 2.5: now in FFMpegCodecData: audio_mixrate
131 float main; // 2.5: now in FFMpegCodecData: audio_volume
132 float speed_of_sound;
133 float doppler_factor;
139 typedef struct SceneRenderLayer {
140 struct SceneRenderLayer *next, *prev;
144 struct Material *mat_override;
145 struct Group *light_override;
147 unsigned int lay; /* scene->lay itself has priority over this */
148 unsigned int lay_zmask; /* has to be after lay, this is for Z-masking */
153 int passflag; /* pass_xor has to be after passflag */
158 #define SCE_LAY_SOLID 1
159 #define SCE_LAY_ZTRA 2
160 #define SCE_LAY_HALO 4
161 #define SCE_LAY_EDGE 8
162 #define SCE_LAY_SKY 16
163 #define SCE_LAY_STRAND 32
164 /* flags between 32 and 0x8000 are set to 1 already, for future options */
166 #define SCE_LAY_ALL_Z 0x8000
167 #define SCE_LAY_XOR 0x10000
168 #define SCE_LAY_DISABLE 0x20000
169 #define SCE_LAY_ZMASK 0x40000
170 #define SCE_LAY_NEG_ZMASK 0x80000
173 #define SCE_PASS_COMBINED 1
175 #define SCE_PASS_RGBA 4
176 #define SCE_PASS_DIFFUSE 8
177 #define SCE_PASS_SPEC 16
178 #define SCE_PASS_SHADOW 32
179 #define SCE_PASS_AO 64
180 #define SCE_PASS_REFLECT 128
181 #define SCE_PASS_NORMAL 256
182 #define SCE_PASS_VECTOR 512
183 #define SCE_PASS_REFRACT 1024
184 #define SCE_PASS_INDEXOB 2048
185 #define SCE_PASS_UV 4096
186 #define SCE_PASS_RADIO 8192 /* Radio removed, can use for new GI? */
187 #define SCE_PASS_MIST 16384
189 #define SCE_PASS_RAYHITS 32768
191 /* note, srl->passflag is treestore element 'nr' in outliner, short still... */
194 typedef struct RenderData {
196 struct AviCodecData *avicodecdata;
197 struct QuicktimeCodecData *qtcodecdata;
198 struct QuicktimeCodecSettings qtcodecsettings;
199 struct FFMpegCodecData ffcodecdata;
201 int cfra, sfra, efra; /* frames as in 'images' */
202 int psfra, pefra; /* start+end frames of preview range */
204 int images, framapto;
207 float ctime; /* use for calcutions */
208 float framelen, blurfac;
210 /** For UR edge rendering: give the edges this color */
211 float edgeR, edgeG, edgeB;
213 short fullscreen, xplay, yplay, freqplay; /* standalone player */ // XXX deprecated since 2.5
214 short depth, attrib, rt2; /* standalone player */ // XXX deprecated since 2.5
215 short frame_step; /* frames to jump during render/playback */
217 short stereomode; /* standalone player stereo settings */ // XXX deprecated since 2.5
219 short dimensionspreset; /* for the dimensions presets menu */
221 short filtertype; /* filter is box, tent, gauss, mitch, etc */
223 short size, maximsize; /* size in %, max in Kb */
226 * The desired number of pixels in the x direction
230 * The desired number of pixels in the y direction
234 * The number of part to use in the x direction
238 * The number of part to use in the y direction
242 short winpos, planes, imtype, subimtype;
245 /* 0: Enable backbuffering for images */
250 * Render to image editor, fullscreen or to new window.
257 * Flags for render settings. Use bit-masking to access the settings.
262 * Flags for render settings. Use bit-masking to access the settings.
267 * Flags for raytrace settings. Use bit-masking to access the settings.
269 int raytrace_options;
272 * Raytrace acceleration structure
274 short raytrace_structure;
276 /* renderer (deprecated) */
279 /* octree resolution */
284 * What to do with the sky/background. Picks sky/premul/key
285 * blending for the background
290 * The number of samples to use per pixel.
294 short frs_sec, edgeint;
297 /* safety, border and display rect */
301 /* information on different layers to be rendered */
306 * Adjustment factors for the aspect ratio in the x direction, was a short in 2.45
310 * Adjustment factors for the aspect ratio in the x direction, was a short in 2.45
317 * Value used to define filter size for all filter options */
321 /* color management settings - color profiles, gamma correction, etc */
324 /** post-production settings. Depricated, but here for upwards compat (initialized to 1) */
325 float postgamma, posthue, postsat;
327 /* Dither noise intensity */
328 float dither_intensity;
330 /* Bake Render options */
331 short bake_osa, bake_filter, bake_mode, bake_flag;
332 short bake_normal_space, bake_quad_split;
333 float bake_maxdist, bake_biasdist, bake_pad;
335 /* yafray: global panel params. TODO: move elsewhere */
336 short GIquality, GIcache, GImethod, GIphotons, GIdirect;
337 short YF_AA, YFexportxml, YF_nobump, YF_clamprgb, yfpad1;
338 int GIdepth, GIcausdepth, GIpixelspersample;
339 int GIphotoncount, GImixphotons;
340 float GIphotonradius;
341 int YF_raydepth, YF_AApasses, YF_AAsamples, yfpad2;
342 float GIshadowquality, GIrefinement, GIpower, GIindirpower;
343 float YF_gamma, YF_exposure, YF_raybias, YF_AApixelsize, YF_AAthreshold;
345 /* paths to backbufffer, output, ftype */
346 char backbuf[160], pic[160];
350 short stamp_font_id, pad3; /* select one of blenders bitmap fonts */
352 /* stamp info user data. */
353 char stamp_udata[160];
355 /* foreground/background color. */
359 /* render simplify */
360 int simplify_subsurf;
361 int simplify_shadowsamples;
362 float simplify_particles;
363 float simplify_aosss;
366 short cineonwhite, cineonblack;
370 short jp2_preset, jp2_depth;
373 /* Dome variables */ // XXX deprecated since 2.5
374 short domeres, domemode; // XXX deprecated since 2.5
375 short domeangle, dometilt; // XXX deprecated since 2.5
376 float domeresbuf; // XXX deprecated since 2.5
377 float pad2; // XXX deprecated since 2.5
378 struct Text *dometext; // XXX deprecated since 2.5
384 /* control render convert and shading engine */
385 typedef struct RenderProfile {
386 struct RenderProfile *next, *prev;
391 short shadbufsample_max;
394 float ao_error, pad2;
398 typedef struct GameDome {
402 struct Text *warptext;
405 #define DOME_FISHEYE 1
406 #define DOME_TRUNCATED_FRONT 2
407 #define DOME_TRUNCATED_REAR 3
408 #define DOME_ENVMAP 4
409 #define DOME_PANORAM_SPH 5
410 #define DOME_NUM_MODES 6
412 typedef struct GameFraming {
414 char type, pad1, pad2, pad3;
417 #define SCE_GAMEFRAMING_BARS 0
418 #define SCE_GAMEFRAMING_EXTEND 1
419 #define SCE_GAMEFRAMING_SCALE 2
421 typedef struct GameData {
423 /* physics (it was in world)*/
424 float gravity; /*Gravitation constant for the game world*/
427 * Radius of the activity bubble, in Manhattan length. Objects
428 * outside the box are activity-culled. */
429 float activityBoxRadius; //it's not being used ANYWHERE !!!!!!!!!!!!!!
431 * bit 3: (gameengine): Activity culling is enabled.
432 * bit 5: (gameengine) : enable Bullet DBVT tree for view frustrum culling
434 short mode, flag, matmode, pad[3];
435 short occlusionRes; /* resolution of occlusion Z buffer in pixel */
437 short ticrate, maxlogicstep, physubstep, maxphystep;
439 /* standalone player */
440 struct GameFraming framing;
441 short fullscreen, xplay, yplay, freqplay;
442 short depth, attrib, rt1, rt2;
444 /* stereo/dome mode */
445 struct GameDome dome;
446 short stereoflag, stereomode, xsch, ysch; //xsch and ysch can be deleted !!!
449 #define STEREO_NOSTEREO 1
450 #define STEREO_ENABLED 2
451 #define STEREO_DOME 3
453 //#define STEREO_NOSTEREO 1
454 #define STEREO_QUADBUFFERED 2
455 #define STEREO_ABOVEBELOW 3
456 #define STEREO_INTERLACED 4
457 #define STEREO_ANAGLYPH 5
458 #define STEREO_SIDEBYSIDE 6
459 #define STEREO_VINTERLACE 7
460 //#define STEREO_DOME 8
466 #define WOPHY_DYNAMO 3
468 #define WOPHY_BULLET 5
471 #define GAME_ENABLE_ALL_FRAMES (1 << 1)
472 #define GAME_SHOW_DEBUG_PROPS (1 << 2)
473 #define GAME_SHOW_FRAMERATE (1 << 3)
474 #define GAME_SHOW_PHYSICS (1 << 4)
475 #define GAME_DISPLAY_LISTS (1 << 5)
476 #define GAME_GLSL_NO_LIGHTS (1 << 6)
477 #define GAME_GLSL_NO_SHADERS (1 << 7)
478 #define GAME_GLSL_NO_SHADOWS (1 << 8)
479 #define GAME_GLSL_NO_RAMPS (1 << 9)
480 #define GAME_GLSL_NO_NODES (1 << 10)
481 #define GAME_GLSL_NO_EXTRA_TEX (1 << 11)
482 #define GAME_IGNORE_DEPRECATION_WARNINGS (1 << 12)
484 /* GameData.matmode */
485 #define GAME_MAT_TEXFACE 0
486 #define GAME_MAT_MULTITEX 1
487 #define GAME_MAT_GLSL 2
489 typedef struct TimeMarker {
490 struct TimeMarker *next, *prev;
494 struct Object *camera;
497 typedef struct Paint {
498 /* Array of brushes selected for use in this paint mode */
500 int active_brush_index, brush_count;
502 /* WM Paint cursor */
504 unsigned char paint_cursor_col[4];
509 typedef struct ImagePaintSettings {
514 /* for projection painting only */
515 short seam_bleed, normal_angle;
517 void *paintcursor; /* wm handle */
518 } ImagePaintSettings;
520 typedef struct ParticleBrushData {
521 short size, strength; /* common settings */
522 short step, invert; /* for specific brushes only */
525 typedef struct ParticleEditSettings {
531 ParticleBrushData brush[7]; /* 7 = PE_TOT_BRUSH */
532 void *paintcursor; /* runtime */
534 float emitterdist, rt;
539 int draw_step, fade_frames;
542 struct Object *object;
543 } ParticleEditSettings;
545 typedef struct TransformOrientation {
546 struct TransformOrientation *next, *prev;
549 } TransformOrientation;
551 typedef struct Sculpt {
554 /* For rotating around a pivot point */
558 /* Control tablet input */
559 char tablet_size, tablet_strength;
563 typedef struct VPaint {
567 int tot; /* allocation size of prev buffers */
568 unsigned int *vpaint_prev; /* previous mesh colors */
569 struct MDeformVert *wpaint_prev; /* previous vertex weights */
571 void *paintcursor; /* wm handle */
575 #define VP_COLINDEX 1
580 // #define VP_MIRROR_X 32 // depricated in 2.5x use (me->editflag & ME_EDIT_MIRROR_X)
581 #define VP_ONLYVGROUP 128
584 typedef struct ToolSettings {
585 VPaint *vpaint; /* vertex paint */
586 VPaint *wpaint; /* weight paint */
592 /* Subdivide Settings */
595 /*Triangle to Quad conversion threshold*/
602 float extr_offs; /* extrude offset */
603 float doublimit; /* remove doubles limit */
604 float normalsize; /* size of normals */
607 /* Selection Mode for Mesh */
610 /* Primitive Settings */
615 /* Cylinder - Tube - Circle */
621 float uvcalc_cubesize;
624 short uvcalc_mapalign;
626 short uv_flag, uv_selectmode;
630 short autoik_chainlen;
632 /* Image Paint (8 byttse aligned please!) */
633 struct ImagePaintSettings imapaint;
635 /* Particle Editing */
636 struct ParticleEditSettings particle;
638 /* Transform Proportional Area of Effect */
639 float proportional_size;
641 /* Select Group Threshold */
647 /* Auto-Keying Mode */
648 short autokey_mode, autokey_flag; /* defines in DNA_userdef_types.h */
652 char retopo_paint_tool;
653 char line_div, ellipse_div, retopo_hotspot;
656 char multires_subdiv_type;
658 /* Skeleton generation */
659 short skgen_resolution;
660 float skgen_threshold_internal;
661 float skgen_threshold_external;
662 float skgen_length_ratio;
663 float skgen_length_limit;
664 float skgen_angle_limit;
665 float skgen_correlation_limit;
666 float skgen_symmetry_limit;
667 float skgen_retarget_angle_weight;
668 float skgen_retarget_length_weight;
669 float skgen_retarget_distance_weight;
672 char skgen_postpro_passes;
673 char skgen_subdivisions[3];
674 char skgen_multi_level;
676 /* Skeleton Sketching */
677 struct Object *skgen_template;
679 char bone_sketching_convert;
680 char skgen_subdivision_number;
681 char skgen_retarget_options;
682 char skgen_retarget_roll;
683 char skgen_side_string[8];
684 char skgen_num_string[8];
690 short snap_mode, snap_flag, snap_target;
691 short proportional, prop_mode;
693 int auto_normalize, intpad; /*auto normalizing mode in wpaint*/
696 typedef struct bStats {
697 /* scene totals for visible layers */
698 int totobj, totlamp, totobjsel, totcurve, totmesh, totarmature;
699 int totvert, totface;
702 typedef struct UnitSettings {
703 /* Display/Editing unit options for each scene */
704 float scale_length; /* maybe have other unit conversions? */
706 short flag; /* imperial, metric etc */
709 typedef struct PhysicsSettings {
714 typedef struct Scene {
716 struct AnimData *adt; /* animation data (must be immediately after id for utilities to use it) */
718 struct Object *camera;
725 struct Base *basact; /* active base */
726 struct Object *obedit; /* name replaces old G.obedit */
728 float cursor[3]; /* 3d cursor location */
729 float twcent[3]; /* center for transform widget */
730 float twmin[3], twmax[3]; /* boundbox of selection for transform widget */
734 short flag; /* various settings */
738 struct bNodeTree *nodetree;
740 struct Editing *ed; /* sequence editor data is allocated here */
742 struct ToolSettings *toolsettings; /* default allocated now */
743 struct SceneStats *stats; /* default allocated now */
745 /* migrate or replace? depends on some internal things... */
746 /* no, is on the right place (ton) */
748 struct AudioData audio;
751 ListBase transform_spaces;
753 ListBase sound_handles;
755 /* none of the dependancy graph vars is mean to be saved */
756 struct DagForest *theDag;
757 short dagisvalid, dagflags;
758 short recalc; /* recalc = counterpart of ob->recalc */
763 /* User-Defined KeyingSets */
764 int active_keyingset; /* index of the active KeyingSet. first KeyingSet has index 1, 'none' active is 0, 'add new' is -1 */
765 ListBase keyingsets; /* KeyingSets for the given frame */
768 struct GameFraming framing; // XXX deprecated since 2.5
772 struct UnitSettings unit;
777 /* Physics simulation settings */
778 struct PhysicsSettings physics_settings;
782 /* **************** RENDERDATA ********************* */
786 #define R_BACKBUFANIM 2
788 #define R_FRONTBUFANIM 8
792 #define R_SHADOW 0x0002
793 #define R_GAMMA 0x0004
794 #define R_ORTHO 0x0008
795 #define R_ENVMAP 0x0010
796 #define R_EDGE 0x0020
797 #define R_FIELDS 0x0040
798 #define R_FIELDSTILL 0x0080
799 #define R_RADIO 0x0100
800 #define R_BORDER 0x0200
801 #define R_PANORAMA 0x0400 /* deprecated as scene option, still used in renderer */
802 #define R_CROP 0x0800
803 #define R_COSMO 0x1000
804 #define R_ODDFIELD 0x2000
805 #define R_MBLUR 0x4000
806 /* unified was here */
807 #define R_RAYTRACE 0x10000
808 /* R_GAUSS is obsolete, but used to retrieve setting from old files */
809 #define R_GAUSS 0x20000
810 /* fbuf obsolete... */
811 #define R_FBUF 0x40000
812 /* threads obsolete... is there for old files, now use for autodetect threads */
813 #define R_THREADS 0x80000
814 /* Use the same flag for autothreads */
815 #define R_FIXED_THREADS 0x80000
817 #define R_SPEED 0x100000
818 #define R_SSS 0x200000
819 #define R_NO_OVERWRITE 0x400000 /* skip existing files */
820 #define R_TOUCH 0x800000 /* touch files before rendering */
821 #define R_SIMPLIFY 0x1000000
825 #define R_OUTPUT_SCREEN 0
826 #define R_OUTPUT_AREA 1
827 #define R_OUTPUT_WINDOW 2
828 #define R_OUTPUT_FORKED 3
831 #define R_FILTER_BOX 0
832 #define R_FILTER_TENT 1
833 #define R_FILTER_QUAD 2
834 #define R_FILTER_CUBIC 3
835 #define R_FILTER_CATROM 4
836 #define R_FILTER_GAUSS 5
837 #define R_FILTER_MITCH 6
838 #define R_FILTER_FAST_GAUSS 7 /* note, this is only used for nodes at the moment */
840 /* yafray: renderer flag (not only exclusive to yafray) */
844 /* raytrace structure */
845 #define R_RAYSTRUCTURE_AUTO 0
846 #define R_RAYSTRUCTURE_OCTREE 1
847 #define R_RAYSTRUCTURE_BLIBVH 2
848 #define R_RAYSTRUCTURE_VBVH 3
849 #define R_RAYSTRUCTURE_SIMD_SVBVH 4 /* needs SIMD */
850 #define R_RAYSTRUCTURE_SIMD_QBVH 5 /* needs SIMD */
852 /* raytrace_options */
853 #define R_RAYTRACE_USE_LOCAL_COORDS 0x0001
854 #define R_RAYTRACE_USE_INSTANCES 0x0002
856 /* scemode (int now) */
857 #define R_DOSEQ 0x0001
858 #define R_BG_RENDER 0x0002
859 /* passepartout is camera option now, keep this for backward compatibility */
860 #define R_PASSEPARTOUT 0x0004
861 #define R_PREVIEWBUTS 0x0008
862 #define R_EXTENSION 0x0010
863 #define R_MATNODE_PREVIEW 0x0020
864 #define R_DOCOMP 0x0040
865 #define R_COMP_CROP 0x0080
866 #define R_FREE_IMAGE 0x0100
867 #define R_SINGLE_LAYER 0x0200
868 #define R_EXR_TILE_FILE 0x0400
869 #define R_COMP_FREE 0x0800
870 #define R_NO_IMAGE_LOAD 0x1000
871 #define R_NO_TEX 0x2000
872 #define R_STAMP_INFO 0x4000 /* deprecated */
873 #define R_FULL_SAMPLE 0x8000
874 #define R_COMP_RERENDER 0x10000
875 #define R_RECURS_PROTECTION 0x20000
876 #define R_TEXNODE_PREVIEW 0x40000
879 #define R_STAMP_TIME 0x0001
880 #define R_STAMP_FRAME 0x0002
881 #define R_STAMP_DATE 0x0004
882 #define R_STAMP_CAMERA 0x0008
883 #define R_STAMP_SCENE 0x0010
884 #define R_STAMP_NOTE 0x0020
885 #define R_STAMP_DRAW 0x0040 /* draw in the image */
886 #define R_STAMP_MARKER 0x0080
887 #define R_STAMP_FILENAME 0x0100
888 #define R_STAMP_SEQSTRIP 0x0200
889 #define R_STAMP_RENDERTIME 0x0400
890 #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)
894 #define R_ALPHAPREMUL 1
898 #define R_PLANES24 24
899 #define R_PLANES32 32
903 #define R_COLOR_MANAGEMENT 1
909 #define R_FTYPE 3 /* ftype is nomore */
917 #define R_AVICODEC 18
918 #define R_QUICKTIME 19
924 #define R_FRAMESERVER 25
927 #define R_MULTILAYER 28
934 /* subimtype, flag options for imtype */
935 #define R_OPENEXR_HALF 1
936 #define R_OPENEXR_ZBUF 2
937 #define R_PREVIEW_JPG 4
938 #define R_CINEON_LOG 8
939 #define R_TIFF_16BIT 16
941 #define R_JPEG2K_12BIT 32 /* Jpeg2000 */
942 #define R_JPEG2K_16BIT 64
943 #define R_JPEG2K_YCC 128 /* when disabled use RGB */
944 #define R_JPEG2K_CINE_PRESET 256
945 #define R_JPEG2K_CINE_48FPS 512
948 /* bake_mode: same as RE_BAKE_xxx defines */
950 #define R_BAKE_CLEAR 1
952 #define R_BAKE_TO_ACTIVE 4
953 #define R_BAKE_NORMALIZE 8
955 /* bake_normal_space */
956 #define R_BAKE_SPACE_CAMERA 0
957 #define R_BAKE_SPACE_WORLD 1
958 #define R_BAKE_SPACE_OBJECT 2
959 #define R_BAKE_SPACE_TANGENT 3
961 /* **************** SCENE ********************* */
963 /* for general use */
964 #define MAXFRAME 300000
965 #define MAXFRAMEF 300000.0f
968 #define MINFRAMEF 1.0f
970 /* (minimum frame number for current-frame) */
971 #define MINAFRAME -300000
972 #define MINAFRAMEF -300000.0f
974 /* depricate this! */
975 #define TESTBASE(v3d, base) ( ((base)->flag & SELECT) && ((base)->lay & v3d->lay) && (((base)->object->restrictflag & OB_RESTRICT_VIEW)==0) )
976 #define TESTBASELIB(v3d, base) ( ((base)->flag & SELECT) && ((base)->lay & v3d->lay) && ((base)->object->id.lib==0) && (((base)->object->restrictflag & OB_RESTRICT_VIEW)==0))
977 #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))
978 #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))
979 #define BASE_SELECTABLE(v3d, base) ((base->lay & v3d->lay) && (base->object->restrictflag & (OB_RESTRICT_SELECT|OB_RESTRICT_VIEW))==0)
980 #define FIRSTBASE scene->base.first
981 #define LASTBASE scene->base.last
982 #define BASACT (scene->basact)
983 #define OBACT (BASACT? BASACT->object: 0)
985 #define ID_NEW(a) if( (a) && (a)->id.newid ) (a)= (void *)(a)->id.newid
986 #define ID_NEW_US(a) if( (a)->id.newid) {(a)= (void *)(a)->id.newid; (a)->id.us++;}
987 #define ID_NEW_US2(a) if( ((ID *)a)->newid) {(a)= ((ID *)a)->newid; ((ID *)a)->us++;}
988 #define CFRA (scene->r.cfra)
989 #define F_CFRA ((float)(scene->r.cfra))
990 #define SFRA (scene->r.sfra)
991 #define EFRA (scene->r.efra)
992 #define PSFRA ((scene->r.psfra != 0)? (scene->r.psfra): (scene->r.sfra))
993 #define PEFRA ((scene->r.psfra != 0)? (scene->r.pefra): (scene->r.efra))
994 #define FRA2TIME(a) ((((double) scene->r.frs_sec_base) * (a)) / scene->r.frs_sec)
995 #define TIME2FRA(a) ((((double) scene->r.frs_sec) * (a)) / scene->r.frs_sec_base)
996 #define FPS (((double) scene->r.frs_sec) / scene->r.frs_sec_base)
998 #define RAD_PHASE_PATCHES 1
999 #define RAD_PHASE_FACES 2
1001 /* base->flag is in DNA_object_types.h */
1003 /* toolsettings->snap_flag */
1005 #define SCE_SNAP_ROTATE 2
1006 #define SCE_SNAP_PEEL_OBJECT 4
1007 #define SCE_SNAP_PROJECT 8
1008 /* toolsettings->snap_target */
1009 #define SCE_SNAP_TARGET_CLOSEST 0
1010 #define SCE_SNAP_TARGET_CENTER 1
1011 #define SCE_SNAP_TARGET_MEDIAN 2
1012 #define SCE_SNAP_TARGET_ACTIVE 3
1013 /* toolsettings->snap_mode */
1014 #define SCE_SNAP_MODE_INCREMENT 0
1015 #define SCE_SNAP_MODE_VERTEX 1
1016 #define SCE_SNAP_MODE_EDGE 2
1017 #define SCE_SNAP_MODE_FACE 3
1018 #define SCE_SNAP_MODE_VOLUME 4
1020 /* toolsettings->selectmode */
1021 #define SCE_SELECT_VERTEX 1 /* for mesh */
1022 #define SCE_SELECT_EDGE 2
1023 #define SCE_SELECT_FACE 4
1025 /* toolsettings->particle.selectmode for particles */
1026 #define SCE_SELECT_PATH 1
1027 #define SCE_SELECT_POINT 2
1028 #define SCE_SELECT_END 4
1030 /* sce->recalc (now in use by previewrender) */
1031 #define SCE_PRV_CHANGED 1
1033 /* toolsettings->prop_mode (proportional falloff) */
1034 #define PROP_SMOOTH 0
1035 #define PROP_SPHERE 1
1037 #define PROP_SHARP 3
1039 #define PROP_CONST 5
1040 #define PROP_RANDOM 6
1042 /* toolsettings->proportional */
1043 #define PROP_EDIT_OFF 0
1044 #define PROP_EDIT_ON 1
1045 #define PROP_EDIT_CONNECTED 2
1048 #define SCE_DS_SELECTED (1<<0)
1049 #define SCE_DS_COLLAPSED (1<<1)
1050 #define SCE_NLA_EDIT_ON (1<<2)
1053 /* return flag next_object function */
1061 #define AUDIO_MUTE 1
1062 #define AUDIO_SYNC 2
1063 #define AUDIO_SCRUB 4
1065 #define FFMPEG_MULTIPLEX_AUDIO 1
1066 #define FFMPEG_AUTOSPLIT_OUTPUT 2
1070 PAINT_SHOW_BRUSH = 1,
1071 PAINT_FAST_NAVIGATE = 2
1075 /* These can eventually be moved to paint flags? */
1076 typedef enum SculptFlags {
1081 SCULPT_LOCK_Y = 128,
1085 /* ImagePaintSettings.flag */
1086 #define IMAGEPAINT_DRAWING 1
1087 #define IMAGEPAINT_DRAW_TOOL 2
1088 #define IMAGEPAINT_DRAW_TOOL_DRAWING 4
1089 /* projection painting only */
1090 #define IMAGEPAINT_PROJECT_DISABLE 8 /* Non projection 3D painting */
1091 #define IMAGEPAINT_PROJECT_XRAY 16
1092 #define IMAGEPAINT_PROJECT_BACKFACE 32
1093 #define IMAGEPAINT_PROJECT_FLAT 64
1094 #define IMAGEPAINT_PROJECT_LAYER_CLONE 128
1095 #define IMAGEPAINT_PROJECT_LAYER_MASK 256
1096 #define IMAGEPAINT_PROJECT_LAYER_MASK_INV 512
1098 /* toolsettings->uvcalc_flag */
1099 #define UVCALC_FILLHOLES 1
1100 #define UVCALC_NO_ASPECT_CORRECT 2 /* would call this UVCALC_ASPECT_CORRECT, except it should be default with old file */
1101 #define UVCALC_TRANSFORM_CORRECT 4 /* adjust UV's while transforming to avoid distortion */
1103 /* toolsettings->uv_flag */
1104 #define UV_SYNC_SELECTION 1
1105 #define UV_SHOW_SAME_IMAGE 2
1107 /* toolsettings->uv_selectmode */
1108 #define UV_SELECT_VERTEX 1
1109 #define UV_SELECT_EDGE 2
1110 #define UV_SELECT_FACE 4
1111 #define UV_SELECT_ISLAND 8
1113 /* toolsettings->edge_mode */
1114 #define EDGE_MODE_SELECT 0
1115 #define EDGE_MODE_TAG_SEAM 1
1116 #define EDGE_MODE_TAG_SHARP 2
1117 #define EDGE_MODE_TAG_CREASE 3
1118 #define EDGE_MODE_TAG_BEVEL 4
1120 /* toolsettings->particle flag */
1121 #define PE_KEEP_LENGTHS 1
1122 #define PE_LOCK_FIRST 2
1123 #define PE_DEFLECT_EMITTER 4
1124 #define PE_INTERPOLATE_ADDED 8
1125 #define PE_DRAW_PART 16
1126 #define PE_X_MIRROR 64
1127 #define PE_FADE_TIME 128
1128 #define PE_AUTO_VELOCITY 256
1130 /* toolsetting->particle brushtype */
1131 #define PE_BRUSH_NONE -1
1132 #define PE_BRUSH_COMB 0
1133 #define PE_BRUSH_CUT 1
1134 #define PE_BRUSH_LENGTH 2
1135 #define PE_BRUSH_PUFF 3
1136 #define PE_BRUSH_ADD 4
1137 #define PE_BRUSH_SMOOTH 5
1139 /* this must equal ParticleEditSettings.brush array size */
1140 #define PE_TOT_BRUSH 6
1142 /* tooksettings->particle edittype */
1143 #define PE_TYPE_PARTICLES 0
1144 #define PE_TYPE_SOFTBODY 1
1145 #define PE_TYPE_CLOTH 2
1147 /* toolsettings->retopo_mode */
1149 #define RETOPO_PAINT 2
1151 /* toolsettings->retopo_paint_tool */
1152 #define RETOPO_PEN 1
1153 #define RETOPO_LINE 2
1154 #define RETOPO_ELLIPSE 4
1156 /* toolsettings->skgen_options */
1157 #define SKGEN_FILTER_INTERNAL (1 << 0)
1158 #define SKGEN_FILTER_EXTERNAL (1 << 1)
1159 #define SKGEN_SYMMETRY (1 << 2)
1160 #define SKGEN_CUT_LENGTH (1 << 3)
1161 #define SKGEN_CUT_ANGLE (1 << 4)
1162 #define SKGEN_CUT_CORRELATION (1 << 5)
1163 #define SKGEN_HARMONIC (1 << 6)
1164 #define SKGEN_STICK_TO_EMBEDDING (1 << 7)
1165 #define SKGEN_ADAPTIVE_DISTANCE (1 << 8)
1166 #define SKGEN_FILTER_SMART (1 << 9)
1167 #define SKGEN_DISP_LENGTH (1 << 10)
1168 #define SKGEN_DISP_WEIGHT (1 << 11)
1169 #define SKGEN_DISP_ORIG (1 << 12)
1170 #define SKGEN_DISP_EMBED (1 << 13)
1171 #define SKGEN_DISP_INDEX (1 << 14)
1173 #define SKGEN_SUB_LENGTH 0
1174 #define SKGEN_SUB_ANGLE 1
1175 #define SKGEN_SUB_CORRELATION 2
1176 #define SKGEN_SUB_TOTAL 3
1178 /* toolsettings->skgen_postpro */
1179 #define SKGEN_SMOOTH 0
1180 #define SKGEN_AVERAGE 1
1181 #define SKGEN_SHARPEN 2
1183 /* toolsettings->bone_sketching */
1184 #define BONE_SKETCHING 1
1185 #define BONE_SKETCHING_QUICK 2
1186 #define BONE_SKETCHING_ADJUST 4
1188 /* toolsettings->bone_sketching_convert */
1189 #define SK_CONVERT_CUT_FIXED 0
1190 #define SK_CONVERT_CUT_LENGTH 1
1191 #define SK_CONVERT_CUT_ADAPTATIVE 2
1192 #define SK_CONVERT_RETARGET 3
1194 /* toolsettings->skgen_retarget_options */
1195 #define SK_RETARGET_AUTONAME 1
1197 /* toolsettings->skgen_retarget_roll */
1198 #define SK_RETARGET_ROLL_NONE 0
1199 #define SK_RETARGET_ROLL_VIEW 1
1200 #define SK_RETARGET_ROLL_JOINT 2
1202 /* physics_settings->flag */
1203 #define PHYS_GLOBAL_GRAVITY 1
1207 /* UnitSettings->system */
1208 #define USER_UNIT_NONE 0
1209 #define USER_UNIT_METRIC 1
1210 #define USER_UNIT_IMPERIAL 2
1211 /* UnitSettings->flag */
1212 #define USER_UNIT_OPT_SPLIT 1