Blender V2.61 - r43446
|
00001 /* 00002 * ***** BEGIN GPL LICENSE BLOCK ***** 00003 * 00004 * This program is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU General Public License 00006 * as published by the Free Software Foundation; either version 2 00007 * of the License, or (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software Foundation, 00016 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00017 * 00018 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. 00019 * All rights reserved. 00020 * 00021 * The Original Code is: all of this file. 00022 * 00023 * Contributor(s): none yet. 00024 * 00025 * ***** END GPL LICENSE BLOCK ***** 00026 */ 00027 00032 #ifndef DNA_SCENE_TYPES_H 00033 #define DNA_SCENE_TYPES_H 00034 00035 #include "DNA_defs.h" 00036 00037 // XXX, temp feature - campbell 00038 #define DURIAN_CAMERA_SWITCH 00039 00040 #ifdef __cplusplus 00041 extern "C" { 00042 #endif 00043 00044 #include "DNA_vec_types.h" 00045 #include "DNA_listBase.h" 00046 #include "DNA_ID.h" 00047 00048 struct Object; 00049 struct Brush; 00050 struct World; 00051 struct Scene; 00052 struct Image; 00053 struct Group; 00054 struct Text; 00055 struct bNodeTree; 00056 struct AnimData; 00057 struct Editing; 00058 struct SceneStats; 00059 struct bGPdata; 00060 struct MovieClip; 00061 00062 /* ************************************************************* */ 00063 /* Scene Data */ 00064 00065 /* Base - Wrapper for referencing Objects in a Scene */ 00066 typedef struct Base { 00067 struct Base *next, *prev; 00068 unsigned int lay, selcol; 00069 int flag; 00070 short sx, sy; 00071 struct Object *object; 00072 } Base; 00073 00074 /* ************************************************************* */ 00075 /* Output Format Data */ 00076 00077 typedef struct AviCodecData { 00078 void *lpFormat; /* save format */ 00079 void *lpParms; /* compressor options */ 00080 unsigned int cbFormat; /* size of lpFormat buffer */ 00081 unsigned int cbParms; /* size of lpParms buffer */ 00082 00083 unsigned int fccType; /* stream type, for consistency */ 00084 unsigned int fccHandler; /* compressor */ 00085 unsigned int dwKeyFrameEvery; /* keyframe rate */ 00086 unsigned int dwQuality; /* compress quality 0-10,000 */ 00087 unsigned int dwBytesPerSecond; /* bytes per second */ 00088 unsigned int dwFlags; /* flags... see below */ 00089 unsigned int dwInterleaveEvery; /* for non-video streams only */ 00090 unsigned int pad; 00091 00092 char avicodecname[128]; 00093 } AviCodecData; 00094 00095 typedef struct QuicktimeCodecData { 00096 /*Old quicktime implementation compatibility fields, read only in 2.5 - deprecated*/ 00097 void *cdParms; /* codec/compressor options */ 00098 void *pad; /* padding */ 00099 00100 unsigned int cdSize; /* size of cdParms buffer */ 00101 unsigned int pad2; /* padding */ 00102 00103 char qtcodecname[128]; 00104 } QuicktimeCodecData; 00105 00106 typedef struct QuicktimeCodecSettings { 00107 /* Codec settings detailed for 2.5 implementation*/ 00108 int codecType; /* Types defined in quicktime_export.h */ 00109 int codecSpatialQuality; /* in 0-100 scale, to be translated in 0-1024 for qt use */ 00110 00111 /* Settings not available in current QTKit API */ 00112 int codec; 00113 int codecFlags; 00114 int colorDepth; 00115 int codecTemporalQuality; /* in 0-100 scale, to be translated in 0-1024 for qt use */ 00116 int minSpatialQuality; /* in 0-100 scale, to be translated in 0-1024 for qt use */ 00117 int minTemporalQuality; /* in 0-100 scale, to be translated in 0-1024 for qt use */ 00118 int keyFrameRate; 00119 int bitRate; /* bitrate in bps */ 00120 00121 /* Audio Codec settings */ 00122 int audiocodecType; 00123 int audioSampleRate; 00124 short audioBitDepth; 00125 short audioChannels; 00126 int audioCodecFlags; 00127 int audioBitRate; 00128 int pad1; 00129 } QuicktimeCodecSettings; 00130 00131 typedef struct FFMpegCodecData { 00132 int type; 00133 int codec; 00134 int audio_codec; 00135 int video_bitrate; 00136 int audio_bitrate; 00137 int audio_mixrate; 00138 int audio_channels; 00139 int audio_pad; 00140 float audio_volume; 00141 int gop_size; 00142 int flags; 00143 00144 int rc_min_rate; 00145 int rc_max_rate; 00146 int rc_buffer_size; 00147 int mux_packet_size; 00148 int mux_rate; 00149 IDProperty *properties; 00150 } FFMpegCodecData; 00151 00152 /* ************************************************************* */ 00153 /* Audio */ 00154 00155 typedef struct AudioData { 00156 int mixrate; // 2.5: now in FFMpegCodecData: audio_mixrate 00157 float main; // 2.5: now in FFMpegCodecData: audio_volume 00158 float speed_of_sound; 00159 float doppler_factor; 00160 int distance_model; 00161 short flag; 00162 short pad; 00163 float volume; 00164 float pad2; 00165 } AudioData; 00166 00167 /* *************************************************************** */ 00168 /* Render Layers */ 00169 00170 /* Render Layer */ 00171 typedef struct SceneRenderLayer { 00172 struct SceneRenderLayer *next, *prev; 00173 00174 char name[64]; /* MAX_NAME */ 00175 00176 struct Material *mat_override; 00177 struct Group *light_override; 00178 00179 unsigned int lay; /* scene->lay itself has priority over this */ 00180 unsigned int lay_zmask; /* has to be after lay, this is for Z-masking */ 00181 int layflag; 00182 00183 int pad; 00184 00185 int passflag; /* pass_xor has to be after passflag */ 00186 int pass_xor; 00187 } SceneRenderLayer; 00188 00189 /* srl->layflag */ 00190 #define SCE_LAY_SOLID 1 00191 #define SCE_LAY_ZTRA 2 00192 #define SCE_LAY_HALO 4 00193 #define SCE_LAY_EDGE 8 00194 #define SCE_LAY_SKY 16 00195 #define SCE_LAY_STRAND 32 00196 /* flags between 32 and 0x8000 are set to 1 already, for future options */ 00197 00198 #define SCE_LAY_ALL_Z 0x8000 00199 #define SCE_LAY_XOR 0x10000 00200 #define SCE_LAY_DISABLE 0x20000 00201 #define SCE_LAY_ZMASK 0x40000 00202 #define SCE_LAY_NEG_ZMASK 0x80000 00203 00204 /* srl->passflag */ 00205 #define SCE_PASS_COMBINED (1<<0) 00206 #define SCE_PASS_Z (1<<1) 00207 #define SCE_PASS_RGBA (1<<2) 00208 #define SCE_PASS_DIFFUSE (1<<3) 00209 #define SCE_PASS_SPEC (1<<4) 00210 #define SCE_PASS_SHADOW (1<<5) 00211 #define SCE_PASS_AO (1<<6) 00212 #define SCE_PASS_REFLECT (1<<7) 00213 #define SCE_PASS_NORMAL (1<<8) 00214 #define SCE_PASS_VECTOR (1<<9) 00215 #define SCE_PASS_REFRACT (1<<10) 00216 #define SCE_PASS_INDEXOB (1<<11) 00217 #define SCE_PASS_UV (1<<12) 00218 #define SCE_PASS_INDIRECT (1<<13) 00219 #define SCE_PASS_MIST (1<<14) 00220 #define SCE_PASS_RAYHITS (1<<15) 00221 #define SCE_PASS_EMIT (1<<16) 00222 #define SCE_PASS_ENVIRONMENT (1<<17) 00223 #define SCE_PASS_INDEXMA (1<<18) 00224 00225 /* note, srl->passflag is treestore element 'nr' in outliner, short still... */ 00226 00227 /* *************************************************************** */ 00228 00229 /* Generic image format settings, 00230 * this is used for NodeImageFile and IMAGE_OT_save_as operator too. 00231 * 00232 * note: its a bit strange that even though this is an image format struct 00233 * the imtype can still be used to select video formats. 00234 * RNA ensures these enum's are only selectable for render output. 00235 */ 00236 typedef struct ImageFormatData { 00237 char imtype; /* R_IMF_IMTYPE_PNG, R_... */ 00238 /* note, video types should only ever be set from this 00239 * structure when used from RenderData */ 00240 char depth; /* bits per channel, R_IMF_CHAN_DEPTH_8 -> 32, 00241 * not a flag, only set 1 at a time */ 00242 00243 char planes ; /* - R_IMF_PLANES_BW, R_IMF_PLANES_RGB, R_IMF_PLANES_RGBA */ 00244 char flag; /* generic options for all image types, alpha zbuffer */ 00245 00246 char quality; /* (0 - 100), eg: jpeg quality */ 00247 char compress; /* (0 - 100), eg: png compression */ 00248 00249 00250 /* --- format specific --- */ 00251 00252 /* OpenEXR */ 00253 char exr_codec; 00254 00255 /* Cineon */ 00256 char cineon_flag; 00257 short cineon_white, cineon_black; 00258 float cineon_gamma; 00259 00260 /* Jpeg2000 */ 00261 char jp2_flag; 00262 00263 char pad[7]; 00264 00265 } ImageFormatData; 00266 00267 00268 /* ImageFormatData.imtype */ 00269 #define R_IMF_IMTYPE_TARGA 0 00270 #define R_IMF_IMTYPE_IRIS 1 00271 /* #define R_HAMX 2 */ /* hamx is nomore */ 00272 /* #define R_FTYPE 3 */ /* ftype is nomore */ 00273 #define R_IMF_IMTYPE_JPEG90 4 00274 /* #define R_MOVIE 5 */ /* movie is nomore */ 00275 #define R_IMF_IMTYPE_IRIZ 7 00276 #define R_IMF_IMTYPE_RAWTGA 14 00277 #define R_IMF_IMTYPE_AVIRAW 15 00278 #define R_IMF_IMTYPE_AVIJPEG 16 00279 #define R_IMF_IMTYPE_PNG 17 00280 #define R_IMF_IMTYPE_AVICODEC 18 00281 #define R_IMF_IMTYPE_QUICKTIME 19 00282 #define R_IMF_IMTYPE_BMP 20 00283 #define R_IMF_IMTYPE_RADHDR 21 00284 #define R_IMF_IMTYPE_TIFF 22 00285 #define R_IMF_IMTYPE_OPENEXR 23 00286 #define R_IMF_IMTYPE_FFMPEG 24 00287 #define R_IMF_IMTYPE_FRAMESERVER 25 00288 #define R_IMF_IMTYPE_CINEON 26 00289 #define R_IMF_IMTYPE_DPX 27 00290 #define R_IMF_IMTYPE_MULTILAYER 28 00291 #define R_IMF_IMTYPE_DDS 29 00292 #define R_IMF_IMTYPE_JP2 30 00293 #define R_IMF_IMTYPE_H264 31 00294 #define R_IMF_IMTYPE_XVID 32 00295 #define R_IMF_IMTYPE_THEORA 33 00296 00297 #define R_IMF_IMTYPE_INVALID 255 00298 00299 /* ImageFormatData.flag */ 00300 #define R_IMF_FLAG_ZBUF (1<<0) /* was R_OPENEXR_ZBUF */ 00301 #define R_IMF_FLAG_PREVIEW_JPG (1<<1) /* was R_PREVIEW_JPG */ 00302 00303 /* return values from BKE_imtype_valid_depths, note this is depts per channel */ 00304 #define R_IMF_CHAN_DEPTH_1 (1<<0) /* 1bits (unused) */ 00305 #define R_IMF_CHAN_DEPTH_8 (1<<1) /* 8bits (default) */ 00306 #define R_IMF_CHAN_DEPTH_12 (1<<2) /* 12bits (uncommon, jp2 supports) */ 00307 #define R_IMF_CHAN_DEPTH_16 (1<<3) /* 16bits (tiff, halff float exr) */ 00308 #define R_IMF_CHAN_DEPTH_24 (1<<4) /* 24bits (unused) */ 00309 #define R_IMF_CHAN_DEPTH_32 (1<<5) /* 32bits (full float exr) */ 00310 00311 /* ImageFormatData.planes */ 00312 #define R_IMF_PLANES_RGB 24 00313 #define R_IMF_PLANES_RGBA 32 00314 #define R_IMF_PLANES_BW 8 00315 00316 /* ImageFormatData.exr_codec */ 00317 #define R_IMF_EXR_CODEC_NONE 0 00318 #define R_IMF_EXR_CODEC_PXR24 1 00319 #define R_IMF_EXR_CODEC_ZIP 2 00320 #define R_IMF_EXR_CODEC_PIZ 3 00321 #define R_IMF_EXR_CODEC_RLE 4 00322 00323 /* ImageFormatData.jp2_flag */ 00324 #define R_IMF_JP2_FLAG_YCC (1<<0) /* when disabled use RGB */ /* was R_JPEG2K_YCC */ 00325 #define R_IMF_JP2_FLAG_CINE_PRESET (1<<1) /* was R_JPEG2K_CINE_PRESET */ 00326 #define R_IMF_JP2_FLAG_CINE_48 (1<<2) /* was R_JPEG2K_CINE_48FPS */ 00327 00328 /* ImageFormatData.cineon_flag */ 00329 #define R_IMF_CINEON_FLAG_LOG (1<<0) /* was R_CINEON_LOG */ 00330 00331 /* *************************************************************** */ 00332 /* Render Data */ 00333 00334 typedef struct RenderData { 00335 struct ImageFormatData im_format; 00336 00337 struct AviCodecData *avicodecdata; 00338 struct QuicktimeCodecData *qtcodecdata; 00339 struct QuicktimeCodecSettings qtcodecsettings; 00340 struct FFMpegCodecData ffcodecdata; 00341 00342 int cfra, sfra, efra; /* frames as in 'images' */ 00343 float subframe; /* subframe offset from cfra, in 0.0-1.0 */ 00344 int psfra, pefra; /* start+end frames of preview range */ 00345 00346 int images, framapto; 00347 short flag, threads; 00348 00349 float framelen, blurfac; 00350 00352 float edgeR, edgeG, edgeB; 00353 00354 00355 /* standalone player */ // XXX deprecated since 2.5 00356 short fullscreen DNA_DEPRECATED, xplay DNA_DEPRECATED, yplay DNA_DEPRECATED; 00357 short freqplay DNA_DEPRECATED; 00358 /* standalone player */ // XXX deprecated since 2.5 00359 short depth DNA_DEPRECATED, attrib DNA_DEPRECATED; 00360 00361 00362 int frame_step; /* frames to jump during render/playback */ 00363 00364 short stereomode DNA_DEPRECATED; /* standalone player stereo settings */ // XXX deprecated since 2.5 00365 00366 short dimensionspreset; /* for the dimensions presets menu */ 00367 00368 short filtertype; /* filter is box, tent, gauss, mitch, etc */ 00369 00370 short size, maximsize; /* size in %, max in Kb */ 00371 /* from buttons: */ 00375 short xsch; 00379 short ysch; 00383 short xparts; 00387 short yparts; 00388 00389 short planes DNA_DEPRECATED, imtype DNA_DEPRECATED, subimtype DNA_DEPRECATED, quality DNA_DEPRECATED; /*deprecated!*/ 00390 00394 short displaymode; 00395 00399 int scemode; 00400 00404 int mode; 00405 00409 int raytrace_options; 00410 00414 short raytrace_structure; 00415 00416 short pad1; 00417 00418 /* octree resolution */ 00419 short ocres; 00420 short pad4; 00421 00426 short alphamode; 00427 00431 short osa; 00432 00433 short frs_sec, edgeint; 00434 00435 00436 /* safety, border and display rect */ 00437 rctf safety, border; 00438 rcti disprect; 00439 00440 /* information on different layers to be rendered */ 00441 ListBase layers; 00442 short actlay; 00443 00444 /* number of mblur samples */ 00445 short mblur_samples; 00446 00450 float xasp, yasp; 00451 00452 float frs_sec_base; 00453 00456 float gauss; 00457 00458 00459 /* color management settings - color profiles, gamma correction, etc */ 00460 int color_mgt_flag; 00461 00463 float postgamma, posthue, postsat; 00464 00465 /* Dither noise intensity */ 00466 float dither_intensity; 00467 00468 /* Bake Render options */ 00469 short bake_osa, bake_filter, bake_mode, bake_flag; 00470 short bake_normal_space, bake_quad_split; 00471 float bake_maxdist, bake_biasdist, bake_pad; 00472 00473 /* path to render output */ 00474 char pic[240]; /* 240 = FILE_MAX */ 00475 00476 /* stamps flags. */ 00477 int stamp; 00478 short stamp_font_id, pad3; /* select one of blenders bitmap fonts */ 00479 00480 /* stamp info user data. */ 00481 char stamp_udata[160]; 00482 00483 /* foreground/background color. */ 00484 float fg_stamp[4]; 00485 float bg_stamp[4]; 00486 00487 /* sequencer options */ 00488 char seq_prev_type; 00489 char seq_rend_type; 00490 char seq_flag; /* flag use for sequence render/draw */ 00491 char pad5[5]; 00492 00493 /* render simplify */ 00494 int simplify_flag; 00495 short simplify_subsurf; 00496 short simplify_shadowsamples; 00497 float simplify_particles; 00498 float simplify_aosss; 00499 00500 /* cineon */ 00501 short cineonwhite DNA_DEPRECATED, cineonblack DNA_DEPRECATED; /*deprecated*/ 00502 float cineongamma DNA_DEPRECATED; /*deprecated*/ 00503 00504 /* jpeg2000 */ 00505 short jp2_preset DNA_DEPRECATED, jp2_depth DNA_DEPRECATED; /*deprecated*/ 00506 int rpad3; 00507 00508 /* Dome variables */ // XXX deprecated since 2.5 00509 short domeres DNA_DEPRECATED, domemode DNA_DEPRECATED; // XXX deprecated since 2.5 00510 short domeangle DNA_DEPRECATED, dometilt DNA_DEPRECATED; // XXX deprecated since 2.5 00511 float domeresbuf DNA_DEPRECATED; // XXX deprecated since 2.5 00512 float pad2; 00513 struct Text *dometext DNA_DEPRECATED; // XXX deprecated since 2.5 00514 00515 /* render engine */ 00516 char engine[32]; 00517 } RenderData; 00518 00519 /* *************************************************************** */ 00520 /* Render Conversion/Simplfication Settings */ 00521 00522 /* control render convert and shading engine */ 00523 typedef struct RenderProfile { 00524 struct RenderProfile *next, *prev; 00525 char name[32]; 00526 00527 short particle_perc; 00528 short subsurf_max; 00529 short shadbufsample_max; 00530 short pad1; 00531 00532 float ao_error, pad2; 00533 00534 } RenderProfile; 00535 00536 /* *************************************************************** */ 00537 /* Game Engine - Dome */ 00538 00539 typedef struct GameDome { 00540 short res, mode; 00541 short angle, tilt; 00542 float resbuf, pad2; 00543 struct Text *warptext; 00544 } GameDome; 00545 00546 #define DOME_FISHEYE 1 00547 #define DOME_TRUNCATED_FRONT 2 00548 #define DOME_TRUNCATED_REAR 3 00549 #define DOME_ENVMAP 4 00550 #define DOME_PANORAM_SPH 5 00551 #define DOME_NUM_MODES 6 00552 00553 /* *************************************************************** */ 00554 /* Game Engine */ 00555 00556 typedef struct GameFraming { 00557 float col[3]; 00558 char type, pad1, pad2, pad3; 00559 } GameFraming; 00560 00561 #define SCE_GAMEFRAMING_BARS 0 00562 #define SCE_GAMEFRAMING_EXTEND 1 00563 #define SCE_GAMEFRAMING_SCALE 2 00564 00565 typedef struct RecastData { 00566 float cellsize; 00567 float cellheight; 00568 float agentmaxslope; 00569 float agentmaxclimb; 00570 float agentheight; 00571 float agentradius; 00572 float edgemaxlen; 00573 float edgemaxerror; 00574 float regionminsize; 00575 float regionmergesize; 00576 int vertsperpoly; 00577 float detailsampledist; 00578 float detailsamplemaxerror; 00579 short pad1, pad2; 00580 } RecastData; 00581 00582 typedef struct GameData { 00583 00584 /* standalone player */ 00585 struct GameFraming framing; 00586 short playerflag, xplay, yplay, freqplay; 00587 short depth, attrib, rt1, rt2; 00588 short aasamples, pad4[3]; 00589 00590 /* stereo/dome mode */ 00591 struct GameDome dome; 00592 short stereoflag, stereomode; 00593 float eyeseparation; 00594 RecastData recastData; 00595 00596 00597 /* physics (it was in world)*/ 00598 float gravity; /*Gravitation constant for the game world*/ 00599 00600 /* 00601 * Radius of the activity bubble, in Manhattan length. Objects 00602 * outside the box are activity-culled. */ 00603 float activityBoxRadius; 00604 00605 /* 00606 * bit 3: (gameengine): Activity culling is enabled. 00607 * bit 5: (gameengine) : enable Bullet DBVT tree for view frustrum culling 00608 */ 00609 int flag; 00610 short mode, matmode; 00611 short occlusionRes; /* resolution of occlusion Z buffer in pixel */ 00612 short physicsEngine; 00613 short exitkey, pad; 00614 short ticrate, maxlogicstep, physubstep, maxphystep; 00615 short obstacleSimulation, pad1; 00616 float levelHeight; 00617 } GameData; 00618 00619 #define STEREO_NOSTEREO 1 00620 #define STEREO_ENABLED 2 00621 #define STEREO_DOME 3 00622 00623 //#define STEREO_NOSTEREO 1 00624 #define STEREO_QUADBUFFERED 2 00625 #define STEREO_ABOVEBELOW 3 00626 #define STEREO_INTERLACED 4 00627 #define STEREO_ANAGLYPH 5 00628 #define STEREO_SIDEBYSIDE 6 00629 #define STEREO_VINTERLACE 7 00630 //#define STEREO_DOME 8 00631 00632 /* physicsEngine */ 00633 #define WOPHY_NONE 0 00634 #define WOPHY_ENJI 1 00635 #define WOPHY_SUMO 2 00636 #define WOPHY_DYNAMO 3 00637 #define WOPHY_ODE 4 00638 #define WOPHY_BULLET 5 00639 00640 /* obstacleSimulation */ 00641 #define OBSTSIMULATION_NONE 0 00642 #define OBSTSIMULATION_TOI_rays 1 00643 #define OBSTSIMULATION_TOI_cells 2 00644 00645 /* GameData.flag */ 00646 #define GAME_RESTRICT_ANIM_UPDATES (1 << 0) 00647 #define GAME_ENABLE_ALL_FRAMES (1 << 1) 00648 #define GAME_SHOW_DEBUG_PROPS (1 << 2) 00649 #define GAME_SHOW_FRAMERATE (1 << 3) 00650 #define GAME_SHOW_PHYSICS (1 << 4) 00651 #define GAME_DISPLAY_LISTS (1 << 5) 00652 #define GAME_GLSL_NO_LIGHTS (1 << 6) 00653 #define GAME_GLSL_NO_SHADERS (1 << 7) 00654 #define GAME_GLSL_NO_SHADOWS (1 << 8) 00655 #define GAME_GLSL_NO_RAMPS (1 << 9) 00656 #define GAME_GLSL_NO_NODES (1 << 10) 00657 #define GAME_GLSL_NO_EXTRA_TEX (1 << 11) 00658 #define GAME_IGNORE_DEPRECATION_WARNINGS (1 << 12) 00659 #define GAME_ENABLE_ANIMATION_RECORD (1 << 13) 00660 #define GAME_SHOW_MOUSE (1 << 14) 00661 #define GAME_GLSL_NO_COLOR_MANAGEMENT (1 << 15) 00662 #define GAME_SHOW_OBSTACLE_SIMULATION (1 << 16) 00663 /* Note: GameData.flag is now an int (max 32 flags). A short could only take 16 flags */ 00664 00665 /* GameData.playerflag */ 00666 #define GAME_PLAYER_FULLSCREEN (1 << 0) 00667 #define GAME_PLAYER_DESKTOP_RESOLUTION (1 << 1) 00668 00669 /* GameData.matmode */ 00670 #define GAME_MAT_TEXFACE 0 00671 #define GAME_MAT_MULTITEX 1 00672 #define GAME_MAT_GLSL 2 00673 00674 /* *************************************************************** */ 00675 /* Markers */ 00676 00677 typedef struct TimeMarker { 00678 struct TimeMarker *next, *prev; 00679 int frame; 00680 char name[64]; 00681 unsigned int flag; 00682 struct Object *camera; 00683 } TimeMarker; 00684 00685 /* *************************************************************** */ 00686 /* Paint Mode/Tool Data */ 00687 00688 /* Paint Tool Base */ 00689 typedef struct Paint { 00690 struct Brush *brush; 00691 00692 /* WM Paint cursor */ 00693 void *paint_cursor; 00694 unsigned char paint_cursor_col[4]; 00695 00696 int flags; 00697 } Paint; 00698 00699 /* ------------------------------------------- */ 00700 /* Image Paint */ 00701 00702 /* Texture/Image Editor */ 00703 typedef struct ImagePaintSettings { 00704 Paint paint; 00705 00706 short flag, pad; 00707 00708 /* for projection painting only */ 00709 short seam_bleed, normal_angle; 00710 short screen_grab_size[2]; /* capture size for re-projection */ 00711 00712 int pad1; 00713 00714 void *paintcursor; /* wm handle */ 00715 } ImagePaintSettings; 00716 00717 /* ------------------------------------------- */ 00718 /* Particle Edit */ 00719 00720 /* Settings for a Particle Editing Brush */ 00721 typedef struct ParticleBrushData { 00722 short size; /* common setting */ 00723 short step, invert, count; /* for specific brushes only */ 00724 int flag; 00725 float strength; 00726 } ParticleBrushData; 00727 00728 /* Particle Edit Mode Settings */ 00729 typedef struct ParticleEditSettings { 00730 short flag; 00731 short totrekey; 00732 short totaddkey; 00733 short brushtype; 00734 00735 ParticleBrushData brush[7]; /* 7 = PE_TOT_BRUSH */ 00736 void *paintcursor; /* runtime */ 00737 00738 float emitterdist, rt; 00739 00740 int selectmode; 00741 int edittype; 00742 00743 int draw_step, fade_frames; 00744 00745 struct Scene *scene; 00746 struct Object *object; 00747 } ParticleEditSettings; 00748 00749 /* ------------------------------------------- */ 00750 /* Sculpt */ 00751 00752 /* Sculpt */ 00753 typedef struct Sculpt { 00754 Paint paint; 00755 00756 /* For rotating around a pivot point */ 00757 //float pivot[3]; XXX not used? 00758 int flags; 00759 00760 /* Control tablet input */ 00761 //char tablet_size, tablet_strength; XXX not used? 00762 int radial_symm[3]; 00763 00764 // all this below is used to communicate with the cursor drawing routine 00765 00766 /* record movement of mouse so that rake can start at an intuitive angle */ 00767 float last_x, last_y; 00768 float last_angle; 00769 00770 int draw_anchored; 00771 int anchored_size; 00772 float anchored_location[3]; 00773 float anchored_initial_mouse[2]; 00774 00775 int draw_pressure; 00776 float pressure_value; 00777 00778 float special_rotation; 00779 00780 int pad; 00781 } Sculpt; 00782 00783 /* ------------------------------------------- */ 00784 /* Vertex Paint */ 00785 00786 /* Vertex Paint */ 00787 typedef struct VPaint { 00788 Paint paint; 00789 00790 short flag, pad; 00791 int tot; /* allocation size of prev buffers */ 00792 unsigned int *vpaint_prev; /* previous mesh colors */ 00793 struct MDeformVert *wpaint_prev; /* previous vertex weights */ 00794 00795 void *paintcursor; /* wm handle */ 00796 } VPaint; 00797 00798 /* VPaint flag */ 00799 #define VP_COLINDEX 1 00800 #define VP_AREA 2 /* vertex paint only */ 00801 00802 #define VP_NORMALS 8 00803 #define VP_SPRAY 16 00804 // #define VP_MIRROR_X 32 // deprecated in 2.5x use (me->editflag & ME_EDIT_MIRROR_X) 00805 #define VP_ONLYVGROUP 128 /* weight paint only */ 00806 00807 /* *************************************************************** */ 00808 /* Transform Orientations */ 00809 00810 typedef struct TransformOrientation { 00811 struct TransformOrientation *next, *prev; 00812 char name[64]; /* MAX_NAME */ 00813 float mat[3][3]; 00814 int pad; 00815 } TransformOrientation; 00816 00817 /* *************************************************************** */ 00818 /* Unified Paint Settings */ 00819 00820 /* These settings can override the equivalent fields in the active 00821 Brush for any paint mode; the flag field controls whether these 00822 values are used */ 00823 typedef struct UnifiedPaintSettings { 00824 /* unified radius of brush in pixels */ 00825 int size; 00826 00827 /* unified radius of brush in Blender units */ 00828 float unprojected_radius; 00829 00830 /* unified strength of brush */ 00831 float alpha; 00832 00833 /* user preferences for sculpt and paint */ 00834 int flag; 00835 } UnifiedPaintSettings; 00836 00837 typedef enum { 00838 UNIFIED_PAINT_SIZE = (1<<0), 00839 UNIFIED_PAINT_ALPHA = (1<<1), 00840 00841 /* only used if unified size is enabled, mirros the brush flags 00842 BRUSH_LOCK_SIZE and BRUSH_SIZE_PRESSURE */ 00843 UNIFIED_PAINT_BRUSH_LOCK_SIZE = (1<<2), 00844 UNIFIED_PAINT_BRUSH_SIZE_PRESSURE = (1<<3), 00845 00846 /* only used if unified alpha is enabled, mirrors the brush flag 00847 BRUSH_ALPHA_PRESSURE */ 00848 UNIFIED_PAINT_BRUSH_ALPHA_PRESSURE = (1<<4) 00849 } UnifiedPaintSettingsFlags; 00850 00851 /* *************************************************************** */ 00852 /* Tool Settings */ 00853 00854 typedef struct ToolSettings { 00855 VPaint *vpaint; /* vertex paint */ 00856 VPaint *wpaint; /* weight paint */ 00857 Sculpt *sculpt; 00858 00859 /* Vertex groups */ 00860 float vgroup_weight; 00861 00862 /* Subdivide Settings */ 00863 short cornertype; 00864 short editbutflag; 00865 /*Triangle to Quad conversion threshold*/ 00866 float jointrilimit; 00867 /* Editmode Tools */ 00868 float degr; 00869 short step; 00870 short turn; 00871 00872 float extr_offs; /* extrude offset */ 00873 float doublimit; /* remove doubles limit */ 00874 float normalsize; /* size of normals */ 00875 short automerge; 00876 00877 /* Selection Mode for Mesh */ 00878 short selectmode; 00879 00880 /* Primitive Settings */ 00881 /* UV Sphere */ 00882 short segments; 00883 short rings; 00884 00885 /* Cylinder - Tube - Circle */ 00886 short vertices; 00887 00888 /* UV Calculation */ 00889 short unwrapper; 00890 float uvcalc_radius; 00891 float uvcalc_cubesize; 00892 float uvcalc_margin; 00893 short uvcalc_mapdir; 00894 short uvcalc_mapalign; 00895 short uvcalc_flag; 00896 short uv_flag, uv_selectmode; 00897 short uv_pad; 00898 00899 /* Grease Pencil */ 00900 short gpencil_flags; 00901 00902 /* Auto-IK */ 00903 short autoik_chainlen; 00904 00905 /* Image Paint (8 byttse aligned please!) */ 00906 struct ImagePaintSettings imapaint; 00907 00908 /* Particle Editing */ 00909 struct ParticleEditSettings particle; 00910 00911 /* Transform Proportional Area of Effect */ 00912 float proportional_size; 00913 00914 /* Select Group Threshold */ 00915 float select_thresh; 00916 00917 /* Graph Editor */ 00918 float clean_thresh; 00919 00920 /* Auto-Keying Mode */ 00921 short autokey_mode, autokey_flag; /* defines in DNA_userdef_types.h */ 00922 00923 /* Multires */ 00924 char multires_subdiv_type; 00925 char pad2[5]; 00926 00927 /* Skeleton generation */ 00928 short skgen_resolution; 00929 float skgen_threshold_internal; 00930 float skgen_threshold_external; 00931 float skgen_length_ratio; 00932 float skgen_length_limit; 00933 float skgen_angle_limit; 00934 float skgen_correlation_limit; 00935 float skgen_symmetry_limit; 00936 float skgen_retarget_angle_weight; 00937 float skgen_retarget_length_weight; 00938 float skgen_retarget_distance_weight; 00939 short skgen_options; 00940 char skgen_postpro; 00941 char skgen_postpro_passes; 00942 char skgen_subdivisions[3]; 00943 char skgen_multi_level; 00944 00945 /* Skeleton Sketching */ 00946 struct Object *skgen_template; 00947 char bone_sketching; 00948 char bone_sketching_convert; 00949 char skgen_subdivision_number; 00950 char skgen_retarget_options; 00951 char skgen_retarget_roll; 00952 char skgen_side_string[8]; 00953 char skgen_num_string[8]; 00954 00955 /* Alt+RMB option */ 00956 char edge_mode; 00957 char edge_mode_live_unwrap; 00958 00959 /* Transform */ 00960 char snap_mode; 00961 short snap_flag, snap_target; 00962 short proportional, prop_mode; 00963 char proportional_objects; /* proportional edit, object mode */ 00964 char pad[5]; 00965 00966 char auto_normalize; /*auto normalizing mode in wpaint*/ 00967 char multipaint; /* paint multiple bones in wpaint */ 00968 00969 /* XXX: these sculpt_paint_* fields are deprecated, use the 00970 unified_paint_settings field instead! */ 00971 short sculpt_paint_settings DNA_DEPRECATED; 00972 short pad1; 00973 int sculpt_paint_unified_size DNA_DEPRECATED; 00974 float sculpt_paint_unified_unprojected_radius DNA_DEPRECATED; 00975 float sculpt_paint_unified_alpha DNA_DEPRECATED; 00976 00977 /* Unified Paint Settings */ 00978 struct UnifiedPaintSettings unified_paint_settings; 00979 } ToolSettings; 00980 00981 /* *************************************************************** */ 00982 /* Assorted Scene Data */ 00983 00984 /* ------------------------------------------- */ 00985 /* Stats (show in Info header) */ 00986 00987 typedef struct bStats { 00988 /* scene totals for visible layers */ 00989 int totobj, totlamp, totobjsel, totcurve, totmesh, totarmature; 00990 int totvert, totface; 00991 } bStats; 00992 00993 /* ------------------------------------------- */ 00994 /* Unit Settings */ 00995 00996 typedef struct UnitSettings { 00997 /* Display/Editing unit options for each scene */ 00998 float scale_length; /* maybe have other unit conversions? */ 00999 char system; /* imperial, metric etc */ 01000 char system_rotation; /* not implimented as a propper unit system yet */ 01001 short flag; 01002 } UnitSettings; 01003 01004 /* ------------------------------------------- */ 01005 /* Global/Common Physics Settings */ 01006 01007 typedef struct PhysicsSettings { 01008 float gravity[3]; 01009 int flag, quick_cache_step, rt; 01010 } PhysicsSettings; 01011 01012 /* *************************************************************** */ 01013 /* Scene ID-Block */ 01014 01015 typedef struct Scene { 01016 ID id; 01017 struct AnimData *adt; /* animation data (must be immediately after id for utilities to use it) */ 01018 01019 struct Object *camera; 01020 struct World *world; 01021 01022 struct Scene *set; 01023 01024 ListBase base; 01025 struct Base *basact; /* active base */ 01026 struct Object *obedit; /* name replaces old G.obedit */ 01027 01028 float cursor[3]; /* 3d cursor location */ 01029 float twcent[3]; /* center for transform widget */ 01030 float twmin[3], twmax[3]; /* boundbox of selection for transform widget */ 01031 01032 unsigned int lay; /* bitflags for layer visibility */ 01033 int layact; /* active layer */ 01034 unsigned int lay_updated; /* runtime flag, has layer ever been updated since load? */ 01035 01036 short flag; /* various settings */ 01037 01038 short use_nodes; 01039 01040 struct bNodeTree *nodetree; 01041 01042 struct Editing *ed; /* sequence editor data is allocated here */ 01043 01044 struct ToolSettings *toolsettings; /* default allocated now */ 01045 struct SceneStats *stats; /* default allocated now */ 01046 01047 /* migrate or replace? depends on some internal things... */ 01048 /* no, is on the right place (ton) */ 01049 struct RenderData r; 01050 struct AudioData audio; 01051 01052 ListBase markers; 01053 ListBase transform_spaces; 01054 01055 void *sound_scene; 01056 void *sound_scene_handle; 01057 void *sound_scrub_handle; 01058 void *speaker_handles; 01059 01060 void *fps_info; /* (runtime) info/cache used for presenting playback framerate info to the user */ 01061 01062 /* none of the dependancy graph vars is mean to be saved */ 01063 struct DagForest *theDag; 01064 short dagisvalid, dagflags; 01065 short recalc; /* recalc = counterpart of ob->recalc */ 01066 01067 short pad6; 01068 int pad5; 01069 01070 /* User-Defined KeyingSets */ 01071 int active_keyingset; /* index of the active KeyingSet. first KeyingSet has index 1, 'none' active is 0, 'add new' is -1 */ 01072 ListBase keyingsets; /* KeyingSets for this scene */ 01073 01074 /* Game Settings */ 01075 struct GameFraming framing DNA_DEPRECATED; // XXX deprecated since 2.5 01076 struct GameData gm; 01077 01078 /* Units */ 01079 struct UnitSettings unit; 01080 01081 /* Grease Pencil */ 01082 struct bGPdata *gpd; 01083 01084 /* Physics simulation settings */ 01085 struct PhysicsSettings physics_settings; 01086 01087 /* Movie Tracking */ 01088 struct MovieClip *clip; /* active movie clip */ 01089 01090 uint64_t customdata_mask; /* XXX. runtime flag for drawing, actually belongs in the window, only used by object_handle_update() */ 01091 uint64_t customdata_mask_modal; /* XXX. same as above but for temp operator use (gl renders) */ 01092 } Scene; 01093 01094 01095 /* **************** RENDERDATA ********************* */ 01096 01097 /* flag */ 01098 /* use preview range */ 01099 #define SCER_PRV_RANGE (1<<0) 01100 01101 /* mode (int now) */ 01102 #define R_OSA 0x0001 01103 #define R_SHADOW 0x0002 01104 #define R_GAMMA 0x0004 01105 #define R_ORTHO 0x0008 01106 #define R_ENVMAP 0x0010 01107 #define R_EDGE 0x0020 01108 #define R_FIELDS 0x0040 01109 #define R_FIELDSTILL 0x0080 01110 #define R_RADIO 0x0100 01111 #define R_BORDER 0x0200 01112 #define R_PANORAMA 0x0400 /* deprecated as scene option, still used in renderer */ 01113 #define R_CROP 0x0800 01114 /*#define R_COSMO 0x1000 deprecated */ 01115 #define R_ODDFIELD 0x2000 01116 #define R_MBLUR 0x4000 01117 /* unified was here */ 01118 #define R_RAYTRACE 0x10000 01119 /* R_GAUSS is obsolete, but used to retrieve setting from old files */ 01120 #define R_GAUSS 0x20000 01121 /* fbuf obsolete... */ 01122 /*#define R_FBUF 0x40000*/ 01123 /* threads obsolete... is there for old files, now use for autodetect threads */ 01124 #define R_THREADS 0x80000 01125 /* Use the same flag for autothreads */ 01126 #define R_FIXED_THREADS 0x80000 01127 01128 #define R_SPEED 0x100000 01129 #define R_SSS 0x200000 01130 #define R_NO_OVERWRITE 0x400000 /* skip existing files */ 01131 #define R_TOUCH 0x800000 /* touch files before rendering */ 01132 #define R_SIMPLIFY 0x1000000 01133 01134 /* seq_flag */ 01135 #define R_SEQ_GL_PREV 1 01136 #define R_SEQ_GL_REND 2 01137 01138 /* displaymode */ 01139 01140 #define R_OUTPUT_SCREEN 0 01141 #define R_OUTPUT_AREA 1 01142 #define R_OUTPUT_WINDOW 2 01143 #define R_OUTPUT_NONE 3 01144 /*#define R_OUTPUT_FORKED 4*/ 01145 01146 /* filtertype */ 01147 #define R_FILTER_BOX 0 01148 #define R_FILTER_TENT 1 01149 #define R_FILTER_QUAD 2 01150 #define R_FILTER_CUBIC 3 01151 #define R_FILTER_CATROM 4 01152 #define R_FILTER_GAUSS 5 01153 #define R_FILTER_MITCH 6 01154 #define R_FILTER_FAST_GAUSS 7 /* note, this is only used for nodes at the moment */ 01155 01156 /* raytrace structure */ 01157 #define R_RAYSTRUCTURE_AUTO 0 01158 #define R_RAYSTRUCTURE_OCTREE 1 01159 #define R_RAYSTRUCTURE_BLIBVH 2 01160 #define R_RAYSTRUCTURE_VBVH 3 01161 #define R_RAYSTRUCTURE_SIMD_SVBVH 4 /* needs SIMD */ 01162 #define R_RAYSTRUCTURE_SIMD_QBVH 5 /* needs SIMD */ 01163 01164 /* raytrace_options */ 01165 #define R_RAYTRACE_USE_LOCAL_COORDS 0x0001 01166 #define R_RAYTRACE_USE_INSTANCES 0x0002 01167 01168 /* scemode (int now) */ 01169 #define R_DOSEQ 0x0001 01170 #define R_BG_RENDER 0x0002 01171 /* passepartout is camera option now, keep this for backward compatibility */ 01172 #define R_PASSEPARTOUT 0x0004 01173 #define R_PREVIEWBUTS 0x0008 01174 #define R_EXTENSION 0x0010 01175 #define R_MATNODE_PREVIEW 0x0020 01176 #define R_DOCOMP 0x0040 01177 #define R_COMP_CROP 0x0080 01178 #define R_FREE_IMAGE 0x0100 01179 #define R_SINGLE_LAYER 0x0200 01180 #define R_EXR_TILE_FILE 0x0400 01181 #define R_COMP_FREE 0x0800 01182 #define R_NO_IMAGE_LOAD 0x1000 01183 #define R_NO_TEX 0x2000 01184 #define R_NO_FRAME_UPDATE 0x4000 01185 #define R_FULL_SAMPLE 0x8000 01186 /* #define R_DEPRECATED 0x10000 */ 01187 /* #define R_RECURS_PROTECTION 0x20000 */ 01188 #define R_TEXNODE_PREVIEW 0x40000 01189 01190 /* r->stamp */ 01191 #define R_STAMP_TIME 0x0001 01192 #define R_STAMP_FRAME 0x0002 01193 #define R_STAMP_DATE 0x0004 01194 #define R_STAMP_CAMERA 0x0008 01195 #define R_STAMP_SCENE 0x0010 01196 #define R_STAMP_NOTE 0x0020 01197 #define R_STAMP_DRAW 0x0040 /* draw in the image */ 01198 #define R_STAMP_MARKER 0x0080 01199 #define R_STAMP_FILENAME 0x0100 01200 #define R_STAMP_SEQSTRIP 0x0200 01201 #define R_STAMP_RENDERTIME 0x0400 01202 #define R_STAMP_CAMERALENS 0x0800 01203 #define R_STAMP_ALL (R_STAMP_TIME|R_STAMP_FRAME|R_STAMP_DATE|R_STAMP_CAMERA|R_STAMP_SCENE| \ 01204 R_STAMP_NOTE|R_STAMP_MARKER|R_STAMP_FILENAME|R_STAMP_SEQSTRIP| \ 01205 R_STAMP_RENDERTIME|R_STAMP_CAMERALENS) 01206 01207 /* alphamode */ 01208 #define R_ADDSKY 0 01209 #define R_ALPHAPREMUL 1 01210 #define R_ALPHAKEY 2 01211 01212 /* color_mgt_flag */ 01213 #define R_COLOR_MANAGEMENT (1 << 0) 01214 #define R_COLOR_MANAGEMENT_PREDIVIDE (1 << 1) 01215 01216 /* subimtype, flag options for imtype */ 01217 #define R_OPENEXR_HALF 1 /*deprecated*/ 01218 #define R_OPENEXR_ZBUF 2 /*deprecated*/ 01219 #define R_PREVIEW_JPG 4 /*deprecated*/ 01220 #define R_CINEON_LOG 8 /*deprecated*/ 01221 #define R_TIFF_16BIT 16 /*deprecated*/ 01222 01223 #define R_JPEG2K_12BIT 32 /* Jpeg2000 */ /*deprecated*/ 01224 #define R_JPEG2K_16BIT 64 /*deprecated*/ 01225 #define R_JPEG2K_YCC 128 /* when disabled use RGB */ /*deprecated*/ 01226 #define R_JPEG2K_CINE_PRESET 256 /*deprecated*/ 01227 #define R_JPEG2K_CINE_48FPS 512 /*deprecated*/ 01228 01229 /* bake_mode: same as RE_BAKE_xxx defines */ 01230 /* bake_flag: */ 01231 #define R_BAKE_CLEAR 1 01232 #define R_BAKE_OSA 2 01233 #define R_BAKE_TO_ACTIVE 4 01234 #define R_BAKE_NORMALIZE 8 01235 #define R_BAKE_MULTIRES 16 01236 #define R_BAKE_LORES_MESH 32 01237 01238 /* bake_normal_space */ 01239 #define R_BAKE_SPACE_CAMERA 0 01240 #define R_BAKE_SPACE_WORLD 1 01241 #define R_BAKE_SPACE_OBJECT 2 01242 #define R_BAKE_SPACE_TANGENT 3 01243 01244 /* simplify_flag */ 01245 #define R_SIMPLE_NO_TRIANGULATE 1 01246 01247 /* sequencer seq_prev_type seq_rend_type */ 01248 01249 01250 /* **************** SCENE ********************* */ 01251 01252 /* for general use */ 01253 #define MAXFRAME 300000 01254 #define MAXFRAMEF 300000.0f 01255 01256 #define MINFRAME 0 01257 #define MINFRAMEF 0.0f 01258 01259 /* (minimum frame number for current-frame) */ 01260 #define MINAFRAME -300000 01261 #define MINAFRAMEF -300000.0f 01262 01263 /* depricate this! */ 01264 #define TESTBASE(v3d, base) ( \ 01265 ((base)->flag & SELECT) && \ 01266 ((base)->lay & v3d->lay) && \ 01267 (((base)->object->restrictflag & OB_RESTRICT_VIEW)==0) ) 01268 #define TESTBASELIB(v3d, base) ( \ 01269 ((base)->flag & SELECT) && \ 01270 ((base)->lay & v3d->lay) && \ 01271 ((base)->object->id.lib==NULL) && \ 01272 (((base)->object->restrictflag & OB_RESTRICT_VIEW)==0) ) 01273 #define TESTBASELIB_BGMODE(v3d, scene, base) ( \ 01274 ((base)->flag & SELECT) && \ 01275 ((base)->lay & (v3d ? v3d->lay : scene->lay)) && \ 01276 ((base)->object->id.lib==NULL) && \ 01277 (((base)->object->restrictflag & OB_RESTRICT_VIEW)==0) ) 01278 #define BASE_EDITABLE_BGMODE(v3d, scene, base) ( \ 01279 ((base)->lay & (v3d ? v3d->lay : scene->lay)) && \ 01280 ((base)->object->id.lib==NULL) && \ 01281 (((base)->object->restrictflag & OB_RESTRICT_VIEW)==0)) 01282 #define BASE_SELECTABLE(v3d, base) ( \ 01283 (base->lay & v3d->lay) && \ 01284 (base->object->restrictflag & (OB_RESTRICT_SELECT|OB_RESTRICT_VIEW))==0 ) 01285 #define BASE_VISIBLE(v3d, base) ( \ 01286 (base->lay & v3d->lay) && \ 01287 (base->object->restrictflag & OB_RESTRICT_VIEW)==0 ) 01288 01289 #define FIRSTBASE scene->base.first 01290 #define LASTBASE scene->base.last 01291 #define BASACT (scene->basact) 01292 #define OBACT (BASACT? BASACT->object: NULL) 01293 01294 #define V3D_CAMERA_LOCAL(v3d) ((!(v3d)->scenelock && (v3d)->camera) ? (v3d)->camera : NULL) 01295 #define V3D_CAMERA_SCENE(scene, v3d) ((!(v3d)->scenelock && (v3d)->camera) ? (v3d)->camera : (scene)->camera) 01296 01297 #define ID_NEW(a) if( (a) && (a)->id.newid ) (a)= (void *)(a)->id.newid 01298 #define ID_NEW_US(a) if( (a)->id.newid) {(a)= (void *)(a)->id.newid; (a)->id.us++;} 01299 #define ID_NEW_US2(a) if( ((ID *)a)->newid) {(a)= ((ID *)a)->newid; ((ID *)a)->us++;} 01300 #define CFRA (scene->r.cfra) 01301 #define SUBFRA (scene->r.subframe) 01302 #define SFRA (scene->r.sfra) 01303 #define EFRA (scene->r.efra) 01304 #define PRVRANGEON (scene->r.flag & SCER_PRV_RANGE) 01305 #define PSFRA ((PRVRANGEON)? (scene->r.psfra): (scene->r.sfra)) 01306 #define PEFRA ((PRVRANGEON)? (scene->r.pefra): (scene->r.efra)) 01307 #define FRA2TIME(a) ((((double) scene->r.frs_sec_base) * (double)(a)) / (double)scene->r.frs_sec) 01308 #define TIME2FRA(a) ((((double) scene->r.frs_sec) * (double)(a)) / (double)scene->r.frs_sec_base) 01309 #define FPS (((double) scene->r.frs_sec) / (double)scene->r.frs_sec_base) 01310 01311 #define RAD_PHASE_PATCHES 1 01312 #define RAD_PHASE_FACES 2 01313 01314 /* base->flag is in DNA_object_types.h */ 01315 01316 /* toolsettings->snap_flag */ 01317 #define SCE_SNAP 1 01318 #define SCE_SNAP_ROTATE 2 01319 #define SCE_SNAP_PEEL_OBJECT 4 01320 #define SCE_SNAP_PROJECT 8 01321 #define SCE_SNAP_NO_SELF 16 01322 /* toolsettings->snap_target */ 01323 #define SCE_SNAP_TARGET_CLOSEST 0 01324 #define SCE_SNAP_TARGET_CENTER 1 01325 #define SCE_SNAP_TARGET_MEDIAN 2 01326 #define SCE_SNAP_TARGET_ACTIVE 3 01327 /* toolsettings->snap_mode */ 01328 #define SCE_SNAP_MODE_INCREMENT 0 01329 #define SCE_SNAP_MODE_VERTEX 1 01330 #define SCE_SNAP_MODE_EDGE 2 01331 #define SCE_SNAP_MODE_FACE 3 01332 #define SCE_SNAP_MODE_VOLUME 4 01333 01334 /* toolsettings->selectmode */ 01335 #define SCE_SELECT_VERTEX 1 /* for mesh */ 01336 #define SCE_SELECT_EDGE 2 01337 #define SCE_SELECT_FACE 4 01338 01339 /* toolsettings->particle.selectmode for particles */ 01340 #define SCE_SELECT_PATH 1 01341 #define SCE_SELECT_POINT 2 01342 #define SCE_SELECT_END 4 01343 01344 /* sce->recalc (now in use by previewrender) */ 01345 #define SCE_PRV_CHANGED 1 01346 01347 /* toolsettings->prop_mode (proportional falloff) */ 01348 #define PROP_SMOOTH 0 01349 #define PROP_SPHERE 1 01350 #define PROP_ROOT 2 01351 #define PROP_SHARP 3 01352 #define PROP_LIN 4 01353 #define PROP_CONST 5 01354 #define PROP_RANDOM 6 01355 #define PROP_MODE_MAX 7 01356 01357 /* toolsettings->proportional */ 01358 #define PROP_EDIT_OFF 0 01359 #define PROP_EDIT_ON 1 01360 #define PROP_EDIT_CONNECTED 2 01361 01362 /* sce->flag */ 01363 #define SCE_DS_SELECTED (1<<0) 01364 #define SCE_DS_COLLAPSED (1<<1) 01365 #define SCE_NLA_EDIT_ON (1<<2) 01366 #define SCE_FRAME_DROP (1<<3) 01367 01368 01369 /* return flag next_object function */ 01370 #define F_ERROR -1 01371 #define F_START 0 01372 #define F_SCENE 1 01373 #define F_DUPLI 3 01374 01375 /* audio->flag */ 01376 #define AUDIO_MUTE (1<<0) 01377 #define AUDIO_SYNC (1<<1) 01378 #define AUDIO_SCRUB (1<<2) 01379 #define AUDIO_VOLUME_ANIMATED (1<<3) 01380 01381 #define FFMPEG_MULTIPLEX_AUDIO 1 /* deprecated, you can choose none as audiocodec now */ 01382 #define FFMPEG_AUTOSPLIT_OUTPUT 2 01383 #define FFMPEG_LOSSLESS_OUTPUT 4 01384 01385 /* Paint.flags */ 01386 typedef enum { 01387 PAINT_SHOW_BRUSH = (1<<0), 01388 PAINT_FAST_NAVIGATE = (1<<1), 01389 PAINT_SHOW_BRUSH_ON_SURFACE = (1<<2), 01390 } PaintFlags; 01391 01392 /* Sculpt.flags */ 01393 /* These can eventually be moved to paint flags? */ 01394 typedef enum SculptFlags { 01395 SCULPT_SYMM_X = (1<<0), 01396 SCULPT_SYMM_Y = (1<<1), 01397 SCULPT_SYMM_Z = (1<<2), 01398 SCULPT_LOCK_X = (1<<3), 01399 SCULPT_LOCK_Y = (1<<4), 01400 SCULPT_LOCK_Z = (1<<5), 01401 SCULPT_SYMMETRY_FEATHER = (1<<6), 01402 SCULPT_USE_OPENMP = (1<<7), 01403 SCULPT_ONLY_DEFORM = (1<<8), 01404 } SculptFlags; 01405 01406 /* ImagePaintSettings.flag */ 01407 #define IMAGEPAINT_DRAWING 1 01408 // #define IMAGEPAINT_DRAW_TOOL 2 // deprecated 01409 // #define IMAGEPAINT_DRAW_TOOL_DRAWING 4 // deprecated 01410 01411 /* projection painting only */ 01412 #define IMAGEPAINT_PROJECT_DISABLE 8 /* Non projection 3D painting */ 01413 #define IMAGEPAINT_PROJECT_XRAY 16 01414 #define IMAGEPAINT_PROJECT_BACKFACE 32 01415 #define IMAGEPAINT_PROJECT_FLAT 64 01416 #define IMAGEPAINT_PROJECT_LAYER_CLONE 128 01417 #define IMAGEPAINT_PROJECT_LAYER_STENCIL 256 01418 #define IMAGEPAINT_PROJECT_LAYER_STENCIL_INV 512 01419 01420 /* toolsettings->uvcalc_flag */ 01421 #define UVCALC_FILLHOLES 1 01422 #define UVCALC_NO_ASPECT_CORRECT 2 /* would call this UVCALC_ASPECT_CORRECT, except it should be default with old file */ 01423 #define UVCALC_TRANSFORM_CORRECT 4 /* adjust UV's while transforming to avoid distortion */ 01424 01425 /* toolsettings->uv_flag */ 01426 #define UV_SYNC_SELECTION 1 01427 #define UV_SHOW_SAME_IMAGE 2 01428 01429 /* toolsettings->uv_selectmode */ 01430 #define UV_SELECT_VERTEX 1 01431 #define UV_SELECT_EDGE 2 01432 #define UV_SELECT_FACE 4 01433 #define UV_SELECT_ISLAND 8 01434 01435 /* toolsettings->edge_mode */ 01436 #define EDGE_MODE_SELECT 0 01437 #define EDGE_MODE_TAG_SEAM 1 01438 #define EDGE_MODE_TAG_SHARP 2 01439 #define EDGE_MODE_TAG_CREASE 3 01440 #define EDGE_MODE_TAG_BEVEL 4 01441 01442 /* toolsettings->gpencil_flags */ 01443 #define GP_TOOL_FLAG_PAINTSESSIONS_ON (1<<0) 01444 01445 /* toolsettings->particle flag */ 01446 #define PE_KEEP_LENGTHS 1 01447 #define PE_LOCK_FIRST 2 01448 #define PE_DEFLECT_EMITTER 4 01449 #define PE_INTERPOLATE_ADDED 8 01450 #define PE_DRAW_PART 16 01451 /* #define PE_X_MIRROR 64 */ /* deprecated */ 01452 #define PE_FADE_TIME 128 01453 #define PE_AUTO_VELOCITY 256 01454 01455 /* toolsetting->particle brushtype */ 01456 #define PE_BRUSH_NONE -1 01457 #define PE_BRUSH_COMB 0 01458 #define PE_BRUSH_CUT 1 01459 #define PE_BRUSH_LENGTH 2 01460 #define PE_BRUSH_PUFF 3 01461 #define PE_BRUSH_ADD 4 01462 #define PE_BRUSH_SMOOTH 5 01463 #define PE_BRUSH_WEIGHT 6 01464 01465 /* this must equal ParticleEditSettings.brush array size */ 01466 #define PE_TOT_BRUSH 6 01467 01468 /* ParticleBrushData->flag */ 01469 #define PE_BRUSH_DATA_PUFF_VOLUME 1 01470 01471 /* tooksettings->particle edittype */ 01472 #define PE_TYPE_PARTICLES 0 01473 #define PE_TYPE_SOFTBODY 1 01474 #define PE_TYPE_CLOTH 2 01475 01476 /* toolsettings->skgen_options */ 01477 #define SKGEN_FILTER_INTERNAL (1 << 0) 01478 #define SKGEN_FILTER_EXTERNAL (1 << 1) 01479 #define SKGEN_SYMMETRY (1 << 2) 01480 #define SKGEN_CUT_LENGTH (1 << 3) 01481 #define SKGEN_CUT_ANGLE (1 << 4) 01482 #define SKGEN_CUT_CORRELATION (1 << 5) 01483 #define SKGEN_HARMONIC (1 << 6) 01484 #define SKGEN_STICK_TO_EMBEDDING (1 << 7) 01485 #define SKGEN_ADAPTIVE_DISTANCE (1 << 8) 01486 #define SKGEN_FILTER_SMART (1 << 9) 01487 #define SKGEN_DISP_LENGTH (1 << 10) 01488 #define SKGEN_DISP_WEIGHT (1 << 11) 01489 #define SKGEN_DISP_ORIG (1 << 12) 01490 #define SKGEN_DISP_EMBED (1 << 13) 01491 #define SKGEN_DISP_INDEX (1 << 14) 01492 01493 #define SKGEN_SUB_LENGTH 0 01494 #define SKGEN_SUB_ANGLE 1 01495 #define SKGEN_SUB_CORRELATION 2 01496 #define SKGEN_SUB_TOTAL 3 01497 01498 /* toolsettings->skgen_postpro */ 01499 #define SKGEN_SMOOTH 0 01500 #define SKGEN_AVERAGE 1 01501 #define SKGEN_SHARPEN 2 01502 01503 /* toolsettings->bone_sketching */ 01504 #define BONE_SKETCHING 1 01505 #define BONE_SKETCHING_QUICK 2 01506 #define BONE_SKETCHING_ADJUST 4 01507 01508 /* toolsettings->bone_sketching_convert */ 01509 #define SK_CONVERT_CUT_FIXED 0 01510 #define SK_CONVERT_CUT_LENGTH 1 01511 #define SK_CONVERT_CUT_ADAPTATIVE 2 01512 #define SK_CONVERT_RETARGET 3 01513 01514 /* toolsettings->skgen_retarget_options */ 01515 #define SK_RETARGET_AUTONAME 1 01516 01517 /* toolsettings->skgen_retarget_roll */ 01518 #define SK_RETARGET_ROLL_NONE 0 01519 #define SK_RETARGET_ROLL_VIEW 1 01520 #define SK_RETARGET_ROLL_JOINT 2 01521 01522 /* physics_settings->flag */ 01523 #define PHYS_GLOBAL_GRAVITY 1 01524 01525 /* UnitSettings */ 01526 01527 /* UnitSettings->system */ 01528 #define USER_UNIT_NONE 0 01529 #define USER_UNIT_METRIC 1 01530 #define USER_UNIT_IMPERIAL 2 01531 /* UnitSettings->flag */ 01532 #define USER_UNIT_OPT_SPLIT 1 01533 #define USER_UNIT_ROT_RADIANS 2 01534 01535 #ifdef __cplusplus 01536 } 01537 #endif 01538 01539 #endif