implemented node flags
This commit is contained in:
@@ -47,6 +47,8 @@ Block::Block() :
|
||||
IgnoreHashingFrom(kLengthInput);
|
||||
|
||||
AddInput(kEnabledInput, NodeValue::kBoolean, true, InputFlags(kInputFlagNotConnectable | kInputFlagNotKeyframable));
|
||||
|
||||
SetFlags(kDontShowInParamView);
|
||||
}
|
||||
|
||||
QVector<Node::CategoryID> Block::Category() const
|
||||
|
||||
@@ -32,6 +32,8 @@ MergeNode::MergeNode()
|
||||
AddInput(kBaseIn, NodeValue::kTexture, InputFlags(kInputFlagNotKeyframable));
|
||||
|
||||
AddInput(kBlendIn, NodeValue::kTexture, InputFlags(kInputFlagNotKeyframable));
|
||||
|
||||
SetFlags(kDontShowInParamView);
|
||||
}
|
||||
|
||||
Node *MergeNode::copy() const
|
||||
|
||||
+2
-1
@@ -47,7 +47,8 @@ Node::Node() :
|
||||
override_color_(-1),
|
||||
folder_(nullptr),
|
||||
operation_stack_(0),
|
||||
cache_result_(false)
|
||||
cache_result_(false),
|
||||
flags_(kNone)
|
||||
{
|
||||
uuid_ = QUuid::createUuid();
|
||||
}
|
||||
|
||||
@@ -94,6 +94,11 @@ public:
|
||||
kCategoryCount
|
||||
};
|
||||
|
||||
enum Flag {
|
||||
kNone = 0,
|
||||
kDontShowInParamView = 0x1
|
||||
};
|
||||
|
||||
Node();
|
||||
|
||||
virtual ~Node() override;
|
||||
@@ -116,6 +121,11 @@ public:
|
||||
const QUuid &GetUUID() const {return uuid_;}
|
||||
void SetUUID(const QUuid &uuid) {uuid_ = uuid;}
|
||||
|
||||
const uint64_t &GetFlags() const
|
||||
{
|
||||
return flags_;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Clear current node variables and replace them with
|
||||
*/
|
||||
@@ -1036,6 +1046,11 @@ protected:
|
||||
tooltip_ = s;
|
||||
}
|
||||
|
||||
void SetFlags(const uint64_t &f)
|
||||
{
|
||||
flags_ = f;
|
||||
}
|
||||
|
||||
signals:
|
||||
/**
|
||||
* @brief Signal emitted when SetLabel() is called
|
||||
@@ -1315,6 +1330,8 @@ private:
|
||||
|
||||
QUuid uuid_;
|
||||
|
||||
uint64_t flags_;
|
||||
|
||||
private slots:
|
||||
/**
|
||||
* @brief Slot when a keyframe's time changes to keep the keyframes correctly sorted by time
|
||||
|
||||
@@ -66,6 +66,8 @@ ViewerOutput::ViewerOutput(bool create_buffer_inputs, bool create_default_stream
|
||||
AddStream(Track::kAudio, QVariant());
|
||||
set_default_parameters();
|
||||
}
|
||||
|
||||
SetFlags(kDontShowInParamView);
|
||||
}
|
||||
|
||||
Node *ViewerOutput::copy() const
|
||||
|
||||
@@ -76,8 +76,16 @@ NodeParamView::NodeParamView(bool create_keyframe_view, QWidget *parent) :
|
||||
for (int i=0; i<context_items_.size(); i++) {
|
||||
NodeParamViewContext *c = new NodeParamViewContext;
|
||||
c->setVisible(false);
|
||||
static_cast<NodeParamViewItemTitleBar*>(c->titleBarWidget())->SetAddEffectButtonVisible(i == Track::kVideo || i == Track::kAudio);
|
||||
static_cast<NodeParamViewItemTitleBar*>(c->titleBarWidget())->SetText(Footage::GetStreamTypeName(static_cast<Track::Type>(i)));
|
||||
|
||||
NodeParamViewItemTitleBar *title_bar = static_cast<NodeParamViewItemTitleBar*>(c->titleBarWidget());
|
||||
|
||||
if (i == Track::kVideo || i == Track::kAudio) {
|
||||
title_bar->SetAddEffectButtonVisible(true);
|
||||
title_bar->SetText(tr("%1 Nodes").arg(Footage::GetStreamTypeName(static_cast<Track::Type>(i))));
|
||||
} else {
|
||||
title_bar->SetText(tr("Other"));
|
||||
}
|
||||
|
||||
context_items_[i] = c;
|
||||
param_widget_area_->AddItem(c);
|
||||
}
|
||||
@@ -259,7 +267,7 @@ void NodeParamView::SetContexts(const QVector<Node *> &contexts)
|
||||
item->setVisible(true);
|
||||
|
||||
for (auto it=ctx->GetContextPositions().cbegin(); it!=ctx->GetContextPositions().cend(); it++) {
|
||||
if (!dynamic_cast<Footage*>(it.key()) && !dynamic_cast<ClipBlock*>(it.key())) {
|
||||
if (!(it.key()->GetFlags() & Node::kDontShowInParamView)) {
|
||||
AddNode(it.key(), item);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user