allowed parameters to have data without fields
This commit is contained in:
@@ -225,6 +225,8 @@ set(OLIVE_SOURCES
|
||||
nodes/nodes.h
|
||||
nodes/oldeffectnode.h
|
||||
nodes/oldeffectnode.cpp
|
||||
nodes/nodes/nodeblock.h
|
||||
nodes/nodes/nodeblock.cpp
|
||||
nodes/nodes/nodeimageoutput.cpp
|
||||
nodes/nodes/nodeimageoutput.h
|
||||
nodes/nodes/nodemedia.cpp
|
||||
|
||||
@@ -12,6 +12,11 @@ QString Node::name()
|
||||
return tr("Node");
|
||||
}
|
||||
|
||||
QString Node::id()
|
||||
{
|
||||
return "node";
|
||||
}
|
||||
|
||||
void Node::AddParameter(NodeIO *param)
|
||||
{
|
||||
param->setParent(this);
|
||||
|
||||
@@ -14,6 +14,7 @@ public:
|
||||
Node(NodeGraph* parent);
|
||||
|
||||
virtual QString name();
|
||||
virtual QString id();
|
||||
|
||||
void AddParameter(NodeIO* row);
|
||||
int IndexOfParameter(NodeIO* row);
|
||||
|
||||
@@ -30,7 +30,7 @@ QString olive::nodes::DataTypeToString(DataType type) {
|
||||
return "TEXTURE";
|
||||
case kMatrix:
|
||||
return "MATRIX";
|
||||
case kClip:
|
||||
case kBlock:
|
||||
return "CLIP";
|
||||
default:
|
||||
return QString();
|
||||
@@ -68,7 +68,7 @@ olive::nodes::DataType olive::nodes::StringToDataType(const QString &s)
|
||||
} else if (s == "MATRIX") {
|
||||
return kMatrix;
|
||||
} else if (s == "CLIP") {
|
||||
return kClip;
|
||||
return kBlock;
|
||||
}
|
||||
return kInvalid;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ enum DataType {
|
||||
kMatrix,
|
||||
|
||||
/** Value is a Clip node */
|
||||
kClip,
|
||||
kBlock,
|
||||
|
||||
/** Total count of valid node data types. Never use this as an actual data type. */
|
||||
kDataTypeCount
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -461,6 +461,11 @@ private:
|
||||
* @brief Internal array of node edges. Access with AddEdge() and RemoveEdge().
|
||||
*/
|
||||
QVector<NodeEdgePtr> node_edges_;
|
||||
|
||||
/**
|
||||
* @brief Internal data object for rows without fields
|
||||
*/
|
||||
QVariant data_;
|
||||
};
|
||||
|
||||
#endif // EFFECTROW_H
|
||||
|
||||
Reference in New Issue
Block a user