Cleanup: Remove SEQ_CURRENT_BEGIN macro
Use LISTBASE_FOREACH instead. SEQ_CURRENT_BEGIN did null checks, so now these must be explicit. Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D10823
This commit is contained in:
@@ -255,7 +255,6 @@ ForEachMacros:
|
|||||||
- SCULPT_VERTEX_DUPLICATES_AND_NEIGHBORS_ITER_BEGIN
|
- SCULPT_VERTEX_DUPLICATES_AND_NEIGHBORS_ITER_BEGIN
|
||||||
- SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN
|
- SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN
|
||||||
- SEQ_ALL_BEGIN
|
- SEQ_ALL_BEGIN
|
||||||
- SEQ_CURRENT_BEGIN
|
|
||||||
- SURFACE_QUAD_ITER_BEGIN
|
- SURFACE_QUAD_ITER_BEGIN
|
||||||
- foreach
|
- foreach
|
||||||
- ED_screen_areas_iter
|
- ED_screen_areas_iter
|
||||||
|
@@ -81,6 +81,7 @@
|
|||||||
#include "BKE_pointcache.h"
|
#include "BKE_pointcache.h"
|
||||||
|
|
||||||
#include "SEQ_iterator.h"
|
#include "SEQ_iterator.h"
|
||||||
|
#include "SEQ_sequencer.h"
|
||||||
|
|
||||||
#include "NOD_socket.h"
|
#include "NOD_socket.h"
|
||||||
|
|
||||||
@@ -2560,18 +2561,16 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
|
|||||||
|
|
||||||
if (bmain->versionfile < 249 && bmain->subversionfile < 2) {
|
if (bmain->versionfile < 249 && bmain->subversionfile < 2) {
|
||||||
Scene *sce = bmain->scenes.first;
|
Scene *sce = bmain->scenes.first;
|
||||||
Sequence *seq;
|
|
||||||
Editing *ed;
|
Editing *ed;
|
||||||
|
|
||||||
while (sce) {
|
while (sce) {
|
||||||
ed = sce->ed;
|
ed = sce->ed;
|
||||||
if (ed) {
|
if (ed) {
|
||||||
SEQ_CURRENT_BEGIN (ed, seq) {
|
LISTBASE_FOREACH (Sequence *, seq, SEQ_active_seqbase_get(ed)) {
|
||||||
if (seq->strip && seq->strip->proxy) {
|
if (seq->strip && seq->strip->proxy) {
|
||||||
seq->strip->proxy->quality = 90;
|
seq->strip->proxy->quality = 90;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SEQ_CURRENT_END;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sce = sce->id.next;
|
sce = sce->id.next;
|
||||||
|
@@ -105,8 +105,6 @@
|
|||||||
* it messes up transform. */
|
* it messes up transform. */
|
||||||
#undef SEQ_ALL_BEGIN
|
#undef SEQ_ALL_BEGIN
|
||||||
#undef SEQ_ALL_END
|
#undef SEQ_ALL_END
|
||||||
#undef SEQ_CURRENT_BEGIN
|
|
||||||
#undef SEQ_CURRENT_END
|
|
||||||
|
|
||||||
static Sequence *special_seq_update = NULL;
|
static Sequence *special_seq_update = NULL;
|
||||||
|
|
||||||
|
@@ -312,8 +312,7 @@ static int sequencer_snap_exec(bContext *C, wmOperator *op)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Test for effects and overlap.
|
/* Test for effects and overlap. */
|
||||||
* Don't use SEQ_CURRENT_BEGIN since that would be recursive. */
|
|
||||||
for (seq = ed->seqbasep->first; seq; seq = seq->next) {
|
for (seq = ed->seqbasep->first; seq; seq = seq->next) {
|
||||||
if (seq->flag & SELECT && !(seq->depth == 0 && seq->flag & SEQ_LOCK)) {
|
if (seq->flag & SELECT && !(seq->depth == 0 && seq->flag & SEQ_LOCK)) {
|
||||||
seq->flag &= ~SEQ_OVERLAP;
|
seq->flag &= ~SEQ_OVERLAP;
|
||||||
@@ -1411,28 +1410,25 @@ static int sequencer_split_exec(bContext *C, wmOperator *op)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (changed) { /* Got new strips? */
|
if (changed) { /* Got new strips? */
|
||||||
Sequence *seq;
|
|
||||||
if (ignore_selection) {
|
if (ignore_selection) {
|
||||||
if (use_cursor_position) {
|
if (use_cursor_position) {
|
||||||
SEQ_CURRENT_BEGIN (ed, seq) {
|
LISTBASE_FOREACH (Sequence *, seq, SEQ_active_seqbase_get(ed)) {
|
||||||
if (seq->enddisp == split_frame && seq->machine == split_channel) {
|
if (seq->enddisp == split_frame && seq->machine == split_channel) {
|
||||||
seq_selected = seq->flag & SEQ_ALLSEL;
|
seq_selected = seq->flag & SEQ_ALLSEL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SEQ_CURRENT_END;
|
|
||||||
if (!seq_selected) {
|
if (!seq_selected) {
|
||||||
SEQ_CURRENT_BEGIN (ed, seq) {
|
LISTBASE_FOREACH (Sequence *, seq, SEQ_active_seqbase_get(ed)) {
|
||||||
if (seq->startdisp == split_frame && seq->machine == split_channel) {
|
if (seq->startdisp == split_frame && seq->machine == split_channel) {
|
||||||
seq->flag &= ~SEQ_ALLSEL;
|
seq->flag &= ~SEQ_ALLSEL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SEQ_CURRENT_END;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (split_side != SEQ_SIDE_BOTH) {
|
if (split_side != SEQ_SIDE_BOTH) {
|
||||||
SEQ_CURRENT_BEGIN (ed, seq) {
|
LISTBASE_FOREACH (Sequence *, seq, SEQ_active_seqbase_get(ed)) {
|
||||||
if (split_side == SEQ_SIDE_LEFT) {
|
if (split_side == SEQ_SIDE_LEFT) {
|
||||||
if (seq->startdisp >= split_frame) {
|
if (seq->startdisp >= split_frame) {
|
||||||
seq->flag &= ~SEQ_ALLSEL;
|
seq->flag &= ~SEQ_ALLSEL;
|
||||||
@@ -1444,7 +1440,6 @@ static int sequencer_split_exec(bContext *C, wmOperator *op)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SEQ_CURRENT_END;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1652,16 +1647,14 @@ static int sequencer_delete_exec(bContext *C, wmOperator *UNUSED(op))
|
|||||||
Main *bmain = CTX_data_main(C);
|
Main *bmain = CTX_data_main(C);
|
||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
Editing *ed = SEQ_editing_get(scene, false);
|
Editing *ed = SEQ_editing_get(scene, false);
|
||||||
Sequence *seq;
|
|
||||||
|
|
||||||
SEQ_prefetch_stop(scene);
|
SEQ_prefetch_stop(scene);
|
||||||
|
|
||||||
SEQ_CURRENT_BEGIN (scene->ed, seq) {
|
LISTBASE_FOREACH (Sequence *, seq, SEQ_active_seqbase_get(ed)) {
|
||||||
if (seq->flag & SELECT) {
|
if (seq->flag & SELECT) {
|
||||||
SEQ_edit_flag_for_removal(scene, ed->seqbasep, seq);
|
SEQ_edit_flag_for_removal(scene, ed->seqbasep, seq);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SEQ_CURRENT_END;
|
|
||||||
SEQ_edit_remove_flagged_sequences(scene, ed->seqbasep);
|
SEQ_edit_remove_flagged_sequences(scene, ed->seqbasep);
|
||||||
|
|
||||||
DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS);
|
DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS);
|
||||||
@@ -2418,17 +2411,15 @@ void SEQUENCER_OT_copy(wmOperatorType *ot)
|
|||||||
|
|
||||||
void ED_sequencer_deselect_all(Scene *scene)
|
void ED_sequencer_deselect_all(Scene *scene)
|
||||||
{
|
{
|
||||||
Sequence *seq;
|
|
||||||
Editing *ed = SEQ_editing_get(scene, false);
|
Editing *ed = SEQ_editing_get(scene, false);
|
||||||
|
|
||||||
if (ed == NULL) {
|
if (ed == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SEQ_CURRENT_BEGIN (ed, seq) {
|
LISTBASE_FOREACH (Sequence *, seq, SEQ_active_seqbase_get(ed)) {
|
||||||
seq->flag &= ~SEQ_ALLSEL;
|
seq->flag &= ~SEQ_ALLSEL;
|
||||||
}
|
}
|
||||||
SEQ_CURRENT_END;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int sequencer_paste_exec(bContext *C, wmOperator *op)
|
static int sequencer_paste_exec(bContext *C, wmOperator *op)
|
||||||
|
@@ -237,7 +237,7 @@ static int strip_modifier_copy_exec(bContext *C, wmOperator *op)
|
|||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
SEQ_CURRENT_BEGIN (ed, seq_iter) {
|
LISTBASE_FOREACH (Sequence *, seq_iter, SEQ_active_seqbase_get(ed)) {
|
||||||
if (seq_iter->flag & SELECT) {
|
if (seq_iter->flag & SELECT) {
|
||||||
if (seq_iter == seq) {
|
if (seq_iter == seq) {
|
||||||
continue;
|
continue;
|
||||||
@@ -259,7 +259,6 @@ static int strip_modifier_copy_exec(bContext *C, wmOperator *op)
|
|||||||
SEQ_modifier_list_copy(seq_iter, seq);
|
SEQ_modifier_list_copy(seq_iter, seq);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SEQ_CURRENT_END;
|
|
||||||
|
|
||||||
SEQ_relations_invalidate_cache_preprocessed(scene, seq);
|
SEQ_relations_invalidate_cache_preprocessed(scene, seq);
|
||||||
WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
|
WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
|
||||||
|
@@ -58,7 +58,6 @@ static void seq_proxy_build_job(const bContext *C, ReportList *reports)
|
|||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
Editing *ed = SEQ_editing_get(scene, false);
|
Editing *ed = SEQ_editing_get(scene, false);
|
||||||
ScrArea *area = CTX_wm_area(C);
|
ScrArea *area = CTX_wm_area(C);
|
||||||
Sequence *seq;
|
|
||||||
|
|
||||||
if (ed == NULL) {
|
if (ed == NULL) {
|
||||||
return;
|
return;
|
||||||
@@ -70,7 +69,7 @@ static void seq_proxy_build_job(const bContext *C, ReportList *reports)
|
|||||||
GSet *file_list = BLI_gset_new(BLI_ghashutil_strhash_p, BLI_ghashutil_strcmp, "file list");
|
GSet *file_list = BLI_gset_new(BLI_ghashutil_strhash_p, BLI_ghashutil_strcmp, "file list");
|
||||||
bool selected = false; /* Check for no selected strips */
|
bool selected = false; /* Check for no selected strips */
|
||||||
|
|
||||||
SEQ_CURRENT_BEGIN (ed, seq) {
|
LISTBASE_FOREACH (Sequence *, seq, SEQ_active_seqbase_get(ed)) {
|
||||||
if (!ELEM(seq->type, SEQ_TYPE_MOVIE, SEQ_TYPE_IMAGE) || (seq->flag & SELECT) == 0) {
|
if (!ELEM(seq->type, SEQ_TYPE_MOVIE, SEQ_TYPE_IMAGE) || (seq->flag & SELECT) == 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -92,7 +91,6 @@ static void seq_proxy_build_job(const bContext *C, ReportList *reports)
|
|||||||
BKE_reportf(reports, RPT_WARNING, "Overwrite is not checked for %s, skipping", seq->name);
|
BKE_reportf(reports, RPT_WARNING, "Overwrite is not checked for %s, skipping", seq->name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SEQ_CURRENT_END;
|
|
||||||
|
|
||||||
BLI_gset_free(file_list, MEM_freeN);
|
BLI_gset_free(file_list, MEM_freeN);
|
||||||
|
|
||||||
@@ -124,7 +122,6 @@ static int sequencer_rebuild_proxy_exec(bContext *C, wmOperator *UNUSED(op))
|
|||||||
struct Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
|
struct Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
|
||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
Editing *ed = SEQ_editing_get(scene, false);
|
Editing *ed = SEQ_editing_get(scene, false);
|
||||||
Sequence *seq;
|
|
||||||
GSet *file_list;
|
GSet *file_list;
|
||||||
|
|
||||||
if (ed == NULL) {
|
if (ed == NULL) {
|
||||||
@@ -133,7 +130,7 @@ static int sequencer_rebuild_proxy_exec(bContext *C, wmOperator *UNUSED(op))
|
|||||||
|
|
||||||
file_list = BLI_gset_new(BLI_ghashutil_strhash_p, BLI_ghashutil_strcmp, "file list");
|
file_list = BLI_gset_new(BLI_ghashutil_strhash_p, BLI_ghashutil_strcmp, "file list");
|
||||||
|
|
||||||
SEQ_CURRENT_BEGIN (ed, seq) {
|
LISTBASE_FOREACH (Sequence *, seq, SEQ_active_seqbase_get(ed)) {
|
||||||
if ((seq->flag & SELECT)) {
|
if ((seq->flag & SELECT)) {
|
||||||
ListBase queue = {NULL, NULL};
|
ListBase queue = {NULL, NULL};
|
||||||
LinkData *link;
|
LinkData *link;
|
||||||
@@ -150,7 +147,6 @@ static int sequencer_rebuild_proxy_exec(bContext *C, wmOperator *UNUSED(op))
|
|||||||
SEQ_relations_free_imbuf(scene, &ed->seqbase, false);
|
SEQ_relations_free_imbuf(scene, &ed->seqbase, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SEQ_CURRENT_END;
|
|
||||||
|
|
||||||
BLI_gset_free(file_list, MEM_freeN);
|
BLI_gset_free(file_list, MEM_freeN);
|
||||||
|
|
||||||
@@ -189,7 +185,6 @@ static int sequencer_enable_proxies_exec(bContext *C, wmOperator *op)
|
|||||||
{
|
{
|
||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
Editing *ed = SEQ_editing_get(scene, false);
|
Editing *ed = SEQ_editing_get(scene, false);
|
||||||
Sequence *seq;
|
|
||||||
bool proxy_25 = RNA_boolean_get(op->ptr, "proxy_25");
|
bool proxy_25 = RNA_boolean_get(op->ptr, "proxy_25");
|
||||||
bool proxy_50 = RNA_boolean_get(op->ptr, "proxy_50");
|
bool proxy_50 = RNA_boolean_get(op->ptr, "proxy_50");
|
||||||
bool proxy_75 = RNA_boolean_get(op->ptr, "proxy_75");
|
bool proxy_75 = RNA_boolean_get(op->ptr, "proxy_75");
|
||||||
@@ -201,7 +196,7 @@ static int sequencer_enable_proxies_exec(bContext *C, wmOperator *op)
|
|||||||
turnon = false;
|
turnon = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
SEQ_CURRENT_BEGIN (ed, seq) {
|
LISTBASE_FOREACH (Sequence *, seq, SEQ_active_seqbase_get(ed)) {
|
||||||
if ((seq->flag & SELECT)) {
|
if ((seq->flag & SELECT)) {
|
||||||
if (ELEM(seq->type, SEQ_TYPE_MOVIE, SEQ_TYPE_IMAGE)) {
|
if (ELEM(seq->type, SEQ_TYPE_MOVIE, SEQ_TYPE_IMAGE)) {
|
||||||
SEQ_proxy_set(seq, turnon);
|
SEQ_proxy_set(seq, turnon);
|
||||||
@@ -246,7 +241,6 @@ static int sequencer_enable_proxies_exec(bContext *C, wmOperator *op)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SEQ_CURRENT_END;
|
|
||||||
|
|
||||||
WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
|
WM_event_add_notifier(C, NC_SCENE | ND_SEQUENCER, scene);
|
||||||
|
|
||||||
|
@@ -548,14 +548,13 @@ static int sequencer_select_exec(bContext *C, wmOperator *op)
|
|||||||
|
|
||||||
const float x = UI_view2d_region_to_view_x(v2d, mval[0]);
|
const float x = UI_view2d_region_to_view_x(v2d, mval[0]);
|
||||||
|
|
||||||
SEQ_CURRENT_BEGIN (ed, seq) {
|
LISTBASE_FOREACH (Sequence *, seq, SEQ_active_seqbase_get(ed)) {
|
||||||
if (((x < CFRA) && (seq->enddisp <= CFRA)) || ((x >= CFRA) && (seq->startdisp >= CFRA))) {
|
if (((x < CFRA) && (seq->enddisp <= CFRA)) || ((x >= CFRA) && (seq->startdisp >= CFRA))) {
|
||||||
/* Select left or right. */
|
/* Select left or right. */
|
||||||
seq->flag |= SELECT;
|
seq->flag |= SELECT;
|
||||||
recurs_sel_seq(seq);
|
recurs_sel_seq(seq);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SEQ_CURRENT_END;
|
|
||||||
|
|
||||||
{
|
{
|
||||||
SpaceSeq *sseq = CTX_wm_space_seq(C);
|
SpaceSeq *sseq = CTX_wm_space_seq(C);
|
||||||
@@ -1170,7 +1169,6 @@ static int sequencer_select_side_of_frame_exec(bContext *C, wmOperator *op)
|
|||||||
Editing *ed = SEQ_editing_get(scene, false);
|
Editing *ed = SEQ_editing_get(scene, false);
|
||||||
const bool extend = RNA_boolean_get(op->ptr, "extend");
|
const bool extend = RNA_boolean_get(op->ptr, "extend");
|
||||||
const int side = RNA_enum_get(op->ptr, "side");
|
const int side = RNA_enum_get(op->ptr, "side");
|
||||||
Sequence *seq;
|
|
||||||
|
|
||||||
if (ed == NULL) {
|
if (ed == NULL) {
|
||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
@@ -1179,7 +1177,7 @@ static int sequencer_select_side_of_frame_exec(bContext *C, wmOperator *op)
|
|||||||
ED_sequencer_deselect_all(scene);
|
ED_sequencer_deselect_all(scene);
|
||||||
}
|
}
|
||||||
const int timeline_frame = CFRA;
|
const int timeline_frame = CFRA;
|
||||||
SEQ_CURRENT_BEGIN (ed, seq) {
|
LISTBASE_FOREACH (Sequence *, seq, SEQ_active_seqbase_get(ed)) {
|
||||||
bool test = false;
|
bool test = false;
|
||||||
switch (side) {
|
switch (side) {
|
||||||
case -1:
|
case -1:
|
||||||
@@ -1198,7 +1196,6 @@ static int sequencer_select_side_of_frame_exec(bContext *C, wmOperator *op)
|
|||||||
recurs_sel_seq(seq);
|
recurs_sel_seq(seq);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SEQ_CURRENT_END;
|
|
||||||
|
|
||||||
ED_outliner_select_sync_from_sequence_tag(C);
|
ED_outliner_select_sync_from_sequence_tag(C);
|
||||||
|
|
||||||
@@ -1483,58 +1480,51 @@ static const EnumPropertyItem sequencer_prop_select_grouped_types[] = {
|
|||||||
|
|
||||||
static bool select_grouped_type(Editing *ed, Sequence *actseq, const int channel)
|
static bool select_grouped_type(Editing *ed, Sequence *actseq, const int channel)
|
||||||
{
|
{
|
||||||
Sequence *seq;
|
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
|
|
||||||
SEQ_CURRENT_BEGIN (ed, seq) {
|
LISTBASE_FOREACH (Sequence *, seq, SEQ_active_seqbase_get(ed)) {
|
||||||
if (SEQ_CHANNEL_CHECK(seq, channel) && seq->type == actseq->type) {
|
if (SEQ_CHANNEL_CHECK(seq, channel) && seq->type == actseq->type) {
|
||||||
seq->flag |= SELECT;
|
seq->flag |= SELECT;
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SEQ_CURRENT_END;
|
|
||||||
|
|
||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool select_grouped_type_basic(Editing *ed, Sequence *actseq, const int channel)
|
static bool select_grouped_type_basic(Editing *ed, Sequence *actseq, const int channel)
|
||||||
{
|
{
|
||||||
Sequence *seq;
|
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
const bool is_sound = SEQ_IS_SOUND(actseq);
|
const bool is_sound = SEQ_IS_SOUND(actseq);
|
||||||
|
|
||||||
SEQ_CURRENT_BEGIN (ed, seq) {
|
LISTBASE_FOREACH (Sequence *, seq, SEQ_active_seqbase_get(ed)) {
|
||||||
if (SEQ_CHANNEL_CHECK(seq, channel) && (is_sound ? SEQ_IS_SOUND(seq) : !SEQ_IS_SOUND(seq))) {
|
if (SEQ_CHANNEL_CHECK(seq, channel) && (is_sound ? SEQ_IS_SOUND(seq) : !SEQ_IS_SOUND(seq))) {
|
||||||
seq->flag |= SELECT;
|
seq->flag |= SELECT;
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SEQ_CURRENT_END;
|
|
||||||
|
|
||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool select_grouped_type_effect(Editing *ed, Sequence *actseq, const int channel)
|
static bool select_grouped_type_effect(Editing *ed, Sequence *actseq, const int channel)
|
||||||
{
|
{
|
||||||
Sequence *seq;
|
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
const bool is_effect = SEQ_IS_EFFECT(actseq);
|
const bool is_effect = SEQ_IS_EFFECT(actseq);
|
||||||
|
|
||||||
SEQ_CURRENT_BEGIN (ed, seq) {
|
LISTBASE_FOREACH (Sequence *, seq, SEQ_active_seqbase_get(ed)) {
|
||||||
if (SEQ_CHANNEL_CHECK(seq, channel) &&
|
if (SEQ_CHANNEL_CHECK(seq, channel) &&
|
||||||
(is_effect ? SEQ_IS_EFFECT(seq) : !SEQ_IS_EFFECT(seq))) {
|
(is_effect ? SEQ_IS_EFFECT(seq) : !SEQ_IS_EFFECT(seq))) {
|
||||||
seq->flag |= SELECT;
|
seq->flag |= SELECT;
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SEQ_CURRENT_END;
|
|
||||||
|
|
||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool select_grouped_data(Editing *ed, Sequence *actseq, const int channel)
|
static bool select_grouped_data(Editing *ed, Sequence *actseq, const int channel)
|
||||||
{
|
{
|
||||||
Sequence *seq;
|
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
const char *dir = actseq->strip ? actseq->strip->dir : NULL;
|
const char *dir = actseq->strip ? actseq->strip->dir : NULL;
|
||||||
|
|
||||||
@@ -1543,45 +1533,41 @@ static bool select_grouped_data(Editing *ed, Sequence *actseq, const int channel
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (SEQ_HAS_PATH(actseq) && dir) {
|
if (SEQ_HAS_PATH(actseq) && dir) {
|
||||||
SEQ_CURRENT_BEGIN (ed, seq) {
|
LISTBASE_FOREACH (Sequence *, seq, SEQ_active_seqbase_get(ed)) {
|
||||||
if (SEQ_CHANNEL_CHECK(seq, channel) && SEQ_HAS_PATH(seq) && seq->strip &&
|
if (SEQ_CHANNEL_CHECK(seq, channel) && SEQ_HAS_PATH(seq) && seq->strip &&
|
||||||
STREQ(seq->strip->dir, dir)) {
|
STREQ(seq->strip->dir, dir)) {
|
||||||
seq->flag |= SELECT;
|
seq->flag |= SELECT;
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SEQ_CURRENT_END;
|
|
||||||
}
|
}
|
||||||
else if (actseq->type == SEQ_TYPE_SCENE) {
|
else if (actseq->type == SEQ_TYPE_SCENE) {
|
||||||
Scene *sce = actseq->scene;
|
Scene *sce = actseq->scene;
|
||||||
SEQ_CURRENT_BEGIN (ed, seq) {
|
LISTBASE_FOREACH (Sequence *, seq, SEQ_active_seqbase_get(ed)) {
|
||||||
if (SEQ_CHANNEL_CHECK(seq, channel) && seq->type == SEQ_TYPE_SCENE && seq->scene == sce) {
|
if (SEQ_CHANNEL_CHECK(seq, channel) && seq->type == SEQ_TYPE_SCENE && seq->scene == sce) {
|
||||||
seq->flag |= SELECT;
|
seq->flag |= SELECT;
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SEQ_CURRENT_END;
|
|
||||||
}
|
}
|
||||||
else if (actseq->type == SEQ_TYPE_MOVIECLIP) {
|
else if (actseq->type == SEQ_TYPE_MOVIECLIP) {
|
||||||
MovieClip *clip = actseq->clip;
|
MovieClip *clip = actseq->clip;
|
||||||
SEQ_CURRENT_BEGIN (ed, seq) {
|
LISTBASE_FOREACH (Sequence *, seq, SEQ_active_seqbase_get(ed)) {
|
||||||
if (SEQ_CHANNEL_CHECK(seq, channel) && seq->type == SEQ_TYPE_MOVIECLIP &&
|
if (SEQ_CHANNEL_CHECK(seq, channel) && seq->type == SEQ_TYPE_MOVIECLIP &&
|
||||||
seq->clip == clip) {
|
seq->clip == clip) {
|
||||||
seq->flag |= SELECT;
|
seq->flag |= SELECT;
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SEQ_CURRENT_END;
|
|
||||||
}
|
}
|
||||||
else if (actseq->type == SEQ_TYPE_MASK) {
|
else if (actseq->type == SEQ_TYPE_MASK) {
|
||||||
struct Mask *mask = actseq->mask;
|
struct Mask *mask = actseq->mask;
|
||||||
SEQ_CURRENT_BEGIN (ed, seq) {
|
LISTBASE_FOREACH (Sequence *, seq, SEQ_active_seqbase_get(ed)) {
|
||||||
if (SEQ_CHANNEL_CHECK(seq, channel) && seq->type == SEQ_TYPE_MASK && seq->mask == mask) {
|
if (SEQ_CHANNEL_CHECK(seq, channel) && seq->type == SEQ_TYPE_MASK && seq->mask == mask) {
|
||||||
seq->flag |= SELECT;
|
seq->flag |= SELECT;
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SEQ_CURRENT_END;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return changed;
|
return changed;
|
||||||
@@ -1589,7 +1575,6 @@ static bool select_grouped_data(Editing *ed, Sequence *actseq, const int channel
|
|||||||
|
|
||||||
static bool select_grouped_effect(Editing *ed, Sequence *actseq, const int channel)
|
static bool select_grouped_effect(Editing *ed, Sequence *actseq, const int channel)
|
||||||
{
|
{
|
||||||
Sequence *seq;
|
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
bool effects[SEQ_TYPE_MAX + 1];
|
bool effects[SEQ_TYPE_MAX + 1];
|
||||||
|
|
||||||
@@ -1597,15 +1582,14 @@ static bool select_grouped_effect(Editing *ed, Sequence *actseq, const int chann
|
|||||||
effects[i] = false;
|
effects[i] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
SEQ_CURRENT_BEGIN (ed, seq) {
|
LISTBASE_FOREACH (Sequence *, seq, SEQ_active_seqbase_get(ed)) {
|
||||||
if (SEQ_CHANNEL_CHECK(seq, channel) && (seq->type & SEQ_TYPE_EFFECT) &&
|
if (SEQ_CHANNEL_CHECK(seq, channel) && (seq->type & SEQ_TYPE_EFFECT) &&
|
||||||
ELEM(actseq, seq->seq1, seq->seq2, seq->seq3)) {
|
ELEM(actseq, seq->seq1, seq->seq2, seq->seq3)) {
|
||||||
effects[seq->type] = true;
|
effects[seq->type] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SEQ_CURRENT_END;
|
|
||||||
|
|
||||||
SEQ_CURRENT_BEGIN (ed, seq) {
|
LISTBASE_FOREACH (Sequence *, seq, SEQ_active_seqbase_get(ed)) {
|
||||||
if (SEQ_CHANNEL_CHECK(seq, channel) && effects[seq->type]) {
|
if (SEQ_CHANNEL_CHECK(seq, channel) && effects[seq->type]) {
|
||||||
if (seq->seq1) {
|
if (seq->seq1) {
|
||||||
seq->seq1->flag |= SELECT;
|
seq->seq1->flag |= SELECT;
|
||||||
@@ -1619,23 +1603,20 @@ static bool select_grouped_effect(Editing *ed, Sequence *actseq, const int chann
|
|||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SEQ_CURRENT_END;
|
|
||||||
|
|
||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool select_grouped_time_overlap(Editing *ed, Sequence *actseq)
|
static bool select_grouped_time_overlap(Editing *ed, Sequence *actseq)
|
||||||
{
|
{
|
||||||
Sequence *seq;
|
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
|
|
||||||
SEQ_CURRENT_BEGIN (ed, seq) {
|
LISTBASE_FOREACH (Sequence *, seq, SEQ_active_seqbase_get(ed)) {
|
||||||
if (seq->startdisp < actseq->enddisp && seq->enddisp > actseq->startdisp) {
|
if (seq->startdisp < actseq->enddisp && seq->enddisp > actseq->startdisp) {
|
||||||
seq->flag |= SELECT;
|
seq->flag |= SELECT;
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SEQ_CURRENT_END;
|
|
||||||
|
|
||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
@@ -1650,10 +1631,9 @@ static bool select_grouped_effect_link(Editing *ed, Sequence *actseq, const int
|
|||||||
int machine = actseq->machine;
|
int machine = actseq->machine;
|
||||||
SeqIterator iter;
|
SeqIterator iter;
|
||||||
|
|
||||||
SEQ_CURRENT_BEGIN (ed, seq) {
|
LISTBASE_FOREACH (Sequence *, seq, SEQ_active_seqbase_get(ed)) {
|
||||||
seq->tmp = NULL;
|
seq->tmp = NULL;
|
||||||
}
|
}
|
||||||
SEQ_CURRENT_END;
|
|
||||||
|
|
||||||
actseq->tmp = POINTER_FROM_INT(true);
|
actseq->tmp = POINTER_FROM_INT(true);
|
||||||
|
|
||||||
@@ -1711,7 +1691,7 @@ static int sequencer_select_grouped_exec(bContext *C, wmOperator *op)
|
|||||||
{
|
{
|
||||||
Scene *scene = CTX_data_scene(C);
|
Scene *scene = CTX_data_scene(C);
|
||||||
Editing *ed = SEQ_editing_get(scene, false);
|
Editing *ed = SEQ_editing_get(scene, false);
|
||||||
Sequence *seq, *actseq = SEQ_select_active_get(scene);
|
Sequence *actseq = SEQ_select_active_get(scene);
|
||||||
|
|
||||||
if (actseq == NULL) {
|
if (actseq == NULL) {
|
||||||
BKE_report(op->reports, RPT_ERROR, "No active sequence!");
|
BKE_report(op->reports, RPT_ERROR, "No active sequence!");
|
||||||
@@ -1725,11 +1705,10 @@ static int sequencer_select_grouped_exec(bContext *C, wmOperator *op)
|
|||||||
bool changed = false;
|
bool changed = false;
|
||||||
|
|
||||||
if (!extend) {
|
if (!extend) {
|
||||||
SEQ_CURRENT_BEGIN (ed, seq) {
|
LISTBASE_FOREACH (Sequence *, seq, SEQ_active_seqbase_get(ed)) {
|
||||||
seq->flag &= ~SELECT;
|
seq->flag &= ~SELECT;
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
SEQ_CURRENT_END;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
@@ -51,15 +51,6 @@ typedef struct SeqIterator {
|
|||||||
} \
|
} \
|
||||||
((void)0)
|
((void)0)
|
||||||
|
|
||||||
#define SEQ_CURRENT_BEGIN(_ed, _seq) \
|
|
||||||
{ \
|
|
||||||
SeqIterator iter_macro; \
|
|
||||||
for (SEQ_iterator_begin(_ed, &iter_macro, true); iter_macro.valid; \
|
|
||||||
SEQ_iterator_next(&iter_macro)) { \
|
|
||||||
_seq = iter_macro.seq;
|
|
||||||
|
|
||||||
#define SEQ_CURRENT_END SEQ_ALL_END
|
|
||||||
|
|
||||||
void SEQ_iterator_begin(struct Editing *ed, SeqIterator *iter, const bool use_current_sequences);
|
void SEQ_iterator_begin(struct Editing *ed, SeqIterator *iter, const bool use_current_sequences);
|
||||||
void SEQ_iterator_next(SeqIterator *iter);
|
void SEQ_iterator_next(SeqIterator *iter);
|
||||||
void SEQ_iterator_end(SeqIterator *iter);
|
void SEQ_iterator_end(SeqIterator *iter);
|
||||||
|
Reference in New Issue
Block a user