paramview: preliminary group support
This commit is contained in:
@@ -240,12 +240,21 @@ NodeParamViewItemBody::NodeParamViewItemBody(Node* node, NodeParamViewCheckBoxBe
|
||||
int insert_row = 0;
|
||||
|
||||
// Create widgets all root level components
|
||||
foreach (const QString& input, node->inputs()) {
|
||||
CreateWidgets(root_layout, node, input, -1, insert_row);
|
||||
foreach (QString input, node->inputs()) {
|
||||
Node *n;
|
||||
if (NodeGroup *g = dynamic_cast<NodeGroup*>(node)) {
|
||||
const NodeInput &ni = g->GetInputPassthroughs().value(input);
|
||||
n = ni.node();
|
||||
input = ni.input();
|
||||
} else {
|
||||
n = node;
|
||||
}
|
||||
|
||||
CreateWidgets(root_layout, n, input, -1, insert_row);
|
||||
|
||||
insert_row++;
|
||||
|
||||
if (node->InputIsArray(input)) {
|
||||
if (n->InputIsArray(input)) {
|
||||
// Insert here
|
||||
QWidget* array_widget = new QWidget();
|
||||
|
||||
@@ -265,7 +274,7 @@ NodeParamViewItemBody::NodeParamViewItemBody(Node* node, NodeParamViewCheckBoxBe
|
||||
|
||||
array_widget->setVisible(false);
|
||||
|
||||
array_ui_.insert({node, input}, {array_widget, arr_sz, append_btn});
|
||||
array_ui_.insert({n, input}, {array_widget, arr_sz, append_btn});
|
||||
|
||||
insert_row++;
|
||||
}
|
||||
@@ -432,6 +441,12 @@ int NodeParamViewItemBody::GetElementY(NodeInput c) const
|
||||
c.set_element(-1);
|
||||
}
|
||||
|
||||
if (NodeGroup *g = dynamic_cast<NodeGroup*>(c.node())) {
|
||||
const NodeInput &passthrough = g->GetInputPassthroughs().value(c.input());
|
||||
c.set_node(passthrough.node());
|
||||
c.set_input(passthrough.input());
|
||||
}
|
||||
|
||||
// Find its row in the parameters
|
||||
QLabel* lbl = input_ui_map_.value(c).main_label;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user