Files
test2/source/blender/sequencer/intern/strip_select.cc
Hans Goudey a5d5eca487 Cleanup: Sequencer: Replace seqbasep variable access with function
With the aim of removing `seqbasep` to remove the complicated logic for
repairing pointers within the `Strip` struct when loading files and undo
steps, this commit just moves access of the variable behind a function.
In the future the function will retrieve the list from a Strip pointer,
for now it just returns the existing pointer.

Overall motivation is that blend file pointer manipulation is incompatible
with the changes required for #127706.

Pull Request: https://projects.blender.org/blender/blender/pulls/144624
2025-08-18 15:39:58 +02:00

69 lines
1.3 KiB
C++

/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
* SPDX-FileCopyrightText: 2003-2009 Blender Authors
* SPDX-FileCopyrightText: 2005-2006 Peter Schlaile <peter [at] schlaile [dot] de>
*
* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup bke
*/
#include "DNA_scene_types.h"
#include "DNA_sequence_types.h"
#include "BLI_listbase.h"
#include "SEQ_select.hh"
#include "SEQ_sequencer.hh"
namespace blender::seq {
Strip *select_active_get(const Scene *scene)
{
const Editing *ed = editing_get(scene);
if (ed == nullptr) {
return nullptr;
}
return ed->act_strip;
}
void select_active_set(Scene *scene, Strip *strip)
{
Editing *ed = editing_get(scene);
if (ed == nullptr) {
return;
}
ed->act_strip = strip;
}
bool select_active_get_pair(Scene *scene, Strip **r_strip_act, Strip **r_strip_other)
{
Editing *ed = editing_get(scene);
*r_strip_act = select_active_get(scene);
if (*r_strip_act == nullptr) {
return false;
}
*r_strip_other = nullptr;
LISTBASE_FOREACH (Strip *, strip, ed->current_strips()) {
if (strip->flag & SELECT && (strip != (*r_strip_act))) {
if (*r_strip_other) {
return false;
}
*r_strip_other = strip;
}
}
return (*r_strip_other != nullptr);
}
} // namespace blender::seq