Geometry Nodes: add two inputs in Index Switch by default

Having this node with only a single input is not useful.
This commit is contained in:
Jacques Lucke
2023-11-24 09:57:38 +01:00
parent 8eaf89cc41
commit cbe0cf0bb0

View File

@@ -71,9 +71,12 @@ static void node_init(bNodeTree * /*tree*/, bNode *node)
data->next_identifier = 0;
BLI_assert(data->items == nullptr);
data->items = MEM_cnew_array<IndexSwitchItem>(1, __func__);
data->items[0].identifier = data->next_identifier++;
data->items_num = 1;
const int default_items_num = 2;
data->items = MEM_cnew_array<IndexSwitchItem>(default_items_num, __func__);
for (const int i : IndexRange(default_items_num)) {
data->items[i].identifier = data->next_identifier++;
}
data->items_num = default_items_num;
node->storage = data;
}