keyframes: implemented copying/pasting

This commit is contained in:
itsmattkc
2022-05-10 15:42:09 -07:00
parent af9e54504c
commit 182e1599af
24 changed files with 567 additions and 160 deletions
+30
View File
@@ -129,6 +129,36 @@ void CurveWidget::DeleteSelected()
view_->DeleteSelected();
}
Node *CurveWidget::GetSelectedNodeWithID(const QString &id)
{
for (auto it=view_->GetConnections().cbegin(); it!=view_->GetConnections().cend(); it++) {
Node *n = it.key().input().node();
if (n->id() == id) {
return n;
}
}
return nullptr;
}
bool CurveWidget::CopySelected(bool cut)
{
if (super::CopySelected(cut)) {
return true;
}
return view_->CopySelected(cut);
}
bool CurveWidget::Paste()
{
if (super::Paste()) {
return true;
}
return view_->Paste(std::bind(&CurveWidget::GetSelectedNodeWithID, this, std::placeholders::_1));
}
void CurveWidget::SetNodes(const QVector<Node *> &nodes)
{
tree_view_->SetNodes(nodes);