nodes: added access to default value
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user