Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Fix effects with action button (auto mask). Fixes #21

Fix motion tracker (requires OpenCV and MLT explicitely compiled with --enable-opencv)
Fix sox/ladspa effects disappearing after changing param
Fix copy/import keyframes from keyboard
parent 5c4dbf15
Pipeline #2213 failed with stage
in 22 minutes and 17 seconds
......@@ -27,12 +27,12 @@
<parameter type="bool" name="obscure" default="1">
<name>Obscure</name>
</parameter>
<parameter type="filterjob" filtertag="autotrack_rectangle" filterparams="_serialize=1 motion_vector_list=0 %params in=%position" consumer="null" consumerparams="all=1 terminate_on_pause=1">
<parameter type="filterjob" filtertag="autotrack_rectangle" filterparams="_serialize=1 motion_vector_list=0" consumer="null" consumerparams="all=1 terminate_on_pause=1">
<name>Analyse</name>
<jobparam name="storedata" />
<jobparam name="projecttreefilter" />
<jobparam name="key">motion_vector_list</jobparam>
<jobparam name="finalfilter">autotrack_rectangle</jobparam>
<jobparam name="displaydataname">Motion vectors</jobparam>
<name>Analyse</name>
</parameter>
</effect>
......@@ -7,8 +7,8 @@
<name>Target Program Loudness</name>
</parameter>
<parameter type="filterjob" filtertag="loudness" filterparams="%params" consumer="null" consumerparams="video_off=1 all=1 terminate_on_pause=1">
<name>Analyse</name>
<jobparam name="key">results</jobparam>
<jobparam name="finalfilter">loudness</jobparam>
<name>Analyse</name>
</parameter>
</effect>
......@@ -7,8 +7,8 @@
<name>Gain</name>
</parameter>
<parameter type="filterjob" filtertag="sox:analysis" filterparams="" consumer="null" consumerparams="video_off=1 all=1 terminate_on_pause=1">
<name>Normalize</name>
<jobparam name="key">gain</jobparam>
<jobparam name="finalfilter">sox_gain</jobparam>
<name>Normalize</name>
</parameter>
</effect>
......@@ -29,12 +29,13 @@
</parameter>
<parameter type="readonly" name="results" value="">
<name>Tracking data</name>
<comment>Click to copy to clipboard</comment>
</parameter>
<conditionalinfo>Filter is in preview mode. Click Analyse to see real effect</conditionalinfo>
<parameter type="filterjob" filtertag="opencv.tracker" filterparams="%params" consumer="null" consumerparams=" all=1 terminate_on_pause=1">
<parameter type="filterjob" filtertag="opencv.tracker" consumer="null" consumerparams=" all=1 terminate_on_pause=1">
<name conditional="Reset">Analyse</name>
<jobparam name="conditionalinfo">Filter is in preview mode. Click Analyse to see real effect</jobparam>
<jobparam name="key">results</jobparam>
<jobparam name="finalfilter">opencv.tracker</jobparam>
<jobparam name="displaydataname">Motion tracking</jobparam>
<name conditional="Reset">Analyse</name>
<jobparam name="displaydataname">Motion tracking</jobparam>
</parameter>
</effect>
......@@ -18,6 +18,7 @@ set(kdenlive_SRCS
assets/view/widgets/abstractparamwidget.cpp
# assets/view/widgets/animationwidget.cpp
assets/view/widgets/boolparamwidget.cpp
assets/view/widgets/buttonparamwidget.cpp
assets/view/widgets/switchparamwidget.cpp
assets/view/widgets/urlparamwidget.cpp
assets/view/widgets/doubleparamwidget.cpp
......@@ -31,6 +32,7 @@ set(kdenlive_SRCS
assets/view/widgets/positioneditwidget.cpp
assets/view/widgets/coloreditwidget.cpp
assets/view/widgets/hideparamwidget.cpp
assets/view/widgets/clickablelabelwidget.cpp
# curves widget
assets/view/widgets/curves/abstractcurvewidget.h
assets/view/widgets/curves/bezier/beziersplineeditor.cpp
......
......@@ -1146,12 +1146,13 @@ QList<QPoint> KeyframeModel::getRanges(const QString &animData, const std::share
return result;
}
std::shared_ptr<Mlt::Properties> KeyframeModel::getAnimation(const QString &animData)
std::shared_ptr<Mlt::Properties> KeyframeModel::getAnimation(std::shared_ptr<AssetParameterModel> model, const QString &animData, int duration)
{
std::shared_ptr<Mlt::Properties> mlt_prop(new Mlt::Properties());
model->passProperties(*mlt_prop.get());
mlt_prop->set("key", animData.toUtf8().constData());
// This is a fake query to force the animation to be parsed
(void)mlt_prop->anim_get_rect("key", 0, 0);
(void)mlt_prop->anim_get_rect("key", 0, duration);
return mlt_prop;
}
......
......@@ -62,6 +62,7 @@ public:
enum { TypeRole = Qt::UserRole + 1, PosRole, FrameRole, ValueRole, NormalizedValueRole };
friend class KeyframeModelList;
friend class KeyframeWidget;
friend class KeyframeImport;
protected:
/** @brief These methods should ONLY be called by keyframemodellist to ensure synchronisation
......@@ -164,7 +165,7 @@ public:
QHash<int, QByteArray> roleNames() const override;
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
static QList<QPoint> getRanges(const QString &animData, const std::shared_ptr<AssetParameterModel> &model);
static std::shared_ptr<Mlt::Properties> getAnimation(const QString &animData);
static std::shared_ptr<Mlt::Properties> getAnimation(std::shared_ptr<AssetParameterModel> model, const QString &animData, int duration = 0);
protected:
/** @brief Helper function that generate a lambda to change type / value of given keyframe */
......
......@@ -345,7 +345,7 @@ KeyframeModel *KeyframeModelList::getKeyModel()
KeyframeModel *KeyframeModelList::getKeyModel(const QPersistentModelIndex &index)
{
if (m_parameters.size() > 0) {
if (m_parameters.size() > 0 && m_parameters.find(index) != m_parameters.end()) {
return m_parameters.at(index).get();
}
return nullptr;
......
This diff is collapsed.
......@@ -79,6 +79,7 @@ public:
NameRole = Qt::UserRole + 1,
TypeRole,
CommentRole,
AlternateNameRole,
MinRole,
MaxRole,
DefaultRole,
......@@ -90,6 +91,8 @@ public:
ListNamesRole,
FactorRole,
FilterRole,
FilterJobParamsRole,
FilterParamsRole,
ScaleRole,
OpacityRole,
RelativePosRole,
......@@ -128,12 +131,11 @@ public:
*/
Q_INVOKABLE void setParameter(const QString &name, const QString &paramValue, bool update = true, const QModelIndex &paramIndex = QModelIndex());
void setParameter(const QString &name, int value, bool update = true);
Q_INVOKABLE void setParameter(const QString &name, double &value);
/* @brief Return all the parameters as pairs (parameter name, parameter value) */
QVector<QPair<QString, QVariant>> getAllParameters() const;
/* @brief Returns a json definition of the effect with all param values */
QJsonDocument toJson() const;
QJsonDocument toJson(bool includeFixed = true) const;
void savePreset(const QString &presetFile, const QString &presetName);
void deletePreset(const QString &presetFile, const QString &presetName);
const QStringList getPresetList(const QString &presetFile) const;
......@@ -179,6 +181,7 @@ protected:
If keywords are found, mathematical operations are supported for double type params. For example "%width -1" is a valid value.
*/
static QVariant parseAttribute(const ObjectId &owner, const QString &attribute, const QDomElement &element, QVariant defaultValue = QVariant());
QVariant parseSubAttributes(const QString &attribute, const QDomElement &element) const;
/* @brief Helper function to register one more parameter that is keyframable.
@param index is the index corresponding to this parameter
......@@ -206,6 +209,11 @@ protected:
// if true, keyframe tools will be hidden by default
bool m_hideKeyframesByDefault;
/* @brief Set the parameter with given name to the given value. This should be called when first
* building an effect in the constructor, so that we don't call shared_from_this
*/
void internalSetParameter(const QString &name, const QString &paramValue, const QModelIndex &paramIndex = QModelIndex());
signals:
void modelChanged();
/** @brief inform child effects (in case of bin effect with timeline producers)
......
......@@ -19,6 +19,7 @@
#include "abstractparamwidget.hpp"
#include "assets/model/assetparametermodel.hpp"
#include "buttonparamwidget.hpp"
#include "boolparamwidget.hpp"
#include "coloreditwidget.hpp"
#include "curves/bezier/beziersplineeditor.h"
......@@ -26,6 +27,7 @@
#include "curves/cubic/kis_curve_widget.h"
#include "curves/curveparamwidget.h"
#include "doubleparamwidget.hpp"
#include "clickablelabelwidget.hpp"
#include "geometryeditwidget.hpp"
#include "hideparamwidget.hpp"
#include "keyframewidget.hpp"
......@@ -125,6 +127,14 @@ AbstractParamWidget *AbstractParamWidget::construct(const std::shared_ptr<AssetP
widget = new HideParamWidget(model, index, parent);
break;
}
case ParamType::Filterjob: {
widget = new ButtonParamWidget(model, index, parent);
break;
}
case ParamType::Readonly: {
widget = new ClickableLabelParamWidget(model, index, parent);
break;
}
case ParamType::Animated:
case ParamType::RestrictedAnim:
// widget = new AnimationWidget(model, index, range, parent);
......@@ -135,8 +145,6 @@ AbstractParamWidget *AbstractParamWidget::construct(const std::shared_ptr<AssetP
case ParamType::Addedgeometry:
case ParamType::Keywords:
case ParamType::Fontfamily:
case ParamType::Filterjob:
case ParamType::Readonly:
// not reimplemented
widget = new Unsupported(model, index, parent);
static_cast<Unsupported *>(widget)->setText(name);
......
/***************************************************************************
* Copyright (C) 2019 by Jean-Baptiste Mardelle *
* This file is part of Kdenlive. See www.kdenlive.org. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) version 3 or any later version accepted by the *
* membership of KDE e.V. (or its successor approved by the membership *
* of KDE e.V.), which shall act as a proxy defined in Section 14 of *
* version 3 of the license. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "buttonparamwidget.hpp"
#include "assets/model/assetparametermodel.hpp"
#include "jobs/filterclipjob.h"
#include "jobs/jobmanager.h"
#include "assets/model/assetcommand.hpp"
#include "core.h"
#include <mlt++/Mlt.h>
#include <KMessageWidget>
#include <QPushButton>
#include <QHBoxLayout>
ButtonParamWidget::ButtonParamWidget(std::shared_ptr<AssetParameterModel> model, QModelIndex index, QWidget *parent)
: AbstractParamWidget(std::move(model), index, parent)
, m_label(nullptr)
{
// setup the comment
m_buttonName = m_model->data(m_index, Qt::DisplayRole).toString();
m_alternatebuttonName = m_model->data(m_index, AssetParameterModel::AlternateNameRole).toString();
//QString name = m_model->data(m_index, AssetParameterModel::NameRole).toString();
QString comment = m_model->data(m_index, AssetParameterModel::CommentRole).toString();
setToolTip(comment);
auto *layout = new QVBoxLayout(this);
QVariantList filterData = m_model->data(m_index, AssetParameterModel::FilterJobParamsRole).toList();
QStringList filterAddedParams = m_model->data(m_index, AssetParameterModel::FilterParamsRole).toString().split(QLatin1Char(' '), QString::SkipEmptyParts);
QString conditionalInfo;
for (const QVariant jobElement : filterData) {
QStringList d = jobElement.toStringList();
if (d.size() == 2) {
if (d.at(0) == QLatin1String("conditionalinfo")) {
conditionalInfo = d.at(1);
} else if (d.at(0) == QLatin1String("key")) {
m_keyParam = d.at(1);
}
}
}
QVector<QPair<QString, QVariant>> filterParams = m_model->getAllParameters();
m_displayConditional = true;
for (const auto &param : filterParams) {
if (param.first == m_keyParam) {
if (!param.second.toString().isEmpty()) {
m_displayConditional = false;
}
break;
}
}
if (!conditionalInfo.isEmpty()) {
m_label = new KMessageWidget(conditionalInfo, this);
m_label->setWordWrap(true);
layout->addWidget(m_label);
m_label->setVisible(m_displayConditional);
}
//layout->setContentsMargins(0, 0, 0, 2);
//layout->setSpacing(0);
m_button = new QPushButton(m_displayConditional ? m_buttonName : m_alternatebuttonName, this);
layout->addWidget(m_button);
// emit the signal of the base class when appropriate
connect(this->m_button, &QPushButton::clicked, [&, filterData, filterAddedParams]() {
// Trigger job
if (!m_displayConditional) {
QVector<QPair<QString, QVariant>> values;
values << QPair<QString, QVariant>(m_keyParam,QVariant());
auto *command = new AssetUpdateCommand(m_model, values);
pCore->pushUndo(command);
return;
}
QVector<QPair<QString, QVariant>> filterLastParams = m_model->getAllParameters();
ObjectId owner = m_model->getOwnerId();
const QString assetId = m_model->getAssetId();
QString binId;
int cid = -1;
int in = -1;
int out = -1;
if (owner.first == ObjectType::BinClip) {
binId = QString::number(owner.second);
} else if (owner.first == ObjectType::TimelineClip) {
cid = owner.second;
binId = pCore->getTimelineClipBinId(cid);
in = pCore->getItemIn(owner);
out = in + pCore->getItemDuration(owner);
}
std::unordered_map<QString, QVariant> fParams;
std::unordered_map<QString, QString> fData;
for (const QVariant jobElement : filterData) {
QStringList d = jobElement.toStringList();
if (d.size() == 2)
fData.insert({d.at(0), d.at(1)});
}
for (const auto &param : filterLastParams) {
fParams.insert({param.first, param.second});
}
for (const QString &fparam : filterAddedParams) {
if (fparam.contains(QLatin1Char('='))) {
fParams.insert({fparam.section(QLatin1Char('='), 0, 0), fparam.section(QLatin1Char('='), 1)});
}
}
pCore->jobManager()->startJob<FilterClipJob>({binId}, -1, QString(), cid, m_model, assetId, in, out, assetId, fParams, fData);
if (m_label) {
m_label->setVisible(false);
}
m_button->setEnabled(false);
});
}
void ButtonParamWidget::slotShowComment(bool show)
{
Q_UNUSED(show);
//if (!m_labelComment->text().isEmpty()) {
// m_widgetComment->setVisible(show);
//}
}
void ButtonParamWidget::slotRefresh()
{
QVector<QPair<QString, QVariant>> filterParams = m_model->getAllParameters();
m_displayConditional = true;
for (const auto &param : filterParams) {
if (param.first == m_keyParam && !param.second.isNull()) {
m_displayConditional = false;
break;
}
}
if (m_label) {
m_label->setVisible(m_displayConditional);
}
m_button->setText(m_displayConditional ? m_buttonName : m_alternatebuttonName);
m_button->setEnabled(true);
updateGeometry();
}
bool ButtonParamWidget::getValue()
{
return true;
}
/***************************************************************************
* Copyright (C) 2019 by Jean-Baptiste Mardelle *
* This file is part of Kdenlive. See www.kdenlive.org. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) version 3 or any later version accepted by the *
* membership of KDE e.V. (or its successor approved by the membership *
* of KDE e.V.), which shall act as a proxy defined in Section 14 of *
* version 3 of the license. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef BUTTONPARAMWIDGET_H
#define BUTTONPARAMWIDGET_H
#include "abstractparamwidget.hpp"
#include <QWidget>
class QPushButton;
class KMessageWidget;
/** @brief This class represents a parameter that requires
the user to choose tick a checkbox
*/
class ButtonParamWidget : public AbstractParamWidget
{
Q_OBJECT
public:
/** @brief Constructor for the widgetComment
@param name String containing the name of the parameter
@param comment Optional string containing the comment associated to the parameter
@param checked Boolean indicating whether the checkbox should initially be checked
@param parent Parent widget
*/
ButtonParamWidget(std::shared_ptr<AssetParameterModel> model, QModelIndex index, QWidget *parent);
/** @brief Returns the current value of the parameter
*/
bool getValue();
public slots:
/** @brief Toggle the comments on or off
*/
void slotShowComment(bool show) override;
/** @brief refresh the properties to reflect changes in the model
*/
void slotRefresh() override;
private:
QPushButton *m_button;
KMessageWidget *m_label;
QString m_keyParam;
QString m_buttonName;
QString m_alternatebuttonName;
bool m_displayConditional;
};
#endif
/***************************************************************************
* Copyright (C) 2019 by Jean-Baptiste Mardelle *
* This file is part of Kdenlive. See www.kdenlive.org. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) version 3 or any later version accepted by the *
* membership of KDE e.V. (or its successor approved by the membership *
* of KDE e.V.), which shall act as a proxy defined in Section 14 of *
* version 3 of the license. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#include "clickablelabelwidget.hpp"
#include "assets/model/assetparametermodel.hpp"
#include "jobs/filterclipjob.h"
#include "jobs/jobmanager.h"
#include "core.h"
#include <QPushButton>
#include <QHBoxLayout>
#include <QClipboard>
#include <QLabel>
#include <QApplication>
ClickableLabelParamWidget::ClickableLabelParamWidget(std::shared_ptr<AssetParameterModel> model, QModelIndex index, QWidget *parent)
: AbstractParamWidget(std::move(model), index, parent)
{
// setup the comment
m_displayName = m_model->data(m_index, Qt::DisplayRole).toString();
QString name = m_model->data(m_index, AssetParameterModel::NameRole).toString();
QString comment = m_model->data(m_index, AssetParameterModel::CommentRole).toString();
setToolTip(comment);
auto *layout = new QVBoxLayout(this);
m_label = new QLabel(this);
m_label->setWordWrap(true);
layout->addWidget(m_label);
connect(m_label, &QLabel::linkActivated, [&](const QString &result) {
QClipboard *clipboard = QApplication::clipboard();
clipboard->setText(result);
});
slotRefresh();
}
void ClickableLabelParamWidget::slotShowComment(bool show)
{
Q_UNUSED(show);
/*if (!m_labelComment->text().isEmpty()) {
m_widgetComment->setVisible(show);
}*/
}
void ClickableLabelParamWidget::slotRefresh()
{
QString value = m_model->data(m_index, AssetParameterModel::ValueRole).toString();
m_label->setText(QStringLiteral("<a href=\"%1\">").arg(value) + m_displayName + QStringLiteral("</a>"));
m_label->setVisible(!value.isEmpty());
}
bool ClickableLabelParamWidget::getValue()
{
return true;
}
/***************************************************************************
* Copyright (C) 2019 by Jean-Baptiste Mardelle *
* This file is part of Kdenlive. See www.kdenlive.org. *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) version 3 or any later version accepted by the *
* membership of KDE e.V. (or its successor approved by the membership *
* of KDE e.V.), which shall act as a proxy defined in Section 14 of *
* version 3 of the license. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifndef CLICKABLEPARAMWIDGET_H
#define CLICKABLEPARAMWIDGET_H
#include "abstractparamwidget.hpp"
#include <QWidget>
class QPushButton;
class QLabel;
/** @brief This class represents a parameter that requires
the user to choose tick a checkbox
*/
class ClickableLabelParamWidget : public AbstractParamWidget
{
Q_OBJECT
public:
/** @brief Constructor for the widgetComment
@param name String containing the name of the parameter
@param comment Optional string containing the comment associated to the parameter
@param checked Boolean indicating whether the checkbox should initially be checked
@param parent Parent widget
*/
ClickableLabelParamWidget(std::shared_ptr<AssetParameterModel> model, QModelIndex index, QWidget *parent);
/** @brief Returns the current value of the parameter
*/
bool getValue();
public slots:
/** @brief Toggle the comments on or off
*/
void slotShowComment(bool show) override;
/** @brief refresh the properties to reflect changes in the model
*/
void slotRefresh() override;
private:
QLabel *m_label;
QString m_displayName;
};
#endif
This diff is collapsed.
......@@ -44,14 +44,17 @@ class KeyframeImport : public QDialog
{
Q_OBJECT
public:
explicit KeyframeImport(int in, int out, const QString &animData, std::shared_ptr<AssetParameterModel> model, QList<QPersistentModelIndex> indexes,
explicit KeyframeImport(const QString &animData, std::shared_ptr<AssetParameterModel> model, QList<QPersistentModelIndex> indexes,
QWidget *parent = nullptr);
~KeyframeImport() override;
QString selectedData() const;
void importSelectedData();
QString selectedTarget() const;
int getImportType() const;
private:
std::shared_ptr<AssetParameterModel> m_model;
QList<QPersistentModelIndex> m_indexes;
bool m_supportsAnim;
QComboBox *m_dataCombo;
QLabel *m_previewLabel;
......@@ -69,12 +72,23 @@ private:
QDoubleSpinBox m_destMin;
QDoubleSpinBox m_destMax;
/** @brief Contains the 4 dimensional (x,y,w,h) target parameter names / tag **/
QMap<QString, QString> m_geometryTargets;
QMap<QString, QModelIndex> m_geometryTargets;
/** @brief Contains the 1 dimensional target parameter names / tag **/
QMap<QString, QString> m_simpleTargets;
QMap<QString, QModelIndex> m_simpleTargets;
bool m_isReady;
void drawKeyFrameChannels(QPixmap &pix, int in, int out, int limitKeyframes, const QColor &textColor);
protected:
enum ImportRoles {
SimpleValue,
FullGeometry,
Position,
XOnly,
YOnly,
WidthOnly,
HeightOnly
};
mutable QReadWriteLock m_lock; // This is a lock that ensures safety in case of concurrent access
void resizeEvent(QResizeEvent *ev) override;
private slots:
......
......@@ -22,7 +22,6 @@
#include "assets/keyframes/model/keyframemodellist.hpp"
#include "assets/keyframes/model/rotoscoping/rotohelper.hpp"
#include "assets/keyframes/view/keyframeview.hpp"
#include "assets/model/assetcommand.hpp"
#include "assets/model/assetparametermodel.hpp"
#include "assets/view/widgets/keyframeimport.h"
#include "core.h"
......@@ -454,7 +453,7 @@ void KeyframeWidget::showKeyframes(bool enable)
void KeyframeWidget::slotCopyKeyframes()
{
QJsonDocument effectDoc = m_model->toJson();
QJsonDocument effectDoc = m_model->toJson(false);
if (effectDoc.isEmpty()) {
return;
}
......@@ -466,39 +465,21 @@ void KeyframeWidget::slotImportKeyframes()
{
QClipboard *clipboard = QApplication::clipboard();
QString values = clipboard->text();
int inPos = m_model->data(m_index, AssetParameterModel::ParentInRole).toInt();
int outPos = inPos + m_model->data(m_index, AssetParameterModel::ParentDurationRole).toInt();
QList<QPersistentModelIndex> indexes;
for (const auto &w : m_parameters) {
indexes << w.first;
}
QPointer<KeyframeImport> import = new KeyframeImport(inPos, outPos, values, m_model, indexes, this);
QPointer<KeyframeImport> import = new KeyframeImport(values, m_model, indexes, this);
if (import->exec() != QDialog::Accepted) {
delete import;
return;
}
QString keyframeData = import->selectedData();
QString tag = import->selectedTarget();
qDebug() << "// CHECKING FOR TARGET PARAM: " << tag;
// m_model->setParameter(tag, keyframeData, true);
/*for (const auto &w : m_parameters) {
qDebug()<<"// GOT PARAM: "<<m_model->data(w.first, AssetParameterModel::NameRole).toString();
if (tag == m_model->data(w.first, AssetParameterModel::NameRole).toString()) {
qDebug()<<"// PASSING DTAT: "<<keyframeData;
m_model->getKeyframeModel()->getKeyModel()->parseAnimProperty(keyframeData);