2011-02-21 07:25:24 +00:00
|
|
|
/*
|
2.5: work on bringing back SpaceTime options
- RMB select, also with SHIFT
- RMB tweak for translate
- SHIFT+D dupli
- BKEY border select/deselect
- AKEY (de)select all
- XKEY delete
- GKEY grab
Added some XXX comments for future todos, especially for when other
spaces come back with time markers.
Also added ED_util for putting in all to-be-cleaned cruft
Context conflict: input methods for Markers can conflict with other
spacetypes. It was solved in pre-2.5 with manually tweaking it all over,
but I would prefer one keymap for all marker stuff. Needs some thinking...
could be solved with a boundbox check for bottom part of 2d window.
Tweak issue: both tweak styles are possible:
- Hold mouse button, move, operator ends on mouse release
- Hold mouse button, move, operator ends on mouse click
Problem is that modally handled operators use fixed keymaps... like ESC,
SPACE, ENTER, or press/release mousebutton for 'assign'. There's a lot
to say for making this all consistant, or become part of 1 general keymap?
Should also be possibe to define 'tweak' defaults for Tablet different
than for mouse...
2008-11-29 15:10:31 +00:00
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
|
|
|
|
*
|
|
|
|
|
* 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
|
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* 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.
|
2.5: work on bringing back SpaceTime options
- RMB select, also with SHIFT
- RMB tweak for translate
- SHIFT+D dupli
- BKEY border select/deselect
- AKEY (de)select all
- XKEY delete
- GKEY grab
Added some XXX comments for future todos, especially for when other
spaces come back with time markers.
Also added ED_util for putting in all to-be-cleaned cruft
Context conflict: input methods for Markers can conflict with other
spacetypes. It was solved in pre-2.5 with manually tweaking it all over,
but I would prefer one keymap for all marker stuff. Needs some thinking...
could be solved with a boundbox check for bottom part of 2d window.
Tweak issue: both tweak styles are possible:
- Hold mouse button, move, operator ends on mouse release
- Hold mouse button, move, operator ends on mouse click
Problem is that modally handled operators use fixed keymaps... like ESC,
SPACE, ENTER, or press/release mousebutton for 'assign'. There's a lot
to say for making this all consistant, or become part of 1 general keymap?
Should also be possibe to define 'tweak' defaults for Tablet different
than for mouse...
2008-11-29 15:10:31 +00:00
|
|
|
*
|
|
|
|
|
* The Original Code is Copyright (C) 2008 Blender Foundation.
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* Contributor(s): Blender Foundation
|
|
|
|
|
*
|
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
|
*/
|
2011-02-21 07:25:24 +00:00
|
|
|
|
|
|
|
|
/** \file ED_util.h
|
|
|
|
|
* \ingroup editors
|
|
|
|
|
*/
|
|
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#ifndef __ED_UTIL_H__
|
|
|
|
|
#define __ED_UTIL_H__
|
2.5: work on bringing back SpaceTime options
- RMB select, also with SHIFT
- RMB tweak for translate
- SHIFT+D dupli
- BKEY border select/deselect
- AKEY (de)select all
- XKEY delete
- GKEY grab
Added some XXX comments for future todos, especially for when other
spaces come back with time markers.
Also added ED_util for putting in all to-be-cleaned cruft
Context conflict: input methods for Markers can conflict with other
spacetypes. It was solved in pre-2.5 with manually tweaking it all over,
but I would prefer one keymap for all marker stuff. Needs some thinking...
could be solved with a boundbox check for bottom part of 2d window.
Tweak issue: both tweak styles are possible:
- Hold mouse button, move, operator ends on mouse release
- Hold mouse button, move, operator ends on mouse click
Problem is that modally handled operators use fixed keymaps... like ESC,
SPACE, ENTER, or press/release mousebutton for 'assign'. There's a lot
to say for making this all consistant, or become part of 1 general keymap?
Should also be possibe to define 'tweak' defaults for Tablet different
than for mouse...
2008-11-29 15:10:31 +00:00
|
|
|
|
2008-12-30 19:01:12 +00:00
|
|
|
struct bContext;
|
2016-02-18 19:32:33 +11:00
|
|
|
struct SpaceLink;
|
2009-01-31 19:40:40 +00:00
|
|
|
struct wmOperator;
|
2008-12-31 18:52:15 +00:00
|
|
|
struct wmOperatorType;
|
2008-12-30 19:01:12 +00:00
|
|
|
|
2008-12-31 17:11:42 +00:00
|
|
|
/* ed_util.c */
|
|
|
|
|
|
2012-05-12 20:39:39 +00:00
|
|
|
void ED_editors_init(struct bContext *C);
|
|
|
|
|
void ED_editors_exit(struct bContext *C);
|
2008-12-31 17:11:42 +00:00
|
|
|
|
2014-10-10 11:48:48 +02:00
|
|
|
bool ED_editors_flush_edits(const struct bContext *C, bool for_render);
|
2014-01-20 14:11:12 +01:00
|
|
|
|
ID-Remap - Step one: core work (cleanup and rework of generic ID datablock handling).
This commit changes a lot of how IDs are handled internally, especially the unlinking/freeing
processes. So far, this was very fuzy, to summarize cleanly deleting or replacing a datablock
was pretty much impossible, except for a few special cases.
Also, unlinking was handled by each datatype, in a rather messy and prone-to-errors way (quite
a few ID usages were missed or wrongly handled that way).
One of the main goal of id-remap branch was to cleanup this, and fatorize ID links handling
by using library_query utils to allow generic handling of those, which is now the case
(now, generic ID links handling is only "knwon" from readfile.c and library_query.c).
This commit also adds backends to allow live replacement and deletion of datablocks in Blender
(so-called 'remapping' process, where we replace all usages of a given ID pointer by a new one,
or NULL one in case of unlinking).
This will allow nice new features, like ability to easily reload or relocate libraries, real immediate
deletion of datablocks in blender, replacement of one datablock by another, etc.
Some of those are for next commits.
A word of warning: this commit is highly risky, because it affects potentially a lot in Blender core.
Though it was tested rather deeply, being totally impossible to check all possible ID usage cases,
it's likely there are some remaining issues and bugs in new code... Please report them! ;)
Review task: D2027 (https://developer.blender.org/D2027).
Reviewed by campbellbarton, thanks a bunch.
2016-06-22 17:29:38 +02:00
|
|
|
void ED_spacedata_id_remap(struct ScrArea *sa, struct SpaceLink *sl, struct ID *old_id, struct ID *new_id);
|
2015-05-04 15:07:24 +10:00
|
|
|
|
2015-12-03 20:18:32 +11:00
|
|
|
void ED_OT_flush_edits(struct wmOperatorType *ot);
|
|
|
|
|
|
2008-12-30 19:01:12 +00:00
|
|
|
/* ************** Undo ************************ */
|
|
|
|
|
|
|
|
|
|
/* undo.c */
|
2012-05-12 20:39:39 +00:00
|
|
|
void ED_undo_push(struct bContext *C, const char *str);
|
|
|
|
|
void ED_undo_push_op(struct bContext *C, struct wmOperator *op);
|
Implement grouped undo option for operators
This option makes an operator to not push a task to the undo stack if the previous stored elemen is the same operator or part of the same undo group.
The main usage is for animation, so you can change frames to inspect the
poses, and revert the previous pose without having to roll back tons of
"change frame" operator, or even see the undo stack full.
This complements rB13ee9b8e
Design with help by Sergey Sharybin.
Reviewers: sergey, mont29
Reviewed By: mont29, sergey
Subscribers: pyc0d3r, hjalti, Severin, lowercase, brecht, monio, aligorith, hadrien, jbakker
Differential Revision: https://developer.blender.org/D2330
2016-11-15 11:50:11 +01:00
|
|
|
void ED_undo_grouped_push(struct bContext *C, const char *str);
|
|
|
|
|
void ED_undo_grouped_push_op(struct bContext *C, struct wmOperator *op);
|
2012-05-12 20:39:39 +00:00
|
|
|
void ED_undo_pop_op(struct bContext *C, struct wmOperator *op);
|
|
|
|
|
void ED_undo_pop(struct bContext *C);
|
|
|
|
|
void ED_undo_redo(struct bContext *C);
|
|
|
|
|
void ED_OT_undo(struct wmOperatorType *ot);
|
|
|
|
|
void ED_OT_undo_push(struct wmOperatorType *ot);
|
|
|
|
|
void ED_OT_redo(struct wmOperatorType *ot);
|
|
|
|
|
void ED_OT_undo_history(struct wmOperatorType *ot);
|
|
|
|
|
|
|
|
|
|
int ED_undo_operator_repeat(struct bContext *C, struct wmOperator *op);
|
|
|
|
|
/* convenience since UI callbacks use this mostly*/
|
|
|
|
|
void ED_undo_operator_repeat_cb(struct bContext *C, void *arg_op, void *arg_unused);
|
|
|
|
|
void ED_undo_operator_repeat_cb_evt(struct bContext *C, void *arg_op, int arg_unused);
|
|
|
|
|
|
2015-04-18 15:41:12 +02:00
|
|
|
bool ED_undo_is_valid(const struct bContext *C, const char *undoname);
|
2011-01-12 18:00:23 +00:00
|
|
|
|
2008-12-30 19:01:12 +00:00
|
|
|
/* undo_editmode.c */
|
2010-11-17 09:45:45 +00:00
|
|
|
void undo_editmode_push(struct bContext *C, const char *name,
|
2012-05-12 20:39:39 +00:00
|
|
|
void * (*getdata)(struct bContext *C),
|
|
|
|
|
void (*freedata)(void *),
|
|
|
|
|
void (*to_editmode)(void *, void *, void *),
|
|
|
|
|
void *(*from_editmode)(void *, void *),
|
|
|
|
|
int (*validate_undo)(void *, void *));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void undo_editmode_clear(void);
|
2008-12-30 19:01:12 +00:00
|
|
|
|
2008-12-10 17:58:18 +00:00
|
|
|
/* ************** XXX OLD CRUFT WARNING ************* */
|
|
|
|
|
|
2008-12-19 19:11:02 +00:00
|
|
|
void apply_keyb_grid(int shift, int ctrl, float *val, float fac1, float fac2, float fac3, int invert);
|
2008-12-10 17:58:18 +00:00
|
|
|
|
2011-01-26 14:18:16 +00:00
|
|
|
/* where else to go ? */
|
|
|
|
|
void unpack_menu(struct bContext *C, const char *opname, const char *id_name, const char *abs_name, const char *folder, struct PackedFile *pf);
|
2008-12-10 17:58:18 +00:00
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#endif /* __ED_UTIL_H__ */
|
2.5: work on bringing back SpaceTime options
- RMB select, also with SHIFT
- RMB tweak for translate
- SHIFT+D dupli
- BKEY border select/deselect
- AKEY (de)select all
- XKEY delete
- GKEY grab
Added some XXX comments for future todos, especially for when other
spaces come back with time markers.
Also added ED_util for putting in all to-be-cleaned cruft
Context conflict: input methods for Markers can conflict with other
spacetypes. It was solved in pre-2.5 with manually tweaking it all over,
but I would prefer one keymap for all marker stuff. Needs some thinking...
could be solved with a boundbox check for bottom part of 2d window.
Tweak issue: both tweak styles are possible:
- Hold mouse button, move, operator ends on mouse release
- Hold mouse button, move, operator ends on mouse click
Problem is that modally handled operators use fixed keymaps... like ESC,
SPACE, ENTER, or press/release mousebutton for 'assign'. There's a lot
to say for making this all consistant, or become part of 1 general keymap?
Should also be possibe to define 'tweak' defaults for Tablet different
than for mouse...
2008-11-29 15:10:31 +00:00
|
|
|
|