60 bool any_strip_has_editable_retiming =
false;
65 return any_strip_has_editable_retiming;
75 if ((strip->flag &
SELECT) == 0) {
88 if ((strip->flag &
SELECT) == 0) {
111 if (strip_act ==
nullptr) {
132 ot->name =
"Retime Strips";
133 ot->description =
"Show retiming keys in selected strips";
134 ot->idname =
"SEQUENCER_OT_retiming_show";
157 if (strip ==
nullptr) {
187 ot->name =
"Reset Retiming";
188 ot->description =
"Reset strip retiming";
189 ot->idname =
"SEQUENCER_OT_retiming_reset";
216 const int timeline_frame)
230 if (strip->
start > timeline_frame || end_frame < timeline_frame) {
242 const int timeline_frame)
244 bool inserted =
false;
246 for (
Strip *strip : strips) {
258 const int timeline_frame)
262 bool inserted =
false;
280 float timeline_frame;
304 ot->name =
"Add Retiming Key";
305 ot->description =
"Add retiming Key";
306 ot->idname =
"SEQUENCER_OT_retiming_key_add";
321 "Frame where key will be added",
335 const int timeline_frame,
344 if (key ==
nullptr) {
357 if (freeze ==
nullptr) {
379 bool success =
false;
381 for (
Strip *strip : strips) {
393 bool success =
false;
397 for (
auto item : selection.
items()) {
408 bool success =
false;
431 ot->name =
"Add Freeze Frame";
432 ot->description =
"Add freeze frame";
433 ot->idname =
"SEQUENCER_OT_retiming_freeze_frame_add";
449 "Duration of freeze frame segment",
463 const int timeline_frame,
472 if (key ==
nullptr) {
483 if (transition ==
nullptr) {
502 bool success =
false;
506 for (
auto item : selection.
items()) {
516 bool success =
false;
540 ot->name =
"Add Speed Transition";
541 ot->description =
"Add smooth transition between 2 retimed segments";
542 ot->idname =
"SEQUENCER_OT_retiming_transition_add";
558 "Duration of freeze frame segment",
584 for (
Strip *strip : strips_to_handle) {
586 for (
auto item : selection.
items()) {
587 if (item.value != strip) {
590 keys_to_delete.
append(item.key);
596 for (
Strip *strip : strips_to_handle) {
616 if (event->
mval[1] <= 30) {
629 ot->name =
"Delete Retiming Keys";
630 ot->idname =
"SEQUENCER_OT_retiming_key_delete";
631 ot->description =
"Delete selected retiming keys from the sequencer";
654 if (strips.
size() == 1) {
655 Strip *strip = strips[0];
664 if (selection.
size() == 1) {
665 for (
auto item : selection.
items()) {
679 for (
Strip *strip : strips) {
682 if (key ==
nullptr) {
709 for (
auto item : selection.
items()) {
739 if (selection.
size() > 0) {
762 ot->name =
"Set Speed";
763 ot->description =
"Set speed of retimed segment";
764 ot->idname =
"SEQUENCER_OT_retiming_segment_speed_set";
781 "New speed of retimed segment",
788 "Preserve Current Retiming",
789 "Keep speed of other segments unchanged, change strip length instead");
797 const bool deselect_all)
799 bool changed =
false;
805 if (key ==
nullptr) {
821 const Strip *source_owner)
828 bool changed =
false;
830 for (
Strip *connection : connections) {
844 const Strip *key_owner)
863 const Strip *key_owner)
873 const bool wait_to_deselect_others =
RNA_boolean_get(op->
ptr,
"wait_to_deselect_others");
883 if (wait_to_deselect_others && !toggle) {
889 bool changed =
select_key(
ed, key, toggle, deselect_all);
908 if (left_key_frame > rectf.
xmin && left_key_frame < rectf.
xmax) {
911 if (right_key_frame > rectf.
xmin && right_key_frame < rectf.
xmax) {
927 bool changed =
false;
940 if (strip->channel < rectf.
ymin || strip->channel > rectf.
ymax) {
952 if (key_frame < strip_start || key_frame > strip_end) {
955 if (key_frame > rectf.
xmax || key_frame < rectf.
xmin) {
989 if (and_keys.
size() > 0) {
991 for (
auto *key : and_keys) {
1008 for (
Strip *strip : strips) {
1025 for (
Strip *strip : strips) {
void CTX_wm_operator_poll_msg_set(bContext *C, const char *msg)
ARegion * CTX_wm_region(const bContext *C)
Scene * CTX_data_sequencer_scene(const bContext *C)
void BKE_report(ReportList *reports, eReportType type, const char *message)
float BKE_scene_frame_get(const Scene *scene)
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
MINLINE int min_ii(int a, int b)
MINLINE int max_ii(int a, int b)
#define SEL_OP_USE_PRE_DESELECT(sel_op)
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()
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
ValueIterator values() const &
ItemIterator items() const &
int64_t remove_if(Predicate &&predicate)
void append(const T &value)
void append_non_duplicates(const T &value)
void SEQUENCER_OT_retiming_transition_add(wmOperatorType *ot)
static SeqRetimingKey * ensure_left_and_right_keys(const bContext *C, Strip *strip)
static bool select_connected_keys(const Scene *scene, const SeqRetimingKey *source, const Strip *source_owner)
static bool freeze_frame_add_from_strip_selection(bContext *C, const wmOperator *op, const int duration)
static wmOperatorStatus sequencer_retiming_transition_add_exec(bContext *C, wmOperator *op)
static bool freeze_frame_add_from_retiming_selection(const bContext *C, const wmOperator *op, const int duration)
static wmOperatorStatus sequencer_retiming_key_delete_invoke(bContext *C, wmOperator *op, const wmEvent *event)
int right_fake_key_frame_get(const bContext *C, const Strip *strip)
void SEQUENCER_OT_retiming_reset(wmOperatorType *ot)
static float strip_speed_get(bContext *C, const wmOperator *)
void SEQUENCER_OT_retiming_segment_speed_set(wmOperatorType *ot)
static bool select_key(const Editing *ed, SeqRetimingKey *key, const bool toggle, const bool deselect_all)
static wmOperatorStatus retiming_key_add_to_editable_strips(bContext *C, wmOperator *op, const int timeline_frame)
static bool freeze_frame_add_new_for_strip(const bContext *C, const wmOperator *op, Strip *strip, const int timeline_frame, const int duration)
static wmOperatorStatus sequencer_retiming_segment_speed_set_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static wmOperatorStatus sequencer_retiming_segment_speed_set_exec(bContext *C, wmOperator *op)
static void sequencer_retiming_data_hide_all(ListBase *seqbase)
blender::VectorSet< Strip * > all_strips_from_context(bContext *C)
static wmOperatorStatus sequencer_retiming_key_delete_exec(bContext *C, wmOperator *)
blender::VectorSet< Strip * > selected_strips_from_context(bContext *C)
bool sequencer_editing_initialized_and_active(bContext *C)
static void realize_fake_keys_in_rect(bContext *C, Strip *strip, const rctf &rectf)
static wmOperatorStatus sequencer_retiming_freeze_frame_add_exec(bContext *C, wmOperator *op)
static void sequencer_retiming_data_show_selection(ListBase *seqbase)
wmOperatorStatus sequencer_retiming_box_select_exec(bContext *C, wmOperator *op)
static wmOperatorStatus strip_speed_set_exec(bContext *C, const wmOperator *op)
void SEQUENCER_OT_retiming_key_delete(wmOperatorType *ot)
static bool transition_add_new_for_strip(const bContext *C, const wmOperator *op, Strip *strip, const int timeline_frame, const int duration)
static void sequencer_retiming_data_hide_selection(ListBase *seqbase)
static wmOperatorStatus sequencer_retiming_key_add_exec(bContext *C, wmOperator *op)
static bool retiming_key_add_new_for_strip(bContext *C, wmOperator *op, Strip *strip, const int timeline_frame)
static bool retiming_poll(bContext *C)
void sequencer_select_do_updates(const bContext *C, Scene *scene)
static wmOperatorStatus retiming_key_add_from_selection(bContext *C, wmOperator *op, blender::Span< Strip * > strips, const int timeline_frame)
void SEQUENCER_OT_retiming_show(wmOperatorType *ot)
void SEQUENCER_OT_retiming_key_add(wmOperatorType *ot)
bool deselect_all_strips(const Scene *scene)
static wmOperatorStatus segment_speed_set_exec(const bContext *C, const wmOperator *op, blender::Map< SeqRetimingKey *, Strip * > selection)
wmOperatorStatus sequencer_retiming_select_all_exec(bContext *C, wmOperator *op)
int left_fake_key_frame_get(const bContext *C, const Strip *strip)
static bool transition_add_from_retiming_selection(const bContext *C, const wmOperator *op, const int duration)
void SEQUENCER_OT_retiming_freeze_frame_add(wmOperatorType *ot)
static wmOperatorStatus sequencer_retiming_reset_exec(bContext *C, wmOperator *)
blender::Vector< Strip * > sequencer_visible_strips_get(const bContext *C)
static wmOperatorStatus sequencer_retiming_data_show_exec(bContext *C, wmOperator *)
bool sequencer_retiming_mode_is_active(const bContext *C)
wmOperatorStatus sequencer_retiming_key_select_exec(bContext *C, wmOperator *op, SeqRetimingKey *key, const Strip *key_owner)
wmOperatorStatus sequencer_retiming_select_linked_time(bContext *C, wmOperator *op, SeqRetimingKey *key, const Strip *key_owner)
int time_right_handle_frame_get(const Scene *scene, const Strip *strip)
SeqRetimingKey * retiming_add_transition(const Scene *scene, Strip *strip, SeqRetimingKey *key, float offset)
void retiming_key_speed_set(const Scene *scene, Strip *strip, SeqRetimingKey *key, const float speed, bool keep_retiming)
bool retiming_key_is_transition_start(const SeqRetimingKey *key)
void retiming_reset(Scene *scene, Strip *strip)
bool retiming_selection_contains(const Editing *ed, const SeqRetimingKey *key)
float time_content_end_frame_get(const Scene *scene, const Strip *strip)
VectorSet< Strip * > query_selected_strips(ListBase *seqbase)
blender::Map< SeqRetimingKey *, Strip * > retiming_selection_get(const Editing *ed)
float time_media_playback_rate_factor_get(const Strip *strip, const float scene_fps)
SeqRetimingKey * retiming_add_freeze_frame(const Scene *scene, Strip *strip, SeqRetimingKey *key, const int offset)
int retiming_key_timeline_frame_get(const Scene *scene, const Strip *strip, const SeqRetimingKey *key)
bool transform_test_overlap(const Scene *scene, Strip *strip1, Strip *strip2)
Editing * editing_get(const Scene *scene)
void retiming_remove_multiple_keys(Strip *strip, blender::Vector< SeqRetimingKey * > &keys_to_remove)
MutableSpan< SeqRetimingKey > retiming_keys_get(const Strip *strip)
void retiming_data_ensure(Strip *strip)
int time_left_handle_frame_get(const Scene *, const Strip *strip)
SeqRetimingKey * retiming_find_segment_start_key(const Strip *strip, float frame_index)
void relations_invalidate_cache_raw(Scene *scene, Strip *strip)
void retiming_selection_remove(SeqRetimingKey *key)
float time_start_frame_get(const Strip *strip)
SeqRetimingKey * retiming_key_get_by_timeline_frame(const Scene *scene, const Strip *strip, const int timeline_frame)
blender::VectorSet< Strip * > connected_strips_get(const Strip *strip)
int time_strip_length_get(const Scene *scene, const Strip *strip)
Strip * select_active_get(const Scene *scene)
bool is_strip_connected(const Strip *strip)
bool retiming_data_is_editable(const Strip *strip)
void retiming_selection_copy(SeqRetimingKey *dst, const SeqRetimingKey *src)
bool retiming_selection_clear(const Editing *ed)
float retiming_key_speed_get(const Strip *strip, const SeqRetimingKey *key)
bool retiming_is_allowed(const Strip *strip)
ListBase * active_seqbase_get(const Editing *ed)
SeqRetimingKey * retiming_last_key_get(const Strip *strip)
void retiming_selection_append(SeqRetimingKey *key)
SeqRetimingKey * retiming_add_key(const Scene *scene, Strip *strip, const int timeline_frame)
bool retiming_is_last_key(const Strip *strip, const SeqRetimingKey *key)
bool transform_seqbase_shuffle(ListBase *seqbasep, Strip *test, Scene *evil_scene)
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)
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)
wmOperatorStatus WM_operator_props_popup(bContext *C, wmOperator *op, const wmEvent *)