2011-02-18 13:05:18 +00:00
|
|
|
/*
|
2008-01-07 19:13:47 +00:00
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
2002-10-12 11:37:38 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
2008-01-07 19:13:47 +00:00
|
|
|
* of the License, or (at your option) any later version.
|
2002-10-12 11:37:38 +00:00
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2002-10-12 11:37:38 +00:00
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* The Original Code is: all of this file.
|
|
|
|
*
|
|
|
|
* Contributor(s): none yet.
|
|
|
|
*
|
2008-01-07 19:13:47 +00:00
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
2002-10-12 11:37:38 +00:00
|
|
|
*/
|
2012-02-17 18:59:41 +00:00
|
|
|
#ifndef __BKE_GLOBAL_H__
|
|
|
|
#define __BKE_GLOBAL_H__
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2011-02-18 13:05:18 +00:00
|
|
|
/** \file BKE_global.h
|
|
|
|
* \ingroup bke
|
|
|
|
* \since March 2001
|
|
|
|
* \author nzc
|
|
|
|
* \section aboutglobal Global settings
|
|
|
|
* Global settings, handles, pointers. This is the root for finding
|
|
|
|
* any data in Blender. This block is not serialized, but built anew
|
|
|
|
* for every fresh Blender run.
|
|
|
|
*/
|
2002-10-12 11:37:38 +00:00
|
|
|
#include "DNA_listBase.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* forwards */
|
|
|
|
struct Main;
|
|
|
|
struct Object;
|
2008-02-23 22:11:16 +00:00
|
|
|
struct BME_Glob;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
typedef struct Global {
|
|
|
|
|
2005-11-22 18:50:03 +00:00
|
|
|
/* active pointers */
|
|
|
|
struct Main *main;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2005-11-22 18:50:03 +00:00
|
|
|
/* strings: lastsaved */
|
2012-01-21 14:54:53 +00:00
|
|
|
char ima[1024], lib[1024]; /* 1024 = FILE_MAX */
|
2006-05-30 13:38:22 +00:00
|
|
|
|
2010-10-18 06:41:16 +00:00
|
|
|
/* flag: if != 0 G.main->name contains valid relative base path */
|
2006-08-20 14:41:13 +00:00
|
|
|
int relbase_valid;
|
|
|
|
|
2011-11-03 03:00:45 +00:00
|
|
|
/* strings of recent opened files */
|
2006-05-30 13:38:22 +00:00
|
|
|
struct ListBase recent_files;
|
2012-08-08 18:21:54 +00:00
|
|
|
|
2012-08-08 18:37:06 +00:00
|
|
|
/* has escape been pressed or Ctrl+C pressed in background mode, used for render quit */
|
|
|
|
short is_break;
|
|
|
|
|
|
|
|
short moving, file_loaded;
|
2011-01-19 09:13:24 +00:00
|
|
|
char background;
|
|
|
|
char factory_startup;
|
2012-05-12 20:39:39 +00:00
|
|
|
short winpos, displaymode; /* used to be in Render */
|
2012-08-08 18:37:06 +00:00
|
|
|
|
|
|
|
/* to indicate render is busy, prevent renderwindow events etc */
|
|
|
|
short is_rendering;
|
2008-12-19 19:11:02 +00:00
|
|
|
|
2012-08-08 18:21:54 +00:00
|
|
|
/* debug value, can be set from the UI and python, used for testing nonstandard features */
|
|
|
|
short debug_value;
|
|
|
|
|
|
|
|
/* saved to the blend file as FileGlobal.globalf,
|
|
|
|
* however this is now only used for runtime options */
|
2002-10-12 11:37:38 +00:00
|
|
|
int f;
|
2012-08-08 18:21:54 +00:00
|
|
|
|
|
|
|
/* debug flag, G_DEBUG, G_DEBUG_PYTHON & friends, set python or command line args */
|
2012-03-31 00:59:17 +00:00
|
|
|
int debug;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2008-02-23 22:11:16 +00:00
|
|
|
/* Used for BMesh transformations */
|
|
|
|
struct BME_Glob *editBMesh;
|
2012-08-08 18:21:54 +00:00
|
|
|
|
2005-11-22 18:50:03 +00:00
|
|
|
/* Frank's variables */
|
2012-05-12 20:39:39 +00:00
|
|
|
int save_over;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2007-12-24 18:38:03 +00:00
|
|
|
/* Rob's variables (keep here for WM recode) */
|
2003-04-28 02:15:46 +00:00
|
|
|
int have_quicktime;
|
|
|
|
int ui_international;
|
2005-09-14 14:02:21 +00:00
|
|
|
int charstart;
|
|
|
|
int charmin;
|
|
|
|
int charmax;
|
|
|
|
struct VFont *selfont;
|
|
|
|
struct ListBase ttfdata;
|
2003-04-28 02:15:46 +00:00
|
|
|
|
2005-11-22 18:50:03 +00:00
|
|
|
/* this variable is written to / read from FileGlobal->fileflags */
|
|
|
|
int fileflags;
|
2012-08-08 18:21:54 +00:00
|
|
|
|
2003-05-08 16:24:58 +00:00
|
|
|
/* save the allowed windowstate of blender when using -W or -w */
|
|
|
|
int windowstate;
|
2002-10-12 11:37:38 +00:00
|
|
|
} Global;
|
|
|
|
|
|
|
|
/* **************** GLOBAL ********************* */
|
|
|
|
|
|
|
|
/* G.f */
|
2012-05-12 20:39:39 +00:00
|
|
|
#define G_RENDER_OGL (1 << 0)
|
|
|
|
#define G_SWAP_EXCHANGE (1 << 1)
|
2005-08-03 18:48:22 +00:00
|
|
|
/* also uses G_FILE_AUTOPLAY */
|
2010-03-16 17:49:31 +00:00
|
|
|
/* #define G_RENDER_SHADOW (1 << 3) */ /* temp flag, removed */
|
2012-05-12 20:39:39 +00:00
|
|
|
#define G_BACKBUFSEL (1 << 4)
|
|
|
|
#define G_PICKSEL (1 << 5)
|
2009-01-31 13:30:56 +00:00
|
|
|
|
2009-10-20 20:59:02 +00:00
|
|
|
/* #define G_FACESELECT (1 << 8) use (mesh->editflag & ME_EDIT_PAINT_MASK) */
|
2009-01-31 13:30:56 +00:00
|
|
|
|
2010-02-27 01:47:46 +00:00
|
|
|
#define G_SCRIPT_AUTOEXEC (1 << 13)
|
2011-03-15 08:04:11 +00:00
|
|
|
#define G_SCRIPT_OVERRIDE_PREF (1 << 14) /* when this flag is set ignore the userprefs */
|
2009-01-31 13:30:56 +00:00
|
|
|
|
2005-05-03 10:54:42 +00:00
|
|
|
/* #define G_NOFROZEN (1 << 17) also removed */
|
2012-05-12 20:39:39 +00:00
|
|
|
/* #define G_GREASEPENCIL (1 << 17) also removed */
|
2009-01-31 13:30:56 +00:00
|
|
|
|
2008-01-10 01:36:22 +00:00
|
|
|
/* #define G_AUTOMATKEYS (1 << 30) also removed */
|
Visual Keying refactor
This code was always kludgy and this clean it up a bit.
insertmatrixkey() has been properly renamed insertkey_float().
Matrix calculations have been excised from the interface code,
and placed in insertmatrixkey(), so that you can call it from
anywhere without preliminaries and the proper values are calced
based on the passed adr code.
By much request, several semi-bug reports and discussion with
production animators, visual keying is now used automatic
for objects and bones that have constraints that cause them
to ignore their Ipos (CopyLoc, TrackTo, etc.). In those cases,
visual keying is used instead of the normal Ipo insertion
method. This "auto" functionality is toggled from the
"Use Visual Keying" button found along with "Needed" and
"Available" in the Edit Methods prefs.
Logic as to which constraints trigger visual keying on
which adrcodes can be tweaked in match_adr_constraint()
src/editipo.c
This has been tested by a couple of people, myself included,
but I may not have hit every constraint case, so evolutionary
feedback is welcome.
2007-07-31 13:37:59 +00:00
|
|
|
|
2012-03-31 00:59:17 +00:00
|
|
|
/* G.debug */
|
|
|
|
enum {
|
|
|
|
G_DEBUG = (1 << 0), /* general debug flag, print more info in unexpected cases */
|
|
|
|
G_DEBUG_FFMPEG = (1 << 1),
|
|
|
|
G_DEBUG_PYTHON = (1 << 2), /* extra python info */
|
|
|
|
G_DEBUG_EVENTS = (1 << 3), /* input/window/screen events */
|
2012-10-27 15:05:12 +00:00
|
|
|
G_DEBUG_HANDLERS = (1 << 4), /* events handling */
|
|
|
|
G_DEBUG_WM = (1 << 5), /* operator, undo */
|
|
|
|
G_DEBUG_JOBS = (1 << 6) /* jobs time profiling */
|
2012-03-31 00:59:17 +00:00
|
|
|
};
|
|
|
|
|
2012-08-08 18:37:06 +00:00
|
|
|
#define G_DEBUG_ALL (G_DEBUG | G_DEBUG_FFMPEG | G_DEBUG_PYTHON | G_DEBUG_EVENTS | G_DEBUG_WM | G_DEBUG_JOBS)
|
2012-03-31 00:59:17 +00:00
|
|
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
/* G.fileflags */
|
|
|
|
|
2005-08-03 18:48:22 +00:00
|
|
|
#define G_AUTOPACK (1 << 0)
|
|
|
|
#define G_FILE_COMPRESS (1 << 1)
|
|
|
|
#define G_FILE_AUTOPLAY (1 << 2)
|
2012-05-12 20:39:39 +00:00
|
|
|
#define G_FILE_ENABLE_ALL_FRAMES (1 << 3) /* deprecated */
|
|
|
|
#define G_FILE_SHOW_DEBUG_PROPS (1 << 4) /* deprecated */
|
|
|
|
#define G_FILE_SHOW_FRAMERATE (1 << 5) /* deprecated */
|
2012-10-27 15:05:12 +00:00
|
|
|
/* #define G_FILE_SHOW_PROFILE (1 << 6) */ /* deprecated */
|
2005-08-03 18:48:22 +00:00
|
|
|
#define G_FILE_LOCK (1 << 7)
|
|
|
|
#define G_FILE_SIGN (1 << 8)
|
2012-10-27 15:05:12 +00:00
|
|
|
/* #define G_FILE_PUBLISH (1 << 9) */ /* deprecated */
|
2012-05-12 20:39:39 +00:00
|
|
|
#define G_FILE_NO_UI (1 << 10)
|
2012-10-27 15:05:12 +00:00
|
|
|
/* #define G_FILE_GAME_TO_IPO (1 << 11) */ /* deprecated */
|
2012-05-12 20:39:39 +00:00
|
|
|
#define G_FILE_GAME_MAT (1 << 12) /* deprecated */
|
2012-10-27 15:05:12 +00:00
|
|
|
/* #define G_FILE_DISPLAY_LISTS (1 << 13) */ /* deprecated */
|
2012-05-12 20:39:39 +00:00
|
|
|
#define G_FILE_SHOW_PHYSICS (1 << 14) /* deprecated */
|
|
|
|
#define G_FILE_GAME_MAT_GLSL (1 << 15) /* deprecated */
|
2012-10-27 15:05:12 +00:00
|
|
|
/* #define G_FILE_GLSL_NO_LIGHTS (1 << 16) */ /* deprecated */
|
2012-05-12 20:39:39 +00:00
|
|
|
#define G_FILE_GLSL_NO_SHADERS (1 << 17) /* deprecated */
|
|
|
|
#define G_FILE_GLSL_NO_SHADOWS (1 << 18) /* deprecated */
|
|
|
|
#define G_FILE_GLSL_NO_RAMPS (1 << 19) /* deprecated */
|
|
|
|
#define G_FILE_GLSL_NO_NODES (1 << 20) /* deprecated */
|
|
|
|
#define G_FILE_GLSL_NO_EXTRA_TEX (1 << 21) /* deprecated */
|
|
|
|
#define G_FILE_IGNORE_DEPRECATION_WARNINGS (1 << 22) /* deprecated */
|
|
|
|
#define G_FILE_RECOVER (1 << 23)
|
|
|
|
#define G_FILE_RELATIVE_REMAP (1 << 24)
|
|
|
|
#define G_FILE_HISTORY (1 << 25)
|
|
|
|
#define G_FILE_MESH_COMPAT (1 << 26) /* BMesh option to save as older mesh format */
|
2012-11-07 04:13:03 +00:00
|
|
|
#define G_FILE_SAVE_COPY (1 << 27) /* restore paths after editing them */
|
|
|
|
|
|
|
|
#define G_FILE_FLAGS_RUNTIME (G_FILE_NO_UI | G_FILE_RELATIVE_REMAP | G_FILE_MESH_COMPAT | G_FILE_SAVE_COPY)
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2003-05-08 16:24:58 +00:00
|
|
|
/* G.windowstate */
|
2012-05-12 20:39:39 +00:00
|
|
|
#define G_WINDOWSTATE_USERDEF 0
|
|
|
|
#define G_WINDOWSTATE_BORDER 1
|
|
|
|
#define G_WINDOWSTATE_FULLSCREEN 2
|
2003-05-08 16:24:58 +00:00
|
|
|
|
2008-12-19 19:11:02 +00:00
|
|
|
/* ENDIAN_ORDER: indicates what endianness the platform where the file was
|
2002-10-12 11:37:38 +00:00
|
|
|
* written had. */
|
2012-05-12 20:39:39 +00:00
|
|
|
#if !defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)
|
2011-09-19 08:02:17 +00:00
|
|
|
# error Either __BIG_ENDIAN__ or __LITTLE_ENDIAN__ must be defined.
|
|
|
|
#endif
|
|
|
|
|
2012-04-12 09:10:10 +00:00
|
|
|
/* there is really no good place for this */
|
|
|
|
#if defined(FREE_WINDOWS) && ((__GNUC__ < 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ < 6)))
|
|
|
|
# error "Mingw requires GCC 4.6 minimum"
|
|
|
|
#endif
|
|
|
|
|
2012-05-12 20:39:39 +00:00
|
|
|
#define L_ENDIAN 1
|
|
|
|
#define B_ENDIAN 0
|
2011-09-19 08:02:17 +00:00
|
|
|
|
|
|
|
#ifdef __BIG_ENDIAN__
|
|
|
|
# define ENDIAN_ORDER B_ENDIAN
|
|
|
|
#else
|
|
|
|
# define ENDIAN_ORDER L_ENDIAN
|
|
|
|
#endif
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2005-03-19 20:27:13 +00:00
|
|
|
/* G.moving, signals drawing in (3d) window to denote transform */
|
2012-05-12 20:39:39 +00:00
|
|
|
#define G_TRANSFORM_OBJ 1
|
|
|
|
#define G_TRANSFORM_EDIT 2
|
|
|
|
#define G_TRANSFORM_MANIP 4
|
|
|
|
#define G_TRANSFORM_PARTICLE 8
|
2005-03-19 20:27:13 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
/* G.special1 */
|
|
|
|
|
|
|
|
/* Memory is allocated where? blender.c */
|
|
|
|
extern Global G;
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|