implemented value node

Also implements changes necessary to support an input data type
that changes. Much of that foundation was built in
`nodearchchanges`, but hadn't been finalized. This commit
finalizes and provides a reference implementation/test with the
"Value" node.

Fixes #1443
This commit is contained in:
itsmattkc
2021-04-12 16:37:26 +10:00
parent 6d0e188393
commit 893adc3d72
15 changed files with 293 additions and 14 deletions
+14 -4
View File
@@ -505,10 +505,15 @@ NodeValue::Type Node::GetInputDataType(const QString &id) const
void Node::SetInputDataType(const QString &id, const NodeValue::Type &type)
{
Input* i = GetInternalInputData(id);
Input* input_meta = GetInternalInputData(id);
if (i) {
i->type = type;
if (input_meta) {
input_meta->type = type;
int array_sz = InputArraySize(id);
for (int i=-1; i<array_sz; i++) {
GetImmediate(id, i)->set_data_type(type);
}
emit InputDataTypeChanged(id, type);
} else {
@@ -693,7 +698,12 @@ SplitValue Node::GetSplitDefaultValue(const QString &input) const
QVariant Node::GetSplitDefaultValueOnTrack(const QString &input, int track) const
{
return GetSplitDefaultValue(input).at(track);
SplitValue val = GetSplitDefaultValue(input);
if (track < val.size()) {
return val.at(track);
} else {
return QVariant();
}
}
const QVector<NodeKeyframeTrack> &Node::GetKeyframeTracks(const QString &input, int element) const