nodes: implemented core of manual table value selection

This commit is contained in:
itsmattkc
2021-09-07 15:27:07 -07:00
parent a3ac761b55
commit a0706a78d8
71 changed files with 517 additions and 434 deletions
+9 -13
View File
@@ -51,27 +51,23 @@ QString TimeInput::Description() const
return tr("Generates the time (in seconds) at this frame.");
}
NodeValueTable TimeInput::Value(const QString &output, NodeValueDatabase &value) const
void TimeInput::Value(const QString &output, const NodeValueRow &value, const NodeGlobals &globals, NodeValueTable *table) const
{
Q_UNUSED(output)
NodeValueTable table = value.Merge();
table.Push(NodeValue::kFloat,
value[QStringLiteral("global")].Get(NodeValue::kFloat, QStringLiteral("time_in")),
this,
false,
QStringLiteral("time"));
return table;
table->Push(NodeValue::kFloat,
globals.time().in().toDouble(),
this,
false,
QStringLiteral("time"));
}
void TimeInput::Hash(const QString &output, QCryptographicHash &hash, const rational &time, const VideoParams &video_params) const
void TimeInput::Hash(const QString &output, QCryptographicHash &hash, const NodeGlobals &globals, const VideoParams &video_params) const
{
Node::Hash(output, hash, time, video_params);
Node::Hash(output, hash, globals, video_params);
// Make sure time is hashed
hash.addData(NodeValue::ValueToBytes(NodeValue::kRational, QVariant::fromValue(time)));
hash.addData(NodeValue::ValueToBytes(NodeValue::kFloat, globals.time().in().toDouble()));
}
}