3
$\begingroup$

I've got a GN node group with the following overall structure:

enter image description here

As you can see, I'm trying to create a logic able to deal with either Points, Edges, Faces od Corners, based on a choice made in the Group Input node.

This choice determines the behavior of Domain size and Sample index nodes so that they process the same type of object.

It would be obvious to connect the Menu socket of the Group Input node to both the Menu Switch nodes, if it weren't for the unexpected refuse of the two nodes to share the input (when I attach the second node the connectors become red).

I really can't figure out a reasonable explanation for that. Surely there may be something running under the hood of GN that prevents it from working, or it's just a bug, I couldn't say.

Anyway, the simplest solution I've found is to define 2 identical Menu sockets in the Group input node, one to drive the Domain size choice and the other one to drive the Sample index. Nonetheless, having 2 independent list-boxes for non independent choices is something I find quite a bit annoying.

Another (horrible) solution could be replicating 4 times almost everything (one for each type of object) and put only one Menu switch node at the end, but this would make developing and maintenance a nightmare.

Is there any method to fix this issue or just a more elegant workaround. Thank you.

$\endgroup$
0

1 Answer 1

3
$\begingroup$

Use Index Switch

You can use one Menu Switch with an integer as output (index) followed by multiple Index Switch.

Menu switch connected to multiple index switch

Wrap inside Node Group

As explained in the official documentation, you can make a group node out of your Menu Switch, then copy the group. I'm not sure how it could work in your case as you have multiple data types.

$\endgroup$
1
  • $\begingroup$ This actually solved my problem, I just had to set the appropriate [Menu Switch] labels and [Index Switch]es object types. $\endgroup$
    – Antonio
    Commented Jul 5 at 10:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .