Commit 95070257 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix timeline preview not invalidated when disabling effect

Related to #478
parent 2faf8c45
Pipeline #11736 passed with stage
in 32 minutes and 17 seconds
......@@ -3271,7 +3271,7 @@ void Bin::showBinFrame(QModelIndex ix, int frame)
void Bin::invalidateClip(const QString &binId)
{
std::shared_ptr<ProjectClip> clip = getBinClip(binId);
if (clip) {
if (clip && clip->clipType() != ClipType::Audio) {
QList<int> ids = clip->timelineInstances();
for (int i : ids) {
pCore->invalidateItem({ObjectType::TimelineClip,i});
......
......@@ -196,6 +196,7 @@ void EffectItemModel::updateEnable()
{
filter().set("disable", isEnabled() ? 0 : 1);
pCore->refreshProjectItem(m_ownerId);
pCore->invalidateItem(m_ownerId);
const QModelIndex start = AssetParameterModel::index(0, 0);
const QModelIndex end = AssetParameterModel::index(rowCount() - 1, 0);
emit dataChanged(start, end, QVector<int>());
......
......@@ -1529,7 +1529,11 @@ void TimelineController::removeSpace(int trackId, int frame, bool affectAllTrack
void TimelineController::invalidateItem(int cid)
{
if (!m_timelinePreview || !m_model->isItem(cid) || m_model->getItemTrackId(cid) == -1) {
if (!m_timelinePreview || !m_model->isItem(cid)) {
return;
}
const int tid = m_model->getItemTrackId(cid);
if (tid == -1 || m_model->getTrackById_const(tid)->isAudioTrack()) {
return;
}
int start = m_model->getItemPosition(cid);
......@@ -1539,7 +1543,7 @@ void TimelineController::invalidateItem(int cid)
void TimelineController::invalidateTrack(int tid)
{
if (!m_timelinePreview || !m_model->isTrack(tid)) {
if (!m_timelinePreview || !m_model->isTrack(tid) || m_model->getTrackById_const(tid)->isAudioTrack()) {
return;
}
for (auto clp : m_model->getTrackById_const(tid)->m_allClips) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment