diff --git a/plugins/dockers/animation/timeline_frames_model.cpp b/plugins/dockers/animation/timeline_frames_model.cpp --- a/plugins/dockers/animation/timeline_frames_model.cpp +++ b/plugins/dockers/animation/timeline_frames_model.cpp @@ -71,6 +71,7 @@ QPointer dummiesFacade; KisImageWSP image; + QList cutCopyRoots; bool needFinishInsertRows; bool needFinishRemoveRows; @@ -585,15 +586,27 @@ stream << indexes.size(); stream << baseRow << baseColumn; + m_d->cutCopyRoots.clear(); + Q_FOREACH (const QModelIndex &index, indexes) { KisNodeSP node = nodeAt(index); + KisNodeSP tempNode = node->clone(); + + m_d->cutCopyRoots.append(tempNode); + KIS_SAFE_ASSERT_RECOVER(node) { continue; } stream << index.row() - baseRow << index.column() - baseColumn; - const QByteArray uuidData = node->uuid().toRfc4122(); + const QByteArray uuidData = tempNode->uuid().toRfc4122(); stream << int(uuidData.size()); stream.writeRawData(uuidData.data(), uuidData.size()); + + if(copyPolicy == TimelineFramesModel::MoveFramesPolicy) { + KisKeyframeChannel *channel = channelsAt(index).values().at(0); + KisKeyframeSP frame = channel->keyframeAt(index.column()); + channel->deleteKeyframe(frame, 0); + } } stream << int(copyPolicy); @@ -645,7 +658,6 @@ const QPoint offset(parent.column() - baseColumn, parent.row() - baseRow); KisAnimationUtils::FrameMovePairList frameMoves; - for (int i = 0; i < size; i++) { int relRow, relColumn; stream >> relRow >> relColumn; @@ -663,7 +675,7 @@ if (!nodeUuid.isNull()) { KisNodeUuidInfo nodeInfo(nodeUuid); - srcNode = nodeInfo.findNode(m_d->image->root()); + srcNode = nodeInfo.findNode(m_d->cutCopyRoots.at(i)); } else { QModelIndex index = this->index(srcRow, srcColumn); srcNode = nodeAt(index);