arranged items so they are inputs of folder rather than outputs
This commit is contained in:
@@ -22,7 +22,6 @@
|
||||
#define NODEGRAPH_H
|
||||
|
||||
#include "node/node.h"
|
||||
#include "project/item/item.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
|
||||
+4
-3
@@ -46,7 +46,8 @@ const QString Node::kDefaultOutput = QStringLiteral("output");
|
||||
Node::Node(bool create_default_output) :
|
||||
can_be_deleted_(true),
|
||||
override_color_(-1),
|
||||
last_change_time_(0)
|
||||
last_change_time_(0),
|
||||
folder_(nullptr)
|
||||
{
|
||||
if (create_default_output) {
|
||||
AddOutput();
|
||||
@@ -1126,7 +1127,7 @@ Node *Node::CopyNodeAndDependencyGraphMinusItemsInternal(QMap<const Node*, Node*
|
||||
Node* connected = output.node();
|
||||
Node* connected_copy;
|
||||
|
||||
if (dynamic_cast<Item*>(connected)) {
|
||||
if (connected->IsItem()) {
|
||||
// This is an item and we avoid copying those and just connect to them directly
|
||||
connected_copy = connected;
|
||||
} else {
|
||||
@@ -1529,7 +1530,7 @@ void GetDependenciesRecursively(QVector<Node*>& list, const Node* node, bool tra
|
||||
Node* connected_node = it->second.node();
|
||||
|
||||
if (!exclusive_only
|
||||
|| (connected_node->outputs().size() == 1 && !dynamic_cast<Item*>(connected_node))) {
|
||||
|| (connected_node->outputs().size() == 1 && !connected_node->IsItem())) {
|
||||
if (!list.contains(connected_node)) {
|
||||
list.append(connected_node);
|
||||
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
namespace olive {
|
||||
|
||||
class NodeGraph;
|
||||
class Folder;
|
||||
|
||||
/**
|
||||
* @brief A single processing unit that can be connected with others to create intricate processing systems
|
||||
@@ -155,6 +156,21 @@ public:
|
||||
*/
|
||||
virtual QString Description() const;
|
||||
|
||||
const QString& ToolTip() const
|
||||
{
|
||||
return tooltip_;
|
||||
}
|
||||
|
||||
Folder* folder() const
|
||||
{
|
||||
return folder_;
|
||||
}
|
||||
|
||||
virtual bool IsItem() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Function called to retranslate parameter names (should be overridden in derivatives)
|
||||
*/
|
||||
@@ -162,6 +178,10 @@ public:
|
||||
|
||||
virtual QIcon icon() const;
|
||||
|
||||
virtual QString duration() const {return QString();}
|
||||
|
||||
virtual QString rate() const {return QString();}
|
||||
|
||||
const QVector<QString>& inputs() const
|
||||
{
|
||||
return input_ids_;
|
||||
@@ -718,6 +738,11 @@ public:
|
||||
static bool Unlink(Node* a, Node* b);
|
||||
static bool AreLinked(Node* a, Node* b);
|
||||
|
||||
void SetFolder(Folder* folder)
|
||||
{
|
||||
folder_ = folder;
|
||||
}
|
||||
|
||||
static const QString kDefaultOutput;
|
||||
|
||||
protected:
|
||||
@@ -819,6 +844,11 @@ protected:
|
||||
|
||||
virtual void childEvent(QChildEvent *event) override;
|
||||
|
||||
void SetToolTip(const QString& s)
|
||||
{
|
||||
tooltip_ = s;
|
||||
}
|
||||
|
||||
signals:
|
||||
/**
|
||||
* @brief Signal emitted whenever the position is set through SetPosition()
|
||||
@@ -1137,6 +1167,10 @@ private:
|
||||
|
||||
qint64 last_change_time_;
|
||||
|
||||
QString tooltip_;
|
||||
|
||||
Folder* folder_;
|
||||
|
||||
private slots:
|
||||
/**
|
||||
* @brief Slot when a keyframe's time changes to keep the keyframes correctly sorted by time
|
||||
|
||||
Reference in New Issue
Block a user