60 if ((seq->flag &
SELECT) == 0) {
73 if ((seq->flag &
SELECT) == 0) {
79 seq->flag &= ~SEQ_SHOW_RETIMING;
86 seq->flag &= ~SEQ_SHOW_RETIMING;
96 if (seq_act ==
nullptr) {
117 ot->
name =
"Retime Strips";
119 ot->
idname =
"SEQUENCER_OT_retiming_show";
138 if (seq ==
nullptr) {
168 ot->
name =
"Reset Retiming";
170 ot->
idname =
"SEQUENCER_OT_retiming_reset";
189 const int timeline_frame)
202 if (seq->
start > timeline_frame || end_frame < timeline_frame) {
214 const int timeline_frame)
216 bool inserted =
false;
230 const int timeline_frame)
234 bool inserted =
false;
237 if (selection.is_empty()) {
241 for (
Sequence *seq : selection.values()) {
252 float timeline_frame;
276 ot->
name =
"Add Retiming Key";
278 ot->
idname =
"SEQUENCER_OT_retiming_key_add";
293 "Frame where key will be added",
307 const int timeline_frame,
315 if (key ==
nullptr) {
327 if (freeze ==
nullptr) {
347 bool success =
false;
361 bool success =
false;
365 for (
auto item : selection.items()) {
376 bool success =
false;
399 ot->
name =
"Add Freeze Frame";
401 ot->
idname =
"SEQUENCER_OT_retiming_freeze_frame_add";
417 "Duration of freeze frame segment",
431 const int timeline_frame,
439 if (key ==
nullptr) {
450 if (transition ==
nullptr) {
467 bool success =
false;
471 for (
auto item : selection.items()) {
481 bool success =
false;
505 ot->
name =
"Add Speed Transition";
506 ot->
description =
"Add smooth transition between 2 retimed segments";
507 ot->
idname =
"SEQUENCER_OT_retiming_transition_add";
523 "Duration of freeze frame segment",
545 for (
Sequence *seq : selection.values()) {
549 for (
Sequence *seq : strips_to_handle) {
551 for (
auto item : selection.items()) {
552 if (item.value != seq) {
555 keys_to_delete.
append(item.key);
561 for (
Sequence *seq : strips_to_handle) {
579 if (event->
mval[1] <= 30) {
592 ot->
name =
"Delete Retiming Keys";
593 ot->
idname =
"SEQUENCER_OT_retiming_key_delete";
594 ot->
description =
"Delete selected strips from the sequencer";
625 if (strips.
size() == 1) {
635 if (selection.size() == 1) {
636 for (
auto item : selection.items()) {
653 if (key ==
nullptr) {
678 for (
auto item : selection.items()) {
708 if (selection.size() > 0) {
733 ot->
idname =
"SEQUENCER_OT_retiming_segment_speed_set";
750 "New speed of retimed segment",
757 "Preserve Current Retiming",
758 "Keep speed of other segments unchanged, change strip length instead");
766 const bool deselect_all)
768 bool changed =
false;
774 if (key ==
nullptr) {
797 bool changed =
false;
799 for (
Sequence *connection : connections) {
841 const bool wait_to_deselect_others =
RNA_boolean_get(op->
ptr,
"wait_to_deselect_others");
844 deselect_all |= !toggle;
853 if (wait_to_deselect_others && !toggle) {
859 bool changed =
select_key(ed, key, toggle, deselect_all);
878 if (left_key_frame > rectf.
xmin && left_key_frame < rectf.
xmax) {
881 if (right_key_frame > rectf.
xmin && right_key_frame < rectf.
xmax) {
897 bool changed =
false;
910 if (seq->machine < rectf.
ymin || seq->machine > rectf.
ymax) {
922 if (key_frame < strip_start || key_frame > strip_end) {
925 if (key_frame > rectf.
xmax || key_frame < rectf.
xmin) {
959 if (and_keys.
size() > 0) {
961 for (
auto key : and_keys) {
1006 key.flag &= ~SEQ_KEY_SELECTED;
void CTX_wm_operator_poll_msg_set(bContext *C, const char *msg)
Scene * CTX_data_scene(const bContext *C)
ARegion * CTX_wm_region(const bContext *C)
void BKE_report(ReportList *reports, eReportType type, const char *message)
float BKE_scene_frame_get(const Scene *scene)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
#define LISTBASE_FOREACH(type, var, list)
MINLINE int min_ii(int a, int b)
MINLINE int max_ii(int a, int b)
#define SEL_OP_USE_PRE_DESELECT(sel_op)
blender::VectorSet< Sequence * > ED_sequencer_selected_strips_from_context(bContext *C)
bool ED_sequencer_deselect_all(Scene *scene)
Read Guarded memory(de)allocation.
View2D * UI_view2d_fromcontext(const bContext *C)
void UI_view2d_region_to_view_rctf(const View2D *v2d, const rctf *rect_src, rctf *rect_dst) ATTR_NONNULL()
int64_t remove_if(Predicate &&predicate)
void append(const T &value)
void append_non_duplicates(const T &value)
const vector< Marker > & markers
VectorSet< Sequence * > SEQ_query_selected_strips(ListBase *seqbase)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
int RNA_int_get(PointerRNA *ptr, const char *name)
float RNA_float_get(PointerRNA *ptr, const char *name)
void RNA_float_set(PointerRNA *ptr, const char *name, float value)
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, const float default_value, const float hardmin, const float hardmax, const char *ui_name, const char *ui_description, const float softmin, const float softmax)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
ListBase * SEQ_active_seqbase_get(const Editing *ed)
Editing * SEQ_editing_get(const Scene *scene)
bool sequencer_editing_initialized_and_active(bContext *C)
blender::Vector< Sequence * > sequencer_visible_strips_get(const bContext *C)
int left_fake_key_frame_get(const bContext *C, const Sequence *seq)
blender::VectorSet< Sequence * > all_strips_from_context(bContext *C)
int right_fake_key_frame_get(const bContext *C, const Sequence *seq)
void SEQUENCER_OT_retiming_transition_add(wmOperatorType *ot)
static SeqRetimingKey * ensure_left_and_right_keys(const bContext *C, Sequence *seq)
void SEQUENCER_OT_retiming_show(wmOperatorType *ot)
void SEQUENCER_OT_retiming_freeze_frame_add(wmOperatorType *ot)
void SEQUENCER_OT_retiming_key_delete(wmOperatorType *ot)
static bool transition_add_from_retiming_selection(const bContext *C, const wmOperator *op, const int duration)
static bool freeze_frame_add_from_strip_selection(bContext *C, const wmOperator *op, const int duration)
static int sequencer_retiming_transition_add_exec(bContext *C, wmOperator *op)
int sequencer_retiming_key_select_exec(bContext *C, wmOperator *op, SeqRetimingKey *key, const Sequence *key_owner)
static void sequencer_retiming_data_hide_all(ListBase *seqbase)
static int sequencer_retiming_key_delete_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void realize_fake_keys_in_rect(bContext *C, Sequence *seq, const rctf &rectf)
static int sequencer_retiming_reset_exec(bContext *C, wmOperator *)
int sequencer_retiming_select_linked_time(bContext *C, wmOperator *op, SeqRetimingKey *key, const Sequence *key_owner)
static bool retiming_poll(bContext *C)
static bool transition_add_new_for_seq(const bContext *C, const wmOperator *op, Sequence *seq, const int timeline_frame, const int duration)
static float strip_speed_get(bContext *C, const wmOperator *)
static int sequencer_retiming_key_add_exec(bContext *C, wmOperator *op)
static int sequencer_retiming_segment_speed_set_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static int retiming_key_add_from_selection(bContext *C, wmOperator *op, blender::Span< Sequence * > strips, const int timeline_frame)
bool sequencer_retiming_mode_is_active(const bContext *C)
static bool freeze_frame_add_from_retiming_selection(const bContext *C, const wmOperator *op, const int duration)
int sequencer_retiming_select_all_exec(bContext *C, wmOperator *op)
static int sequencer_retiming_data_show_exec(bContext *C, wmOperator *)
void SEQUENCER_OT_retiming_reset(wmOperatorType *ot)
static bool retiming_key_add_new_for_seq(bContext *C, wmOperator *op, Sequence *seq, const int timeline_frame)
void SEQUENCER_OT_retiming_key_add(wmOperatorType *ot)
static int sequencer_retiming_freeze_frame_add_exec(bContext *C, wmOperator *op)
void SEQUENCER_OT_retiming_segment_speed_set(wmOperatorType *ot)
static bool freeze_frame_add_new_for_seq(const bContext *C, const wmOperator *op, Sequence *seq, const int timeline_frame, const int duration)
static void sequencer_retiming_data_show_selection(ListBase *seqbase)
static bool select_key(const Editing *ed, SeqRetimingKey *key, const bool toggle, const bool deselect_all)
static void sequencer_retiming_data_hide_selection(ListBase *seqbase)
static bool select_connected_keys(const Scene *scene, const SeqRetimingKey *source, const Sequence *source_owner)
static int sequencer_retiming_key_delete_exec(bContext *C, wmOperator *)
static int sequencer_retiming_segment_speed_set_exec(bContext *C, wmOperator *op)
int sequencer_retiming_box_select_exec(bContext *C, wmOperator *op)
static int strip_speed_set_exec(bContext *C, const wmOperator *op)
static int segment_speed_set_exec(const bContext *C, const wmOperator *op, blender::Map< SeqRetimingKey *, Sequence * > selection)
static int retiming_key_add_to_editable_strips(bContext *C, wmOperator *op, const int timeline_frame)
bool SEQ_is_strip_connected(const Sequence *seq)
blender::VectorSet< Sequence * > SEQ_get_connected_strips(const Sequence *seq)
void SEQ_relations_invalidate_cache_raw(Scene *scene, Sequence *seq)
MutableSpan< SeqRetimingKey > SEQ_retiming_keys_get(const Sequence *seq)
bool SEQ_retiming_data_is_editable(const Sequence *seq)
void SEQ_retiming_remove_multiple_keys(Sequence *seq, blender::Vector< SeqRetimingKey * > &keys_to_remove)
void SEQ_retiming_key_speed_set(const Scene *scene, Sequence *seq, SeqRetimingKey *key, const float speed, bool keep_retiming)
bool SEQ_retiming_selection_contains(const Editing *ed, const SeqRetimingKey *key)
SeqRetimingKey * SEQ_retiming_last_key_get(const Sequence *seq)
SeqRetimingKey * SEQ_retiming_add_freeze_frame(const Scene *scene, Sequence *seq, SeqRetimingKey *key, const int offset)
SeqRetimingKey * SEQ_retiming_add_transition(const Scene *scene, Sequence *seq, SeqRetimingKey *key, float offset)
void SEQ_retiming_selection_remove(SeqRetimingKey *key)
bool SEQ_retiming_is_allowed(const Sequence *seq)
int SEQ_retiming_key_timeline_frame_get(const Scene *scene, const Sequence *seq, const SeqRetimingKey *key)
SeqRetimingKey * SEQ_retiming_find_segment_start_key(const Sequence *seq, float frame_index)
void SEQ_retiming_selection_append(SeqRetimingKey *key)
SeqRetimingKey * SEQ_retiming_key_get_by_timeline_frame(const Scene *scene, const Sequence *seq, const int timeline_frame)
blender::Map< SeqRetimingKey *, Sequence * > SEQ_retiming_selection_get(const Editing *ed)
float SEQ_retiming_key_speed_get(const Sequence *seq, const SeqRetimingKey *key)
void SEQ_retiming_data_ensure(Sequence *seq)
bool SEQ_retiming_is_last_key(const Sequence *seq, const SeqRetimingKey *key)
bool SEQ_retiming_selection_clear(const Editing *ed)
void SEQ_retiming_reset(Scene *scene, Sequence *seq)
bool SEQ_retiming_key_is_transition_start(const SeqRetimingKey *key)
void SEQ_retiming_selection_copy(SeqRetimingKey *dst, const SeqRetimingKey *src)
SeqRetimingKey * SEQ_retiming_add_key(const Scene *scene, Sequence *seq, const int timeline_frame)
Sequence * SEQ_select_active_get(const Scene *scene)
int SEQ_time_strip_length_get(const Scene *scene, const Sequence *seq)
int SEQ_time_left_handle_frame_get(const Scene *, const Sequence *seq)
float SEQ_time_content_end_frame_get(const Scene *scene, const Sequence *seq)
float SEQ_time_start_frame_get(const Sequence *seq)
float SEQ_time_media_playback_rate_factor_get(const Scene *scene, const Sequence *seq)
int SEQ_time_right_handle_frame_get(const Scene *scene, const Sequence *seq)
bool(* poll)(bContext *C) ATTR_WARN_UNUSED_RESULT
int(* invoke)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
int(* exec)(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
struct ReportList * reports
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void WM_operator_properties_border_to_rctf(wmOperator *op, rctf *r_rect)
int WM_operator_props_popup(bContext *C, wmOperator *op, const wmEvent *)