Fix pan & zoom effect (paste, edit after reloading project)

parent 25bfb2d2
......@@ -269,6 +269,13 @@ void ClipItem::initEffect(QDomElement effect, int diff, int offset)
e.setAttribute("keyframes", adjusted);
}
}
if (e.attribute("type") == "geometry" && !e.hasAttribute("fixed")) {
// Effects with a geometry parameter need to sync in / out with parent clip
effect.setAttribute("in", QString::number(cropStart().frames(m_fps)));
effect.setAttribute("out", QString::number((cropStart() + cropDuration()).frames(m_fps) - 1));
effect.setAttribute("_sync_in_out", "1");
}
}
if (effect.attribute("tag") == "volume" || effect.attribute("tag") == "brightness") {
if (effect.attribute("id") == "fadeout" || effect.attribute("id") == "fade_to_black") {
......
......@@ -1850,6 +1850,7 @@ void CustomTrackView::slotAddEffect(QDomElement effect, GenTime pos, int track)
if (!clip->isSelected()) {
clearSelection(false);
clip->setSelected(true);
m_dragItem = clip;
emit clipItemSelected(clip);
}
break;
......
......@@ -887,10 +887,11 @@ void TrackView::slotAddProjectEffects(QDomNodeList effects, QDomElement parentNo
} else {
// Check if effect has in/out points
if (effect.hasAttribute("in")) {
EffectsList::setParameter(currenteffect, "in", effect.attribute("in"));
currenteffect.setAttribute("in", effect.attribute("in"));
currenteffect.setAttribute("_sync_in_out", "1");
}
if (effect.hasAttribute("out")) {
EffectsList::setParameter(currenteffect, "out", effect.attribute("out"));
currenteffect.setAttribute("out", effect.attribute("out"));
}
}
......
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