2011-02-18 13:05:18 +00:00
|
|
|
/*
|
2002-10-12 11:37:38 +00:00
|
|
|
* $Id$
|
|
|
|
|
*
|
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
|
|
|
*/
|
|
|
|
|
#ifndef BKE_BLENDER_H
|
|
|
|
|
#define BKE_BLENDER_H
|
|
|
|
|
|
2011-02-18 13:05:18 +00:00
|
|
|
/** \file BKE_blender.h
|
|
|
|
|
* \ingroup bke
|
|
|
|
|
* \since March 2001
|
|
|
|
|
* \author nzc
|
|
|
|
|
* \brief Blender util stuff
|
|
|
|
|
*/
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2011-02-21 04:45:47 +00:00
|
|
|
/* these lines are grep'd, watch out for our not-so-awesome regex
|
|
|
|
|
* and keep comment above the defines.
|
|
|
|
|
* Use STRINGIFY() rather then defining with quotes */
|
|
|
|
|
#define BLENDER_VERSION 256
|
2011-02-21 13:47:49 +00:00
|
|
|
#define BLENDER_SUBVERSION 2
|
2011-02-21 04:45:47 +00:00
|
|
|
|
|
|
|
|
#define BLENDER_MINVERSION 250
|
|
|
|
|
#define BLENDER_MINSUBVERSION 0
|
|
|
|
|
|
|
|
|
|
/* used by packaging tools */
|
|
|
|
|
/* can be left blank, otherwise a,b,c... etc with no quotes */
|
|
|
|
|
#define BLENDER_VERSION_CHAR a
|
|
|
|
|
/* alpha/beta/rc/releases */
|
|
|
|
|
#define BLENDER_VERSION_CYCLE beta
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
struct ListBase;
|
2004-09-05 13:43:51 +00:00
|
|
|
struct MemFile;
|
2007-12-24 18:38:03 +00:00
|
|
|
struct bContext;
|
2008-12-29 13:38:08 +00:00
|
|
|
struct ReportList;
|
2010-02-15 18:36:06 +00:00
|
|
|
struct Scene;
|
|
|
|
|
struct Main;
|
2010-07-14 14:11:03 +00:00
|
|
|
|
2010-11-17 09:45:45 +00:00
|
|
|
int BKE_read_file(struct bContext *C, const char *filepath, struct ReportList *reports);
|
2006-11-26 21:17:15 +00:00
|
|
|
|
2011-01-07 06:50:29 +00:00
|
|
|
#define BKE_READ_FILE_FAIL 0 /* no load */
|
|
|
|
|
#define BKE_READ_FILE_OK 1 /* OK */
|
|
|
|
|
#define BKE_READ_FILE_OK_USERPREFS 2 /* OK, and with new user settings */
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2010-10-16 02:40:31 +00:00
|
|
|
int BKE_read_file_from_memory(struct bContext *C, char* filebuf, int filelength, struct ReportList *reports);
|
2008-12-29 13:38:08 +00:00
|
|
|
int BKE_read_file_from_memfile(struct bContext *C, struct MemFile *memfile, struct ReportList *reports);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
void free_blender(void);
|
|
|
|
|
void initglobals(void);
|
|
|
|
|
|
2009-04-30 16:44:00 +00:00
|
|
|
/* load new userdef from file, exit blender */
|
|
|
|
|
void BKE_userdef_free(void);
|
|
|
|
|
|
2008-12-30 13:16:14 +00:00
|
|
|
/* set this callback when a UI is running */
|
|
|
|
|
void set_blender_test_break_cb(void (*func)(void) );
|
|
|
|
|
int blender_test_break(void);
|
|
|
|
|
|
Another step in the undo evolution.
- Made unified API for undo calls, to be found in space.c
BIF_undo_push(char *str)
BIF_undo(void)
BIF_redo(void)
These calls will do all undo levels, including editmode and vpaint.
The transition is work in progress, because mesh undo needs recode.
- New global hotkey CTR+Z for undo
Note: 'shaded draw mode' still is SHIFT+Z, the old CTRL+Z was to recalc
the lighting in shaded mode, which already became much more interactive,
like during/after any transform().
Recalc hotkey now is SHIFT+ALT+Z
CTRL+<any modifier>+Z is redo.
- For OSX users; the Apple-key ("Command") now maps to CTRL as well. This
disables the one-mouse-button hack for rightmouse btw, will be fixed in
next commit. At least we can use Apple-Z :)
- Old Ukey for undo is still there, as a training period... my preference is
to restore Ukey to "reload original data" as in past, and only use new
CTRL+Z for undo.
- Added undo_push() for all of editobject.c and editview.c. Meaning we can
start using/testing global undo in the 3d window. Please dont comment on
missing parts for now, first I want someone to volunteer to tackle all of
that.
- Since the global undo has a full 'file' in memory, it can save extremely
fast on exit to <temp dir>/quit.blend. That's default now when global undo
is enabled. It prints "Saved session recovery to ..." in console then.
- In file menu, a new option is added "Recover Last Session". Note that this
reads the undo-save, which is without UI.
- With such nice new features we then can also kill the disputed
Cancel/Confirm menu on Q-KEY.
- Added fix which initializes seam/normal theme color on saved themes.
They showed black now.... (Note: that's in usiblender.c!)
2004-09-18 12:12:45 +00:00
|
|
|
/* global undo */
|
2010-11-17 09:45:45 +00:00
|
|
|
extern void BKE_write_undo(struct bContext *C, const char *name);
|
2007-12-24 18:38:03 +00:00
|
|
|
extern void BKE_undo_step(struct bContext *C, int step);
|
2.5
Operator goodies!
--- Macro operators
Operators now can consist of multiple operators. Such a macro operator
is identical and behaves identical to other opererators. Macros can
also be constructed of macros even! Currently only hardcoded macros are
implemented, this to solve combined operators such as 'add duplicate' or
'extrude' (both want a transform appended).
Usage is simple:
- WM_operatortype_append_macro() : add new operatortype, name, flags
- WM_operatortype_macro_define() : add existing operator to macro
(Note: macro_define will also allow properties to be set, doesnt work
right now)
On converting the macro wmOperatorType to a real operator, it makes a
list of all operators, and the standard macro callbacks (exec, invoke,
modal, poll) just will use all.
Important note; switching to a modal operator only works as last in the
chain now!
Macros implemented for duplicate, extrude and rip. Tool menu works fine
for it, also the redo hotkey F4 works properly.
--- Operator redo fix
The operators use the undo system to switch back, but this could give
errors if other actions added undo pushes (buttons, outliner). Now the
redo for operator searches back for the correct undo level.
This fixes issues with many redos.
Note for brecht: removed the ED_undo_push for buttons... it was called
on *every* button now, which is probably too much? For example, using
the 'toolbar' redo also caused this...
2009-07-29 17:56:38 +00:00
|
|
|
extern void BKE_undo_name(struct bContext *C, const char *name);
|
2011-01-12 18:00:23 +00:00
|
|
|
extern int BKE_undo_valid(const char *name);
|
2004-11-07 16:49:46 +00:00
|
|
|
extern void BKE_reset_undo(void);
|
|
|
|
|
extern char *BKE_undo_menu_string(void);
|
2007-12-24 18:38:03 +00:00
|
|
|
extern void BKE_undo_number(struct bContext *C, int nr);
|
2009-08-06 14:03:43 +00:00
|
|
|
void BKE_undo_save(char *fname);
|
2004-11-07 16:49:46 +00:00
|
|
|
extern void BKE_undo_save_quit(void);
|
2010-02-15 18:36:06 +00:00
|
|
|
extern struct Main *BKE_undo_get_main(struct Scene **scene);
|
Another step in the undo evolution.
- Made unified API for undo calls, to be found in space.c
BIF_undo_push(char *str)
BIF_undo(void)
BIF_redo(void)
These calls will do all undo levels, including editmode and vpaint.
The transition is work in progress, because mesh undo needs recode.
- New global hotkey CTR+Z for undo
Note: 'shaded draw mode' still is SHIFT+Z, the old CTRL+Z was to recalc
the lighting in shaded mode, which already became much more interactive,
like during/after any transform().
Recalc hotkey now is SHIFT+ALT+Z
CTRL+<any modifier>+Z is redo.
- For OSX users; the Apple-key ("Command") now maps to CTRL as well. This
disables the one-mouse-button hack for rightmouse btw, will be fixed in
next commit. At least we can use Apple-Z :)
- Old Ukey for undo is still there, as a training period... my preference is
to restore Ukey to "reload original data" as in past, and only use new
CTRL+Z for undo.
- Added undo_push() for all of editobject.c and editview.c. Meaning we can
start using/testing global undo in the 3d window. Please dont comment on
missing parts for now, first I want someone to volunteer to tackle all of
that.
- Since the global undo has a full 'file' in memory, it can save extremely
fast on exit to <temp dir>/quit.blend. That's default now when global undo
is enabled. It prints "Saved session recovery to ..." in console then.
- In file menu, a new option is added "Recover Last Session". Note that this
reads the undo-save, which is without UI.
- With such nice new features we then can also kill the disputed
Cancel/Confirm menu on Q-KEY.
- Added fix which initializes seam/normal theme color on saved themes.
They showed black now.... (Note: that's in usiblender.c!)
2004-09-18 12:12:45 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif
|
2002-10-30 02:07:20 +00:00
|
|
|
|