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

Fix ghost keyframes created when pasting an effect to a clip that has a crop...

Fix ghost keyframes created when pasting an effect to a clip that has a crop start smaller than source clip and on clip speed resize
Related to #1394
parent 21c8731e
Pipeline #237008 passed with stage
in 15 minutes and 25 seconds
......@@ -1351,7 +1351,7 @@ const QString KeyframeModel::getAnimationStringWithOffset(std::shared_ptr<AssetP
} else {
for (int i = 0; i < anim.key_count(); ++i) {
int pos = anim.key_get_frame(i) + offset;
if (pos > 0) {
if (pos >= 0) {
anim.key_set_frame(i, pos);
}
}
......
......@@ -524,6 +524,7 @@ void KeyframeModelList::resizeKeyframes(int oldIn, int oldOut, int in, int out,
// qDebug()<<"/// \n\nKEYS TO DELETE: "<<positions<<"\n------------------------";
}
} else {
// Adjusting clip end
GenTime old_out(oldOut, pCore->getCurrentFps());
GenTime new_out(out, pCore->getCurrentFps());
Keyframe kf = getKeyframe(old_out, &ok);
......@@ -547,7 +548,6 @@ void KeyframeModelList::resizeKeyframes(int oldIn, int oldOut, int in, int out,
return;
}
}
positions << old_out;
}
if (toDel.first == GenTime()) {
......@@ -560,7 +560,7 @@ void KeyframeModelList::resizeKeyframes(int oldIn, int oldOut, int in, int out,
}
toDel = getNextKeyframe(toDel.first, &ok3);
}
if ((ok || positions.size() > 0) && !ok2) {
if ((ok || positions.size() > 0) && !ok2 && !singleKeyframe()) {
for (const auto &param : m_parameters) {
QVariant value = param.second->getInterpolatedValue(new_out);
param.second->addKeyframe(new_out, type, value, true, undo, redo);
......
Supports Markdown
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