move ignore connections to input flag
This commit is contained in:
+3
-8
@@ -203,7 +203,7 @@ void Node::ConnectEdge(Node *output, const NodeInput &input)
|
||||
emit output->OutputConnected(output, input);
|
||||
|
||||
// Invalidate all if this node isn't ignoring this input
|
||||
if (!input.node()->ignore_connections_.contains(input.input())) {
|
||||
if (!(input.node()->GetInputFlags(input.input()) & kInputFlagIgnoreConnections)) {
|
||||
input.node()->InvalidateAll(input.input(), input.element());
|
||||
}
|
||||
}
|
||||
@@ -230,7 +230,7 @@ void Node::DisconnectEdge(Node *output, const NodeInput &input)
|
||||
emit input.node()->InputDisconnected(output, input);
|
||||
emit output->OutputDisconnected(output, input);
|
||||
|
||||
if (!input.node()->ignore_connections_.contains(input.input())) {
|
||||
if (!(input.node()->GetInputFlags(input.input()) & kInputFlagIgnoreConnections)) {
|
||||
input.node()->InvalidateAll(input.input(), input.element());
|
||||
}
|
||||
}
|
||||
@@ -1307,11 +1307,6 @@ void Node::SetInputName(const QString &id, const QString &name)
|
||||
}
|
||||
}
|
||||
|
||||
void Node::IgnoreInvalidationsFrom(const QString& input_id)
|
||||
{
|
||||
ignore_connections_.append(input_id);
|
||||
}
|
||||
|
||||
const QString &Node::GetLabel() const
|
||||
{
|
||||
return label_;
|
||||
@@ -1644,7 +1639,7 @@ void Node::ParameterValueChanged(const QString& input, int element, const TimeRa
|
||||
|
||||
emit ValueChanged(NodeInput(this, input, element), range);
|
||||
|
||||
if (ignore_connections_.contains(input)) {
|
||||
if (GetInputFlags(input) & kInputFlagIgnoreConnections) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -995,15 +995,6 @@ protected:
|
||||
|
||||
void SendInvalidateCache(const TimeRange &range, const InvalidateCacheOptions &options);
|
||||
|
||||
/**
|
||||
* @brief Don't send cache invalidation signals if `input` is connected or disconnected
|
||||
*
|
||||
* By default, when a node is connected or disconnected from input, the Node assumes that the
|
||||
* parameters has changed throughout the duration of the clip (essential from 0 to infinity).
|
||||
* In some scenarios, it may be preferable to handle this signal separately in order to
|
||||
*/
|
||||
void IgnoreInvalidationsFrom(const QString &input_id);
|
||||
|
||||
enum GizmoScaleHandles {
|
||||
kGizmoScaleTopLeft,
|
||||
kGizmoScaleTopCenter,
|
||||
@@ -1212,8 +1203,6 @@ private:
|
||||
|
||||
void ClearElement(const QString &input, int index);
|
||||
|
||||
QVector<QString> ignore_connections_;
|
||||
|
||||
/**
|
||||
* @brief Custom user label for node
|
||||
*/
|
||||
|
||||
@@ -46,11 +46,7 @@ Track::Track() :
|
||||
locked_(false),
|
||||
sequence_(nullptr)
|
||||
{
|
||||
AddInput(kBlockInput, NodeValue::kNone, InputFlags(kInputFlagArray | kInputFlagNotKeyframable | kInputFlagHidden));
|
||||
|
||||
// Since blocks are time based, we can handle the invalidate timing a little more intelligently
|
||||
// on our end
|
||||
IgnoreInvalidationsFrom(kBlockInput);
|
||||
AddInput(kBlockInput, NodeValue::kNone, InputFlags(kInputFlagArray | kInputFlagNotKeyframable | kInputFlagHidden | kInputFlagIgnoreConnections));
|
||||
|
||||
AddInput(kMutedInput, NodeValue::kBoolean, false, InputFlags(kInputFlagNotConnectable | kInputFlagNotKeyframable));
|
||||
|
||||
|
||||
+4
-2
@@ -36,8 +36,10 @@ enum InputFlag {
|
||||
kInputFlagArray = 0x1,
|
||||
kInputFlagNotKeyframable = 0x2,
|
||||
kInputFlagNotConnectable = 0x4,
|
||||
kInputFlagStatic = kInputFlagNotKeyframable | kInputFlagNotConnectable,
|
||||
kInputFlagHidden = 0x8
|
||||
kInputFlagHidden = 0x8,
|
||||
kInputFlagIgnoreConnections = 0x10,
|
||||
|
||||
kInputFlagStatic = kInputFlagNotKeyframable | kInputFlagNotConnectable
|
||||
};
|
||||
|
||||
class InputFlags {
|
||||
|
||||
@@ -43,9 +43,7 @@ Sequence::Sequence()
|
||||
// Create track input
|
||||
QString track_input_id = kTrackInputFormat.arg(i);
|
||||
|
||||
AddInput(track_input_id, NodeValue::kNone, InputFlags(kInputFlagNotKeyframable | kInputFlagArray | kInputFlagHidden));
|
||||
|
||||
IgnoreInvalidationsFrom(track_input_id);
|
||||
AddInput(track_input_id, NodeValue::kNone, InputFlags(kInputFlagNotKeyframable | kInputFlagArray | kInputFlagHidden | kInputFlagIgnoreConnections));
|
||||
|
||||
TrackList* list = new TrackList(this, static_cast<Track::Type>(i), track_input_id);
|
||||
track_lists_.replace(i, list);
|
||||
|
||||
Reference in New Issue
Block a user