various: moved time from viewer UI to viewer node

This commit is contained in:
itsmattkc
2022-10-23 20:56:04 -07:00
parent fc56058e8a
commit d1545745d8
47 changed files with 259 additions and 418 deletions
+6 -2
View File
@@ -204,6 +204,10 @@ bool KeyframeView::CopySelected(bool cut)
bool KeyframeView::Paste(std::function<Node *(const QString &)> find_node_function)
{
if (!GetViewerNode()) {
return false;
}
ProjectSerializer::Result res = ProjectSerializer::Paste(QStringLiteral("keyframes"));
if (res == ProjectSerializer::kSuccess) {
const ProjectSerializer::SerializedKeyframes &keys = res.GetLoadData().keyframes;
@@ -216,7 +220,7 @@ bool KeyframeView::Paste(std::function<Node *(const QString &)> find_node_functi
min = std::min(min, key->time());
}
}
min -= GetTime();
min -= GetViewerNode()->GetPlayhead();
for (auto it=keys.cbegin(); it!=keys.cend(); it++) {
const QString &paste_id = it.key();
@@ -454,7 +458,7 @@ void KeyframeView::ScaleChangedEvent(const double &scale)
Redraw();
}
void KeyframeView::TimeTargetChangedEvent(Node *target)
void KeyframeView::TimeTargetChangedEvent(ViewerOutput *v)
{
Redraw();
}