timeline: avoid duplicate items or item dependencies when pasting
God damn this was a big oof. Pasting was inadvertently making duplicates of the footage node(s) every single time. Worst case was if the clip was connected to a nested sequence. Every time someone copy/pasted in my large-scale project, it would add another 1000 nodes to the project. It's about fucking time this was fixed.
This commit is contained in:
@@ -1938,7 +1938,7 @@ bool TimelineWidget::PasteInternal(bool insert)
|
||||
return false;
|
||||
}
|
||||
|
||||
ProjectSerializer::Result res = ProjectSerializer::Paste(ProjectSerializer::kOnlyNodes);
|
||||
ProjectSerializer::Result res = ProjectSerializer::Paste(ProjectSerializer::kOnlyNodes, GetConnectedNode()->project());
|
||||
if (res.GetLoadData().nodes.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
@@ -1953,6 +1953,13 @@ bool TimelineWidget::PasteInternal(bool insert)
|
||||
}
|
||||
}
|
||||
|
||||
qDebug() << "pasing" << res.GetLoadData().nodes.size() << "nodes";
|
||||
|
||||
for (auto it = res.GetLoadData().promised_connections.cbegin(); it != res.GetLoadData().promised_connections.cend(); it++) {
|
||||
auto oc = *it;
|
||||
command->add_child(new NodeEdgeAddCommand(oc.first, oc.second));
|
||||
}
|
||||
|
||||
rational paste_start = GetConnectedNode()->GetPlayhead();
|
||||
|
||||
if (insert) {
|
||||
|
||||
Reference in New Issue
Block a user