2011-02-21 07:25:24 +00:00
|
|
|
/*
|
2008-11-24 18:59:59 +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.
|
2008-11-24 18:59:59 +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_markers.h
|
|
|
|
|
* \ingroup editors
|
|
|
|
|
*/
|
|
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#ifndef __ED_MARKERS_H__
|
|
|
|
|
#define __ED_MARKERS_H__
|
2008-11-24 18:59:59 +00:00
|
|
|
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
struct wmKeyConfig;
|
2011-06-01 11:55:28 +00:00
|
|
|
struct wmKeyMap;
|
2009-05-08 12:51:36 +00:00
|
|
|
struct bContext;
|
2011-01-10 22:31:34 +00:00
|
|
|
struct bAnimContext;
|
2011-03-14 10:45:42 +00:00
|
|
|
struct Scene;
|
2009-05-08 12:51:36 +00:00
|
|
|
struct TimeMarker;
|
|
|
|
|
|
|
|
|
|
/* Drawing API ------------------------------ */
|
2008-12-23 11:02:39 +00:00
|
|
|
|
2008-11-24 18:59:59 +00:00
|
|
|
/* flags for drawing markers */
|
|
|
|
|
enum {
|
2012-05-12 20:39:39 +00:00
|
|
|
DRAW_MARKERS_LINES = (1 << 0),
|
|
|
|
|
DRAW_MARKERS_LOCAL = (1 << 1)
|
2008-11-24 18:59:59 +00:00
|
|
|
};
|
|
|
|
|
|
2008-12-23 11:02:39 +00:00
|
|
|
void draw_markers_time(const struct bContext *C, int flag);
|
2009-05-08 12:51:36 +00:00
|
|
|
|
|
|
|
|
/* Backend API ----------------------------- */
|
|
|
|
|
|
2011-01-10 22:31:34 +00:00
|
|
|
ListBase *ED_context_get_markers(const struct bContext *C);
|
|
|
|
|
ListBase *ED_animcontext_get_markers(const struct bAnimContext *ac);
|
|
|
|
|
|
2011-03-14 10:45:42 +00:00
|
|
|
int ED_markers_post_apply_transform(ListBase *markers, struct Scene *scene, int mode, float value, char side);
|
|
|
|
|
|
2009-05-08 12:51:36 +00:00
|
|
|
struct TimeMarker *ED_markers_find_nearest_marker(ListBase *markers, float x);
|
|
|
|
|
int ED_markers_find_nearest_marker_time(ListBase *markers, float x);
|
|
|
|
|
|
|
|
|
|
void ED_markers_get_minmax(ListBase *markers, short sel, float *first, float *last);
|
|
|
|
|
|
|
|
|
|
void ED_markers_make_cfra_list(ListBase *markers, ListBase *lb, short sel);
|
|
|
|
|
|
2011-01-06 03:10:41 +00:00
|
|
|
struct TimeMarker *ED_markers_get_first_selected(ListBase *markers);
|
== Long-Standing 2.5 Todo - Markers fully working again in all
animation editors (DopeSheet, Graph Editor, NLA, Sequencer) ==
=== Usage Notes ===
In animation editors, marker operators will only be considered while
the mouse is hovering near/over the horizontal scrollbar (i.e. where
the markers usually appear). That means, in order to do something to
the markers, just position your cursor in line with the row of
markers, and then use the same hotkeys you'd use in the TimeLine (so,
unlike in 2.4x, no more need to hold down extra modifier keys for this
case). In the TimeLine, nothing changes, so you don't need to worry
about mouse placement there :)
=== Technical Details ===
Since early 2.5 versions, this functionality has been disabled, as the
markers were always getting evaluated first, and hence "swallowing"
all the events before the editor's own keymaps could access them.
In order to get this working again, I've had to give every marker
operator a "wrapper" invoke callback which performs some checking to
ensure that the mouse is close to the markers (vertically) before the
operator will try to be run. This wrapper also makes sure that once
the operator has finished running, that if it didn't manage to do
anything, then the editor's own keymaps get to have a go.
The vertical tolerance used is currently 30 pixels (as was used for
the borderselect operator).
=== Other Assorted Changes ===
* Gave marker operators dependent on having selected markers to
operate on suitable poll() callbacks. These new poll callbacks ensure
that there are selected markers for the operator to operate on,
further cutting down the number of places where markers may override
standard hotkeys (and avoiding calls to the wrappers too)
* Simplified some of the selection code
* Made some formatting tweaks for consistency, and in one case so that
my text editor's function-list display doesn't get confused
2011-01-06 02:35:12 +00:00
|
|
|
|
2009-05-08 12:51:36 +00:00
|
|
|
/* Operators ------------------------------ */
|
2008-11-24 18:59:59 +00:00
|
|
|
|
2008-12-17 15:38:40 +00:00
|
|
|
/* called in screen_ops.c:ED_operatortypes_screen() */
|
2009-07-02 19:41:31 +00:00
|
|
|
void ED_operatortypes_marker(void);
|
2008-12-17 15:38:40 +00:00
|
|
|
/* called in screen_ops.c:ED_keymap_screen() */
|
2014-03-16 22:11:14 +11:00
|
|
|
void ED_keymap_marker(struct wmKeyConfig *keyconf);
|
2008-11-24 18:59:59 +00:00
|
|
|
|
2011-06-01 06:26:54 +00:00
|
|
|
/* called in animation editors - keymap defines */
|
|
|
|
|
void ED_marker_keymap_animedit_conflictfree(struct wmKeyMap *keymap);
|
|
|
|
|
|
2011-02-14 03:15:55 +00:00
|
|
|
/* debugging only */
|
|
|
|
|
void debug_markers_print_list(struct ListBase *markers);
|
2009-01-14 16:37:52 +00:00
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#endif /* __ED_MARKERS_H__ */
|