Blender  V2.93
Classes | Typedefs | Functions
anim_markers.c File Reference
#include <math.h>
#include "MEM_guardedalloc.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BLT_translation.h"
#include "BKE_context.h"
#include "BKE_fcurve.h"
#include "BKE_idprop.h"
#include "BKE_layer.h"
#include "BKE_main.h"
#include "BKE_report.h"
#include "BKE_scene.h"
#include "BKE_screen.h"
#include "BKE_unit.h"
#include "RNA_access.h"
#include "RNA_define.h"
#include "RNA_enum_types.h"
#include "WM_api.h"
#include "WM_types.h"
#include "GPU_immediate.h"
#include "GPU_matrix.h"
#include "GPU_state.h"
#include "UI_interface.h"
#include "UI_interface_icons.h"
#include "UI_resources.h"
#include "UI_view2d.h"
#include "ED_anim_api.h"
#include "ED_markers.h"
#include "ED_numinput.h"
#include "ED_object.h"
#include "ED_screen.h"
#include "ED_select_utils.h"
#include "ED_transform.h"
#include "ED_types.h"
#include "ED_util.h"
#include "DEG_depsgraph.h"

Go to the source code of this file.

Classes

struct  MarkerMove
 

Typedefs

typedef struct MarkerMove MarkerMove
 

Functions

static ListBasecontext_get_markers (Scene *scene, ScrArea *area)
 
ListBaseED_context_get_markers (const bContext *C)
 
ListBaseED_animcontext_get_markers (const bAnimContext *ac)
 
int ED_markers_post_apply_transform (ListBase *markers, Scene *scene, int mode, float value, char side)
 
TimeMarkerED_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 *r_first, float *r_last)
 
static bool ED_operator_markers_region_active (bContext *C)
 
static bool region_position_is_over_marker (View2D *v2d, ListBase *markers, float region_x)
 
static void add_marker_to_cfra_elem (ListBase *lb, TimeMarker *marker, short only_sel)
 
void ED_markers_make_cfra_list (ListBase *markers, ListBase *lb, short only_sel)
 
void ED_markers_deselect_all (ListBase *markers, int action)
 
TimeMarkerED_markers_get_first_selected (ListBase *markers)
 
void debug_markers_print_list (ListBase *markers)
 
static void marker_color_get (const TimeMarker *marker, uchar *r_text_color, uchar *r_line_color)
 
static void draw_marker_name (const uchar *text_color, const uiFontStyle *fstyle, TimeMarker *marker, float marker_x, float text_y)
 
static void draw_marker_line (const uchar *color, int xpos, int ymin, int ymax)
 
static int marker_get_icon_id (TimeMarker *marker, int flag)
 
static void draw_marker (const uiFontStyle *fstyle, TimeMarker *marker, int cfra, int xpos, int flag, int region_height)
 
static void draw_markers_background (rctf *rect)
 
static bool marker_is_in_frame_range (TimeMarker *marker, const int frame_range[2])
 
static void get_marker_region_rect (View2D *v2d, rctf *rect)
 
static void get_marker_clip_frame_range (View2D *v2d, float xscale, int r_range[2])
 
void ED_markers_draw (const bContext *C, int flag)
 
static bool ed_markers_poll_selected_markers (bContext *C)
 
static bool ed_markers_poll_selected_no_locked_markers (bContext *C)
 
static bool ed_markers_poll_markers_exist (bContext *C)
 
static int ed_marker_add_exec (bContext *C, wmOperator *UNUSED(op))
 
static void MARKER_OT_add (wmOperatorType *ot)
 
static bool ed_marker_move_use_time (MarkerMove *mm)
 
static void ed_marker_move_update_header (bContext *C, wmOperator *op)
 
static bool ed_marker_move_init (bContext *C, wmOperator *op)
 
static void ed_marker_move_exit (bContext *C, wmOperator *op)
 
static int ed_marker_move_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static void ed_marker_move_apply (bContext *C, wmOperator *op)
 
static void ed_marker_move_cancel (bContext *C, wmOperator *op)
 
static int ed_marker_move_modal (bContext *C, wmOperator *op, const wmEvent *event)
 
static int ed_marker_move_exec (bContext *C, wmOperator *op)
 
static void MARKER_OT_move (wmOperatorType *ot)
 
static void ed_marker_duplicate_apply (bContext *C)
 
static int ed_marker_duplicate_exec (bContext *C, wmOperator *op)
 
static int ed_marker_duplicate_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static void MARKER_OT_duplicate (wmOperatorType *ot)
 
static void deselect_markers (ListBase *markers)
 
static int select_timeline_marker_frame (ListBase *markers, int frame, bool extend, bool wait_to_deselect_others)
 
static void select_marker_camera_switch (bContext *C, bool camera, bool extend, ListBase *markers, int cfra)
 
static int ed_marker_select (bContext *C, const int mval[2], bool extend, bool camera, bool wait_to_deselect_others)
 
static int ed_marker_select_exec (bContext *C, wmOperator *op)
 
static void MARKER_OT_select (wmOperatorType *ot)
 
static int ed_marker_box_select_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static int ed_marker_box_select_exec (bContext *C, wmOperator *op)
 
static void MARKER_OT_select_box (wmOperatorType *ot)
 
static int ed_marker_select_all_exec (bContext *C, wmOperator *op)
 
static void MARKER_OT_select_all (wmOperatorType *ot)
 
static int ed_marker_delete_exec (bContext *C, wmOperator *UNUSED(op))
 
static void MARKER_OT_delete (wmOperatorType *ot)
 
static int ed_marker_rename_exec (bContext *C, wmOperator *op)
 
static int ed_marker_rename_invoke (bContext *C, wmOperator *op, const wmEvent *event)
 
static void MARKER_OT_rename (wmOperatorType *ot)
 
static int ed_marker_make_links_scene_exec (bContext *C, wmOperator *op)
 
static void MARKER_OT_make_links_scene (wmOperatorType *ot)
 
void ED_operatortypes_marker (void)
 
void ED_keymap_marker (wmKeyConfig *keyconf)
 

Typedef Documentation

◆ MarkerMove

typedef struct MarkerMove MarkerMove

Function Documentation

◆ add_marker_to_cfra_elem()

static void add_marker_to_cfra_elem ( ListBase lb,
TimeMarker marker,
short  only_sel 
)
static

◆ context_get_markers()

static ListBase* context_get_markers ( Scene scene,
ScrArea area 
)
static

◆ debug_markers_print_list()

void debug_markers_print_list ( ListBase markers)

◆ deselect_markers()

static void deselect_markers ( ListBase markers)
static

Definition at line 1156 of file anim_markers.c.

References LISTBASE_FOREACH, markers, and SELECT.

Referenced by ed_marker_select(), and select_timeline_marker_frame().

◆ draw_marker()

static void draw_marker ( const uiFontStyle fstyle,
TimeMarker marker,
int  cfra,
int  xpos,
int  flag,
int  region_height 
)
static

◆ draw_marker_line()

static void draw_marker_line ( const uchar color,
int  xpos,
int  ymin,
int  ymax 
)
static

◆ draw_marker_name()

static void draw_marker_name ( const uchar text_color,
const uiFontStyle fstyle,
TimeMarker marker,
float  marker_x,
float  text_y 
)
static

◆ draw_markers_background()

static void draw_markers_background ( rctf rect)
static

◆ ED_animcontext_get_markers()

ListBase* ED_animcontext_get_markers ( const bAnimContext ac)

Definition at line 109 of file anim_markers.c.

References bAnimContext::area, context_get_markers(), NULL, and bAnimContext::scene.

Referenced by actkeys_select_leftright().

◆ ED_context_get_markers()

ListBase* ED_context_get_markers ( const bContext C)

◆ ED_keymap_marker()

void ED_keymap_marker ( wmKeyConfig keyconf)

Definition at line 1718 of file anim_markers.c.

References WM_keymap_ensure().

Referenced by ED_spacetypes_keymap().

◆ ed_marker_add_exec()

static int ed_marker_add_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ ed_marker_box_select_exec()

static int ed_marker_box_select_exec ( bContext C,
wmOperator op 
)
static

◆ ed_marker_box_select_invoke()

static int ed_marker_box_select_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ ed_marker_delete_exec()

static int ed_marker_delete_exec ( bContext C,
wmOperator UNUSEDop 
)
static

◆ ed_marker_duplicate_apply()

static void ed_marker_duplicate_apply ( bContext C)
static

◆ ed_marker_duplicate_exec()

static int ed_marker_duplicate_exec ( bContext C,
wmOperator op 
)
static

Definition at line 1119 of file anim_markers.c.

References C, ed_marker_duplicate_apply(), ed_marker_move_exec(), and OPERATOR_FINISHED.

Referenced by MARKER_OT_duplicate().

◆ ed_marker_duplicate_invoke()

static int ed_marker_duplicate_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

Definition at line 1127 of file anim_markers.c.

References C, ed_marker_duplicate_apply(), and ed_marker_move_invoke().

Referenced by MARKER_OT_duplicate().

◆ ed_marker_make_links_scene_exec()

static int ed_marker_make_links_scene_exec ( bContext C,
wmOperator op 
)
static

◆ ed_marker_move_apply()

static void ed_marker_move_apply ( bContext C,
wmOperator op 
)
static

◆ ed_marker_move_cancel()

static void ed_marker_move_cancel ( bContext C,
wmOperator op 
)
static

◆ ed_marker_move_exec()

static int ed_marker_move_exec ( bContext C,
wmOperator op 
)
static

◆ ed_marker_move_exit()

static void ed_marker_move_exit ( bContext C,
wmOperator op 
)
static

◆ ed_marker_move_init()

static bool ed_marker_move_init ( bContext C,
wmOperator op 
)
static

◆ ed_marker_move_invoke()

static int ed_marker_move_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ ed_marker_move_modal()

static int ed_marker_move_modal ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ ed_marker_move_update_header()

static void ed_marker_move_update_header ( bContext C,
wmOperator op 
)
static

◆ ed_marker_move_use_time()

static bool ed_marker_move_use_time ( MarkerMove mm)
static

◆ ed_marker_rename_exec()

static int ed_marker_rename_exec ( bContext C,
wmOperator op 
)
static

◆ ed_marker_rename_invoke()

static int ed_marker_rename_invoke ( bContext C,
wmOperator op,
const wmEvent event 
)
static

◆ ed_marker_select()

static int ed_marker_select ( bContext C,
const int  mval[2],
bool  extend,
bool  camera,
bool  wait_to_deselect_others 
)
static

◆ ed_marker_select_all_exec()

static int ed_marker_select_all_exec ( bContext C,
wmOperator op 
)
static

◆ ed_marker_select_exec()

static int ed_marker_select_exec ( bContext C,
wmOperator op 
)
static

◆ 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 
)

◆ ED_markers_find_nearest_marker()

TimeMarker* ED_markers_find_nearest_marker ( ListBase markers,
float  x 
)

◆ ED_markers_find_nearest_marker_time()

int ED_markers_find_nearest_marker_time ( ListBase markers,
float  x 
)

◆ ED_markers_get_first_selected()

TimeMarker* ED_markers_get_first_selected ( ListBase markers)

◆ 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,
short  only_sel 
)

◆ ed_markers_poll_markers_exist()

static bool ed_markers_poll_markers_exist ( bContext C)
static

◆ ed_markers_poll_selected_markers()

static bool ed_markers_poll_selected_markers ( bContext C)
static

◆ ed_markers_poll_selected_no_locked_markers()

static bool ed_markers_poll_selected_no_locked_markers ( bContext C)
static

◆ 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 130 of file anim_markers.c.

References CFRA, TimeMarker::flag, float(), TimeMarker::frame, ToolSettings::lock_markers, markers, TimeMarker::next, NULL, round_fl_to_int(), scene, SELECT, TFM_TIME_EXTEND, TFM_TIME_SCALE, TFM_TIME_TRANSLATE, and Scene::toolsettings.

Referenced by special_aftertrans_update__actedit(), and special_aftertrans_update__sequencer().

◆ ED_operator_markers_region_active()

static bool ED_operator_markers_region_active ( bContext C)
static

◆ ED_operatortypes_marker()

void ED_operatortypes_marker ( void  )

◆ get_marker_clip_frame_range()

static void get_marker_clip_frame_range ( View2D v2d,
float  xscale,
int  r_range[2] 
)
static

Definition at line 559 of file anim_markers.c.

References View2D::cur, NULL, UI_DPI_FAC, rctf::xmax, and rctf::xmin.

Referenced by ED_markers_draw().

◆ get_marker_region_rect()

static void get_marker_region_rect ( View2D v2d,
rctf rect 
)
static

Definition at line 551 of file anim_markers.c.

References View2D::cur, UI_MARKER_MARGIN_Y, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.

Referenced by ED_markers_draw().

◆ marker_color_get()

static void marker_color_get ( const TimeMarker marker,
uchar r_text_color,
uchar r_line_color 
)
static

◆ marker_get_icon_id()

static int marker_get_icon_id ( TimeMarker marker,
int  flag 
)
static

Definition at line 482 of file anim_markers.c.

References ACTIVE, TimeMarker::camera, DRAW_MARKERS_LOCAL, TimeMarker::flag, and SELECT.

Referenced by draw_marker().

◆ marker_is_in_frame_range()

static bool marker_is_in_frame_range ( TimeMarker marker,
const int  frame_range[2] 
)
static

Definition at line 540 of file anim_markers.c.

References TimeMarker::frame.

Referenced by ED_markers_draw().

◆ MARKER_OT_add()

static void MARKER_OT_add ( wmOperatorType ot)
static

◆ MARKER_OT_delete()

static void MARKER_OT_delete ( wmOperatorType ot)
static

◆ MARKER_OT_duplicate()

static void MARKER_OT_duplicate ( wmOperatorType ot)
static

◆ MARKER_OT_make_links_scene()

static void MARKER_OT_make_links_scene ( wmOperatorType ot)
static

◆ MARKER_OT_move()

static void MARKER_OT_move ( wmOperatorType ot)
static

◆ MARKER_OT_rename()

static void MARKER_OT_rename ( wmOperatorType ot)
static

◆ MARKER_OT_select()

static void MARKER_OT_select ( wmOperatorType ot)
static

◆ MARKER_OT_select_all()

static void MARKER_OT_select_all ( wmOperatorType ot)
static

◆ MARKER_OT_select_box()

static void MARKER_OT_select_box ( wmOperatorType ot)
static

◆ region_position_is_over_marker()

static bool region_position_is_over_marker ( View2D v2d,
ListBase markers,
float  region_x 
)
static

◆ select_marker_camera_switch()

static void select_marker_camera_switch ( bContext C,
bool  camera,
bool  extend,
ListBase markers,
int  cfra 
)
static

◆ select_timeline_marker_frame()

static int select_timeline_marker_frame ( ListBase markers,
int  frame,
bool  extend,
bool  wait_to_deselect_others 
)
static