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.
|
|
|
|
*/
|
2013-05-28 16:57:28 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
#include "DNA_listBase.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* forwards */
|
|
|
|
struct Main;
|
|
|
|
|
|
|
|
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
|
|
|
|
2013-05-28 13:01:31 +00:00
|
|
|
/* when set: G.main->name contains valid relative base path */
|
|
|
|
bool relbase_valid;
|
|
|
|
bool file_loaded;
|
|
|
|
bool save_over;
|
2006-08-20 14:41:13 +00:00
|
|
|
|
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 */
|
2013-05-28 13:01:31 +00:00
|
|
|
bool is_break;
|
2012-08-08 18:37:06 +00:00
|
|
|
|
2013-05-28 13:01:31 +00:00
|
|
|
bool background;
|
|
|
|
bool factory_startup;
|
|
|
|
|
|
|
|
short moving;
|
2012-08-08 18:37:06 +00:00
|
|
|
|
|
|
|
/* to indicate render is busy, prevent renderwindow events etc */
|
2014-02-03 18:55:59 +11:00
|
|
|
bool 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
|
|
|
|
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
|
|
|
|
2013-06-10 00:42:16 +00:00
|
|
|
/* message to use when autoexec fails */
|
|
|
|
char autoexec_fail[200];
|
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
|
|
|
|
2012-12-22 14:25:34 +00:00
|
|
|
/* #define G_FACESELECT (1 << 8) use (mesh->editflag & ME_EDIT_PAINT_FACE_SEL) */
|
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 */
|
2013-06-10 00:42:16 +00:00
|
|
|
#define G_SCRIPT_AUTOEXEC_FAIL (1 << 15)
|
|
|
|
#define G_SCRIPT_AUTOEXEC_FAIL_QUIET (1 << 16)
|
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 */
|
2013-01-03 23:27:20 +00:00
|
|
|
G_DEBUG_JOBS = (1 << 6), /* jobs time profiling */
|
|
|
|
G_DEBUG_FREESTYLE = (1 << 7), /* freestyle messages */
|
2018-02-21 10:44:36 +01:00
|
|
|
G_DEBUG_DEPSGRAPH_BUILD = (1 << 8), /* depsgraph construction messages */
|
|
|
|
G_DEBUG_DEPSGRAPH_EVAL = (1 << 9), /* depsgraph evaluation messages */
|
|
|
|
G_DEBUG_DEPSGRAPH_TAG = (1 << 10), /* depsgraph tagging messages */
|
2018-03-12 17:01:02 +01:00
|
|
|
G_DEBUG_DEPSGRAPH_TIME = (1 << 11), /* single threaded depsgraph */
|
|
|
|
G_DEBUG_DEPSGRAPH_NO_THREADS = (1 << 12), /* single threaded depsgraph */
|
|
|
|
G_DEBUG_DEPSGRAPH = (G_DEBUG_DEPSGRAPH_BUILD |
|
|
|
|
G_DEBUG_DEPSGRAPH_EVAL |
|
|
|
|
G_DEBUG_DEPSGRAPH_TAG |
|
|
|
|
G_DEBUG_DEPSGRAPH_TIME),
|
|
|
|
G_DEBUG_SIMDATA = (1 << 13), /* sim debug data display */
|
|
|
|
G_DEBUG_GPU_MEM = (1 << 14), /* gpu memory in status bar */
|
|
|
|
G_DEBUG_GPU = (1 << 15), /* gpu debug */
|
|
|
|
G_DEBUG_IO = (1 << 16), /* IO Debugging (for Collada, ...)*/
|
2012-03-31 00:59:17 +00:00
|
|
|
};
|
|
|
|
|
2013-01-03 23:27:20 +00:00
|
|
|
#define G_DEBUG_ALL (G_DEBUG | G_DEBUG_FFMPEG | G_DEBUG_PYTHON | G_DEBUG_EVENTS | G_DEBUG_WM | G_DEBUG_JOBS | \
|
2016-12-09 17:19:59 +01:00
|
|
|
G_DEBUG_FREESTYLE | G_DEBUG_DEPSGRAPH | G_DEBUG_GPU_MEM | G_DEBUG_IO)
|
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)
|
2015-07-27 10:36:11 +10:00
|
|
|
|
|
|
|
#ifdef DNA_DEPRECATED_ALLOW
|
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 */
|
2015-07-27 10:36:11 +10:00
|
|
|
/* #define G_FILE_LOCK (1 << 7) */ /* deprecated */
|
|
|
|
/* #define G_FILE_SIGN (1 << 8) */ /* deprecated */
|
|
|
|
#endif /* DNA_DEPRECATED_ALLOW */
|
|
|
|
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
#define G_FILE_USERPREFS (1 << 9)
|
2012-05-12 20:39:39 +00:00
|
|
|
#define G_FILE_NO_UI (1 << 10)
|
2015-07-27 10:36:11 +10:00
|
|
|
#ifdef DNA_DEPRECATED_ALLOW
|
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 */
|
2015-07-27 10:36:11 +10:00
|
|
|
#endif /* DNA_DEPRECATED_ALLOW */
|
|
|
|
|
|
|
|
/* On read, use #FileGlobal.filename instead of the real location on-disk,
|
|
|
|
* needed for recovering temp files so relative paths resolve */
|
2012-05-12 20:39:39 +00:00
|
|
|
#define G_FILE_RECOVER (1 << 23)
|
2015-07-27 10:36:11 +10:00
|
|
|
/* On write, remap relative file paths to the new file location. */
|
2012-05-12 20:39:39 +00:00
|
|
|
#define G_FILE_RELATIVE_REMAP (1 << 24)
|
2015-07-27 10:36:11 +10:00
|
|
|
/* On write, make backup `.blend1`, `.blend2` ... files, when the users preference is enabled */
|
2012-05-12 20:39:39 +00:00
|
|
|
#define G_FILE_HISTORY (1 << 25)
|
2015-07-27 10:36:11 +10:00
|
|
|
/* BMesh option to save as older mesh format */
|
|
|
|
#define G_FILE_MESH_COMPAT (1 << 26)
|
2016-01-04 01:25:52 -05:00
|
|
|
/* On write, restore paths after editing them (G_FILE_RELATIVE_REMAP) */
|
2015-07-27 10:36:11 +10:00
|
|
|
#define G_FILE_SAVE_COPY (1 << 27)
|
Environment lighting for the GLSL mode
Environment lighting (aka ambient) is a key component of any renderer.
It's implemented like the Environment lighting of BI render for Approximate Gather mode. It support "Sky Color" and "White" Environment lighting modes.
It would be great if the user could see actual lighting conditions right in the Blender viewport instead of waiting for the renderer to complete the final image, exporting for external renderer or for a game engine.
Before:
{F113921}
After:
{F113922}
Example file: {F319013}
Original author: valentin_b4w
Alexander (Blend4Web Team)
Reviewers: valentin_b4w, campbellbarton, merwin, brecht
Reviewed By: brecht
Subscribers: panzergame, youle, duarteframos, AlexKowel, yurikovelenov, dingto, Evgeny_Rodygin
Projects: #rendering, #opengl_gfx
Differential Revision: https://developer.blender.org/D810
2016-07-04 11:01:32 +03:00
|
|
|
#define G_FILE_GLSL_NO_ENV_LIGHTING (1 << 28)
|
2012-11-07 04:13:03 +00:00
|
|
|
|
|
|
|
#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
|
|
|
|
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-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
|
2013-06-24 22:41:37 +00:00
|
|
|
#define G_TRANSFORM_SEQ 4
|
2013-10-29 18:10:52 +00:00
|
|
|
#define G_TRANSFORM_FCURVES 8
|
2005-03-19 20:27:13 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
/* Memory is allocated where? blender.c */
|
|
|
|
extern Global G;
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|