This repository has been archived on 2023-10-09. You can view files and clone it, but cannot push or open issues or pull requests.
Files
blender-archive/source/blender/editors/include/ED_markers.h

80 lines
2.3 KiB
C++
Raw Normal View History

2011-02-21 07:25:24 +00:00
/*
2010-03-21 01:14:04 +00:00
* $Id$
*
* ***** 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.
*
* 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
*/
#ifndef ED_MARKERS_H
#define ED_MARKERS_H
struct wmKeyConfig;
struct bContext;
struct bAnimContext;
struct Scene;
struct TimeMarker;
/* Drawing API ------------------------------ */
/* flags for drawing markers */
enum {
DRAW_MARKERS_LINES = (1<<0),
DRAW_MARKERS_LOCAL = (1<<1)
};
void draw_markers_time(const struct bContext *C, int flag);
/* Backend API ----------------------------- */
ListBase *ED_context_get_markers(const struct bContext *C);
ListBase *ED_animcontext_get_markers(const struct bAnimContext *ac);
int ED_markers_post_apply_transform(ListBase *markers, struct Scene *scene, int mode, float value, char side);
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);
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
/* Operators ------------------------------ */
/* called in screen_ops.c:ED_operatortypes_screen() */
void ED_operatortypes_marker(void);
/* called in screen_ops.c:ED_keymap_screen() */
void ED_marker_keymap(struct wmKeyConfig *keyconf);
/* debugging only */
void debug_markers_print_list(struct ListBase *markers);
#endif /* ED_MARKERS_H */