Fix error in importing keyframes from clipboard

Related to #554
parent 7f8a64a5
Pipeline #14641 passed with stage
in 18 minutes and 6 seconds
......@@ -219,7 +219,8 @@ KeyframeImport::KeyframeImport(const QString &animData, std::shared_ptr<AssetPar
lay->addLayout(l1);
// Output offset
m_offsetPoint = new PositionWidget(i18n("Offset"), 0, 0, out, pCore->currentDoc()->timecode(), "", this);
int clipIn = m_model->data(indexes.first(), AssetParameterModel::ParentInRole).toInt();
m_offsetPoint = new PositionWidget(i18n("Offset"), clipIn, 0, clipIn + m_model->data(indexes.first(), AssetParameterModel::ParentDurationRole).toInt(), pCore->currentDoc()->timecode(), "", this);
lay->addWidget(m_offsetPoint);
// Source range
......@@ -654,7 +655,6 @@ void KeyframeImport::importSelectedData()
KeyframeModel *km = kfrModel->getKeyModel(ix);
qDebug()<<"== "<<ix<<" = "<<m_targetCombo->currentData().toModelIndex();
if (ix == m_targetCombo->currentData().toModelIndex()) {
qDebug()<<"= = = \n\nPROCESSING KF IMPORT LOP: "<<anim->key_count()<<"\n\n===";
// Import our keyframes
int frame = 0;
KeyframeImport::ImportRoles convertMode = static_cast<KeyframeImport::ImportRoles> (m_sourceCombo->currentData().toInt());
......
......@@ -2895,6 +2895,9 @@ void Bin::switchTag(const QString &tag, bool add)
// Check for folders
QList <QString> allClips;
for (const QModelIndex &ix : indexes) {
if (!ix.isValid() || ix.column() != 0) {
continue;
}
std::shared_ptr<AbstractProjectItem> parentItem = m_itemModel->getBinItemByIndex(m_proxyModel->mapToSource(ix));
if (parentItem->itemType() == AbstractProjectItem::FolderItem) {
QList<std::shared_ptr<ProjectClip>> children = std::static_pointer_cast<ProjectFolder>(parentItem)->childClips();
......
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