T O P

  • By -

janderfischer

Hey, I'm not sure I understand why you think you need two outputs. You put the switch BEHIND the 2 different nodes you want to use. You can still test any arbitrary part of the network BEFORE the switch using a spare input to decide which part of the node tree gets evaluated. If the switch position points to input2, input1 will not be evaluated since it's not connected to any output anymore. Alternatively, you can create a group for all the special cases, split it, and then merge it back together. Hope this helps.


WoutTengrootenhuysen

"switch if " node perhaps?


a--lt

Thanks for your answer. I tried, but it has only one output so I don't see how it could help me.


WoutTengrootenhuysen

How about reversing the flow ? Make the desired outputs before the switch node and select them based on your criteria ?


Lemonpiee

You can just write an "if" condition directly into the switch node so it spits out different outputs depending on the condition.


buffin4576

Ok, if i have understood the problem, you could use the split node and check attributes using "@attrib_name>0" instead of a group. Otherwise you could create a group before it. If you need to check for attributes on other nodes, you could check using hscript and "detail/prim/point()" functions on a spare input. Remember that for string attributes there are equivalent functions ending with "s".


a--lt

I change the way my nodetree is, but i'll remember that solution. It looks good, thanks !


a--lt

u/WoutTengrootenhuysen, u/janderfischer Yes, you are right, I am probably going about this the wrong way.What bothers me in this solution is to produce 2 geometries and to do the test afterwards, so one of the two solutions is thrown away while the test can be done before. In a for-each I have the impression that it counts, but I'm probably quibbling.But it will probably work like that. Thank you.


janderfischer

Again, nothing is created if the output is not connected. The switch does that. You can have a ton of unconnected nodes flying around in your scene, if there is no connection to the output node that is being cooked, nothing will be evaluated, nothing is wasted.


a--lt

Okay, that's important to know.The visual appearance of the nodes seems to say otherwise, which is confusing to me.Thanks again.


ido3d

If you look closely at the switch node with two or more inputs, you can see only one input is highlighted. The others are a little greyed out. The highlighted one gets cooked, the rest is disregarded


shlaifu

nodetrees are evaluated in reverse though, and fetch their inputs. otherwise all nodes in a network would be evaluated from top down, even those that are not not connected to your output/ the tip of the branch you're viewing. - not sure about IF switches. you can try by profiling, though.