Commit dbf9e4e6 authored by Julius Künzel's avatar Julius Künzel
Browse files

[Effect Keyframes] Fix "apply current value" uses wrong position

parent db588a07
......@@ -397,6 +397,13 @@ QVariant KeyframeModelList::getInterpolatedValue(int pos, const QPersistentModel
return m_parameters.at(index)->getInterpolatedValue(pos);
}
QVariant KeyframeModelList::getInterpolatedValue(const GenTime &pos, const QPersistentModelIndex &index) const
{
READ_LOCK();
Q_ASSERT(m_parameters.count(index) > 0);
return m_parameters.at(index)->getInterpolatedValue(pos);
}
KeyframeModel *KeyframeModelList::getKeyModel()
{
if (m_inTimelineIndex.isValid()) {
......
......@@ -115,6 +115,11 @@ public:
@param pos is the position where we interpolate
@param index is the index of the queried parameter. */
QVariant getInterpolatedValue(int pos, const QPersistentModelIndex &index) const;
/** @brief Return the interpolated value of a parameter.
@param pos is the position where we interpolate
@param index is the index of the queried parameter. */
QVariant getInterpolatedValue(const GenTime &pos, const QPersistentModelIndex &index) const;
/** @brief Load keyframes from the current parameter value. */
void refresh();
......
......@@ -810,7 +810,7 @@ void KeyframeView::copyCurrentValue(QModelIndex ix, const QString paramName)
auto *parentCommand = new QUndoCommand();
bool multiParams = paramName.contains(QLatin1Char(' '));
for (int &kfrIx : m_model->selectedKeyframes()) {
QString oldValue = m_model->getInterpolatedValue(kfrIx, ix).toString();
QString oldValue = m_model->getInterpolatedValue(m_model->getPosAtIndex(kfrIx), ix).toString();
QStringList oldVals = oldValue.split(QLatin1Char(' '));
bool found = false;
if (paramName.contains(QLatin1String("spinX"))) {
......
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