Fix #107289: Sound strips are invisible and overlap #107798

Merged
Richard Antalik merged 4 commits from iss/blender:107289 into main 2023-05-09 22:14:23 +02:00
1 changed files with 21 additions and 1 deletions

View File

@ -704,7 +704,7 @@ static bool do_versions_sequencer_init_retiming_tool_data(Sequence *seq, void *u
SeqRetimingHandle *handle = &seq->retiming_handles[seq->retiming_handle_num - 1];
handle->strip_frame_index = round_fl_to_int(content_length / seq->speed_factor);
seq->speed_factor = 0.0f;
seq->speed_factor = 1.0f;
return true;
}
@ -1786,6 +1786,18 @@ static bool version_set_seq_single_frame_content(Sequence *seq, void * /*user_da
return true;
}
static bool version_seq_fix_broken_sound_strips(Sequence *seq, void * /*user_data*/)
{
if (seq->type != SEQ_TYPE_SOUND_RAM || seq->speed_factor != 0.0f) {
return true;
}
seq->speed_factor = 1.0f;
SEQ_retiming_data_clear(seq);
seq->startofs = 0.0f;
return true;
}
/* Those `version_liboverride_rnacollections_*` functions mimic the old, pre-3.0 code to find
* anchor and source items in the given list of modifiers, constraints etc., using only the
* `subitem_local` data of the override property operation.
@ -4347,5 +4359,13 @@ void blo_do_versions_300(FileData *fd, Library * /*lib*/, Main *bmain)
*/
{
/* Keep this block, even when empty. */
/* Fix sound strips with speed factor set to 0. See #107289. */
LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
Editing *ed = SEQ_editing_get(scene);
if (ed != nullptr) {
SEQ_for_each_callback(&ed->seqbase, version_seq_fix_broken_sound_strips, nullptr);
}
}
}
}