Fix issues with retiming API

Ensure retiming data when operator is used, fix math for setting
retiming handle timeline frame.
This commit is contained in:
2023-03-15 03:16:04 +01:00
parent 99506b3d73
commit 559898709f
2 changed files with 3 additions and 1 deletions

View File

@@ -252,6 +252,8 @@ static int sequesequencer_retiming_handle_add_exec(bContext *C, wmOperator *op)
const Editing *ed = SEQ_editing_get(scene);
Sequence *seq = ed->act_seq;
SEQ_retiming_data_ensure(seq);
float timeline_frame;
if (RNA_struct_property_is_set(op->ptr, "timeline_frame")) {
timeline_frame = RNA_int_get(op->ptr, "timeline_frame");

View File

@@ -358,7 +358,7 @@ static void rna_Sequence_retiming_handle_frame_set(PointerRNA *ptr, int value)
return;
}
const int offset = value - SEQ_time_start_frame_get(seq) + handle->strip_frame_index;
const int offset = value - (SEQ_time_start_frame_get(seq) + handle->strip_frame_index);
SEQ_retiming_offset_handle(scene, seq, handle, offset);
SEQ_relations_invalidate_cache_raw(scene, seq);
}