Blender V5.0
ED_markers.hh File Reference

Go to the source code of this file.

Functions

Backend API
ListBaseED_scene_markers_get (const bContext *C, Scene *scene)
ListBaseED_context_get_markers (const bContext *C)
ListBaseED_sequencer_context_get_markers (const bContext *C)
ListBaseED_scene_markers_get_from_area (Scene *scene, ViewLayer *view_layer, const ScrArea *area)
int ED_markers_post_apply_transform (ListBase *markers, Scene *scene, int mode, float value, char side)
TimeMarkerED_markers_find_nearest_marker (ListBase *markers, float frame)
int ED_markers_find_nearest_marker_time (ListBase *markers, float x)
void ED_markers_get_minmax (ListBase *markers, short sel, float *r_first, float *r_last)
void ED_markers_make_cfra_list (ListBase *markers, ListBase *lb, bool only_selected)
void ED_markers_deselect_all (ListBase *markers, int action)
TimeMarkerED_markers_get_first_selected (ListBase *markers)
bool ED_markers_region_visible (const ScrArea *area, const ARegion *region)
Operators
void ED_operatortypes_marker ()
void ED_keymap_marker (wmKeyConfig *keyconf)
void debug_markers_print_list (ListBase *markers)

Drawing API

enum  { DRAW_MARKERS_LINES = (1 << 0) , DRAW_MARKERS_LOCAL = (1 << 1) , DRAW_MARKERS_MARGIN = (1 << 2) }
void ED_markers_draw (const bContext *C, int flag)

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Flags for drawing markers.

Enumerator
DRAW_MARKERS_LINES 
DRAW_MARKERS_LOCAL 
DRAW_MARKERS_MARGIN 

Definition at line 25 of file ED_markers.hh.

Function Documentation

◆ debug_markers_print_list()

void debug_markers_print_list ( ListBase * markers)

Debugging only: print debugging prints of list of markers.

Definition at line 423 of file anim_markers.cc.

References LISTBASE_FOREACH, and printf.

◆ ED_context_get_markers()

◆ ED_keymap_marker()

void ED_keymap_marker ( wmKeyConfig * keyconf)

Called in screen_ops.cc, ED_keymap_screen().

Definition at line 2081 of file anim_markers.cc.

References RGN_TYPE_WINDOW, SPACE_EMPTY, and WM_keymap_ensure().

Referenced by ED_spacetypes_keymap().

◆ ED_markers_deselect_all()

void ED_markers_deselect_all ( ListBase * markers,
int action )

◆ ED_markers_draw()

void ED_markers_draw ( const bContext * C,
int flag )

Draw Scene-Markers in time window.

Set a temporary bit in the marker's flag to indicate that it should be elevated. This bit will be flipped back at the end of this function.

Draw non-elevated markers first. Note that unlike the elevated markers, these marker names will always be clipped by the proceeding marker. This is done because otherwise, the text overlaps with the icon of the marker itself.

Definition at line 629 of file anim_markers.cc.

References BLI_duplicatelist(), BLI_freelistN(), BLI_listbase_is_empty(), BLI_listbase_sort(), C, RenderData::cfra, CTX_data_scene(), CTX_wm_region(), CTX_wm_space_seq(), draw_marker(), draw_markers_background(), ED_context_get_markers(), ED_sequencer_context_get_markers(), ListBase::first, flag, TimeMarker::flag, TimeMarker::frame, get_marker_clip_frame_range(), get_marker_region_rect(), GPU_line_width(), GPU_matrix_pop(), GPU_matrix_push(), GPU_matrix_scale_2f(), LISTBASE_FOREACH, marker_is_in_frame_range(), markers_frame_sort(), next, TimeMarker::next, Scene::r, SELECT, SET_FLAG_FROM_TEST, UI_FSTYLE_WIDGET, UI_view2d_fromcontext(), UI_view2d_scale_get(), and ARegion::winy.

Referenced by action_main_region_draw(), blender::ed::vse::draw_timeline_markers(), graph_main_region_draw(), and nla_main_region_draw().

◆ ED_markers_find_nearest_marker()

TimeMarker * ED_markers_find_nearest_marker ( ListBase * markers,
float frame )
Returns
the marker that is closest to frame. Non-empty markers is guaranteed to return a marker.
Note
For selecting, the caller is expected to exclude markers beyond a small threshold.

Definition at line 156 of file anim_markers.cc.

References BLI_listbase_is_empty(), fabsf, ListBase::first, TimeMarker::frame, and TimeMarker::next.

Referenced by ed_marker_camera_bind_exec(), ED_markers_find_nearest_marker_time(), and region_position_is_over_marker().

◆ ED_markers_find_nearest_marker_time()

int ED_markers_find_nearest_marker_time ( ListBase * markers,
float x )

◆ ED_markers_get_first_selected()

◆ ED_markers_get_minmax()

void ED_markers_get_minmax ( ListBase * markers,
short sel,
float * r_first,
float * r_last )

◆ ED_markers_make_cfra_list()

void ED_markers_make_cfra_list ( ListBase * markers,
ListBase * lb,
bool only_selected )

This function makes a list of all the markers. The only_sel argument is used to specify whether only the selected markers are added.

Definition at line 315 of file anim_markers.cc.

References add_marker_to_cfra_elem(), ListBase::first, ListBase::last, and LISTBASE_FOREACH.

Referenced by columnselect_action_keys(), columnselect_graph_keys(), and get_selected_marker_positions().

◆ ED_markers_post_apply_transform()

int ED_markers_post_apply_transform ( ListBase * markers,
Scene * scene,
int mode,
float value,
char side )

Apply some transformation to markers after the fact

Parameters
markersList of markers to affect - this may or may not be the scene markers list, so don't assume anything.
sceneCurrent scene (for getting current frame)
mode(TfmMode) transform mode that this transform is for
valueFrom the transform code, this is t->vec[0] (which is delta transform for grab/extend, and scale factor for scale)
side(B/L/R) for 'extend' functionality, which side of current frame to use

Definition at line 115 of file anim_markers.cc.

References RenderData::cfra, float, LISTBASE_FOREACH, ToolSettings::lock_markers, Scene::r, round_fl_to_int(), SELECT, blender::ed::transform::TFM_TIME_EXTEND, blender::ed::transform::TFM_TIME_SCALE, blender::ed::transform::TFM_TIME_TRANSLATE, and Scene::toolsettings.

Referenced by blender::ed::transform::special_aftertrans_update__actedit(), and blender::ed::transform::special_aftertrans_update__sequencer().

◆ ED_markers_region_visible()

◆ ED_operatortypes_marker()

◆ ED_scene_markers_get()

ListBase * ED_scene_markers_get ( const bContext * C,
Scene * scene )

Public API for getting markers from the scene & area.

Returns
A TimeMarker list.

Definition at line 66 of file anim_markers.cc.

References ANIM_animdata_get_context(), C, bAnimContext::markers, and Scene::markers.

Referenced by ED_context_get_markers(), and ED_sequencer_context_get_markers().

◆ ED_scene_markers_get_from_area()

◆ ED_sequencer_context_get_markers()