nodes: added access to default value

This commit is contained in:
itsmattkc
2020-05-08 00:37:43 +10:00
parent 65705d580d
commit 69941dc2da
2 changed files with 14 additions and 0 deletions
+7
View File
@@ -316,6 +316,8 @@ void NodeInput::Init(DataType type)
void NodeInput::SetDefaultValue(const QVector<QVariant> &default_value)
{
default_value_ = default_value;
for (int i=0;i<standard_value_.size();i++) {
standard_value_.replace(i, default_value.at(i));
}
@@ -382,6 +384,11 @@ void NodeInput::GetDependencies(QList<Node *> &list, bool traverse, bool exclusi
}
}
QVariant NodeInput::GetDefaultValue() const
{
return combine_track_values_into_normal_value(default_value_);
}
QList<Node *> NodeInput::GetDependencies(bool traverse, bool exclusive_only) const
{
QList<Node *> list;
+7
View File
@@ -277,6 +277,8 @@ public:
void GetDependencies(QList<Node*>& list, bool traverse, bool exclusive_only) const;
QVariant GetDefaultValue() const;
QList<Node*> GetDependencies(bool traverse = true, bool exclusive_only = false) const;
QList<Node*> GetExclusiveDependencies() const;
@@ -368,6 +370,11 @@ private:
*/
QVector<QVariant> standard_value_;
/**
* @brief Default value that can be reset if the user requests
*/
QVector<QVariant> default_value_;
/**
* @brief Internal keyframe array
*