contexts in param view
This commit is contained in:
@@ -515,11 +515,11 @@ void NodeView::mouseReleaseEvent(QMouseEvent *event)
|
||||
if (!reconnected_to_itself) {
|
||||
Node *creating_output = create_edge_output_item_->GetNode();
|
||||
|
||||
if (NodeGroup *output_group = dynamic_cast<NodeGroup*>(creating_output)) {
|
||||
while (NodeGroup *output_group = dynamic_cast<NodeGroup*>(creating_output)) {
|
||||
creating_output = output_group->GetOutputPassthrough();
|
||||
}
|
||||
|
||||
if (NodeGroup *input_group = dynamic_cast<NodeGroup*>(creating_input.node())) {
|
||||
while (NodeGroup *input_group = dynamic_cast<NodeGroup*>(creating_input.node())) {
|
||||
creating_input = input_group->GetInputPassthroughs().value(creating_input.input());
|
||||
}
|
||||
|
||||
|
||||
@@ -84,6 +84,9 @@ NodeViewItem::NodeViewItem(Node *node, const QString &input, int element, Node *
|
||||
}
|
||||
} else {
|
||||
output_connector_->setVisible(false);
|
||||
|
||||
connect(node_, &Node::InputArraySizeChanged, this, &NodeViewItem::InputArraySizeChanged);
|
||||
connect(node_, &Node::InputArraySizeChanged, this, &NodeViewItem::InputArraySizeChanged);
|
||||
}
|
||||
|
||||
// This should be set during runtime, but just in case here's a default fallback
|
||||
@@ -740,14 +743,20 @@ void NodeViewItem::RepopulateInputs()
|
||||
}
|
||||
|
||||
input_connector_->setVisible(has_connectable_inputs_);
|
||||
}
|
||||
|
||||
if (IsExpanded()) {
|
||||
// Create or remove inputs when necessary
|
||||
}
|
||||
} else {
|
||||
if (IsExpanded() && element_ == -1) {
|
||||
// Create or remove array elements when necessary
|
||||
}
|
||||
if (IsExpanded() && (IsOutputItem() || element_ == -1)) {
|
||||
// Create or remove inputs when necessary
|
||||
// NOTE: This is not the most efficient thing in the world, but it does work
|
||||
SetExpanded(false);
|
||||
SetExpanded(true);
|
||||
}
|
||||
}
|
||||
|
||||
void NodeViewItem::InputArraySizeChanged(const QString &input)
|
||||
{
|
||||
if (input == input_) {
|
||||
RepopulateInputs();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -222,6 +222,8 @@ private slots:
|
||||
|
||||
void RepopulateInputs();
|
||||
|
||||
void InputArraySizeChanged(const QString &input);
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user