main sync #3

Merged
Patrick Busch merged 318 commits from blender/blender:main into main 2023-03-17 15:52:21 +01:00
6 changed files with 35 additions and 5 deletions
Showing only changes of commit 66eedc542b - Show all commits

View File

@ -76,6 +76,7 @@
#include "readfile.h"
#include "SEQ_channels.h"
#include "SEQ_effects.h"
#include "SEQ_iterator.h"
#include "SEQ_retiming.h"
#include "SEQ_sequencer.h"
@ -1637,6 +1638,16 @@ static bool version_fix_delete_flag(Sequence *seq, void * /*user_data*/)
return true;
}
static bool version_set_seq_single_frame_content(Sequence *seq, void * /*user_data*/)
{
if ((seq->len == 1) &&
(seq->type == SEQ_TYPE_IMAGE ||
((seq->type & SEQ_TYPE_EFFECT) && SEQ_effect_get_num_inputs(seq->type) == 0))) {
seq->flag |= SEQ_SINGLE_FRAME_CONTENT;
}
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.
@ -4027,6 +4038,14 @@ void blo_do_versions_300(FileData *fd, Library * /*lib*/, Main *bmain)
}
}
/* Use `SEQ_SINGLE_FRAME_CONTENT` flag instead of weird function to check if strip has multiple
* frames. */
LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
Editing *ed = SEQ_editing_get(scene);
if (ed != nullptr) {
SEQ_for_each_callback(&ed->seqbase, version_set_seq_single_frame_content, nullptr);
}
}
/* Keep this block, even when empty. */
}
}

View File

@ -1851,6 +1851,7 @@ static int sequencer_separate_images_exec(bContext *C, wmOperator *op)
seq_new->start = start_ofs;
seq_new->type = SEQ_TYPE_IMAGE;
seq_new->len = 1;
seq->flag |= SEQ_SINGLE_FRAME_CONTENT;
seq_new->endofs = 1 - step;
/* New strip. */
@ -2918,6 +2919,13 @@ static int sequencer_change_path_exec(bContext *C, wmOperator *op)
RNA_END;
}
if (len == 1) {
seq->flag |= SEQ_SINGLE_FRAME_CONTENT;
}
else {
seq->flag &= ~SEQ_SINGLE_FRAME_CONTENT;
}
/* Reset these else we won't see all the images. */
seq->anim_startofs = seq->anim_endofs = 0;

View File

@ -580,7 +580,7 @@ enum {
SEQ_USE_PROXY = (1 << 15),
SEQ_IGNORE_CHANNEL_LOCK = (1 << 16),
SEQ_AUTO_PLAYBACK_RATE = (1 << 17),
SEQ_FLAG_UNUSED_18 = (1 << 18), /* cleared */
SEQ_SINGLE_FRAME_CONTENT = (1 << 18),
SEQ_FLAG_UNUSED_19 = (1 << 19), /* cleared */
SEQ_FLAG_UNUSED_21 = (1 << 21), /* cleared */

View File

@ -176,6 +176,7 @@ Sequence *SEQ_add_effect_strip(Scene *scene, ListBase *seqbase, struct SeqLoadDa
if (!load_data->effect.seq1) {
seq->len = 1; /* Effect is generator, set non zero length. */
seq->flag |= SEQ_SINGLE_FRAME_CONTENT;
SEQ_time_right_handle_frame_set(scene, seq, load_data->effect.end_frame);
}
@ -235,6 +236,10 @@ Sequence *SEQ_add_image_strip(Main *bmain, Scene *scene, ListBase *seqbase, SeqL
Strip *strip = seq->strip;
strip->stripdata = MEM_callocN(load_data->image.len * sizeof(StripElem), "stripelem");
if (seq->len == 1) {
seq->flag |= SEQ_SINGLE_FRAME_CONTENT;
}
/* Multiview settings. */
if (load_data->use_multiview) {
seq->flag |= SEQ_USE_VIEWS;

View File

@ -77,7 +77,7 @@ float seq_give_frame_index(const Scene *scene, Sequence *seq, float timeline_fra
return -1;
}
if (seq->len == 1 && seq->type == SEQ_TYPE_IMAGE) {
if (seq->type == SEQ_TYPE_IMAGE && SEQ_transform_single_image_check(seq)) {
return 0;
}

View File

@ -36,9 +36,7 @@ static CLG_LogRef LOG = {"seq.strip_transform"};
bool SEQ_transform_single_image_check(Sequence *seq)
{
return ((seq->len == 1) &&
(seq->type == SEQ_TYPE_IMAGE ||
((seq->type & SEQ_TYPE_EFFECT) && SEQ_effect_get_num_inputs(seq->type) == 0)));
return (seq->flag & SEQ_SINGLE_FRAME_CONTENT) != 0;
}
bool SEQ_transform_seqbase_isolated_sel_check(ListBase *seqbase)