2011-02-21 07:25:24 +00:00
|
|
|
/*
|
2008-11-24 18:59:59 +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
|
2018-06-01 18:19:39 +02:00
|
|
|
* of the License, or (at your option) any later version.
|
2008-11-24 18:59:59 +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.
|
2008-11-24 18:59:59 +00:00
|
|
|
*
|
|
|
|
|
* The Original Code is Copyright (C) 2008 Blender Foundation.
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*/
|
2011-02-21 07:25:24 +00:00
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
|
* \ingroup editors
|
2011-02-21 07:25:24 +00:00
|
|
|
*/
|
|
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#ifndef __ED_MARKERS_H__
|
|
|
|
|
#define __ED_MARKERS_H__
|
2008-11-24 18:59:59 +00:00
|
|
|
|
2011-03-14 10:45:42 +00:00
|
|
|
struct Scene;
|
2009-05-08 12:51:36 +00:00
|
|
|
struct TimeMarker;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct bAnimContext;
|
|
|
|
|
struct bContext;
|
|
|
|
|
struct wmKeyConfig;
|
|
|
|
|
struct wmKeyMap;
|
2009-05-08 12:51:36 +00:00
|
|
|
|
|
|
|
|
/* Drawing API ------------------------------ */
|
2008-12-23 11:02:39 +00:00
|
|
|
|
2008-11-24 18:59:59 +00:00
|
|
|
/* flags for drawing markers */
|
|
|
|
|
enum {
|
2019-04-17 06:17:24 +02:00
|
|
|
DRAW_MARKERS_LINES = (1 << 0),
|
|
|
|
|
DRAW_MARKERS_LOCAL = (1 << 1),
|
|
|
|
|
DRAW_MARKERS_MARGIN = (1 << 2),
|
2008-11-24 18:59:59 +00:00
|
|
|
};
|
|
|
|
|
|
2014-10-28 19:03:13 +01:00
|
|
|
void ED_markers_draw(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);
|
|
|
|
|
|
2019-04-17 06:17:24 +02:00
|
|
|
int ED_markers_post_apply_transform(
|
|
|
|
|
ListBase *markers, struct Scene *scene, int mode, float value, char side);
|
2011-03-14 10:45:42 +00:00
|
|
|
|
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);
|
|
|
|
|
|
2019-03-07 20:33:57 +11:00
|
|
|
void ED_markers_deselect_all(ListBase *markers, int action);
|
|
|
|
|
|
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() */
|
2018-06-04 09:31:30 +02: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-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__ */
|