allowed parameters to have data without fields

This commit is contained in:
itsmattkc
2019-05-17 18:45:44 +10:00
parent 13a393486b
commit c616bc2b61
7 changed files with 25 additions and 3 deletions
+9
View File
@@ -138,6 +138,10 @@ bool NodeIO::IsKeyframable()
QVariant NodeIO::GetValueAt(double timecode)
{
if (FieldCount() == 0) {
return data_;
}
Q_ASSERT(FieldCount() == 1);
return Field(0)->GetValueAt(timecode);
@@ -145,6 +149,11 @@ QVariant NodeIO::GetValueAt(double timecode)
void NodeIO::SetValueAt(double timecode, const QVariant &value)
{
if (FieldCount() == 0) {
data_ = value;
return;
}
Q_ASSERT(FieldCount() == 1);
Field(0)->SetValueAt(timecode, value);