Is there an expression for getting the number of connected inputs for a given node?
For example, I want to write an expression for a switch statement so that it randomly selects one of the input nodes and I can add or remove connections without having to re-write the expression
select input: rand(seed)*numInputs
I know that opinput() can get a connection to a given input index, but I'm looking for the number of connected inputs.
Thanks!
Expression for number of connected inputs
10122 4 0-
- KMcNamara
- Member
- 228 posts
- Joined: Dec. 2012
- Offline
-
- graham
- Member
- 1926 posts
- Joined: Nov. 2006
- Offline
You should be able to use opninputs() http://www.sidefx.com/docs/houdini12.5/expressions/opninputs [sidefx.com]
There's a caveat dealing with missing inputs but that shouldn't be an issue with a Switch.
There's a caveat dealing with missing inputs but that shouldn't be an issue with a Switch.
Graham Thompson, Technical Artist @ Rockstar Games
-
- KMcNamara
- Member
- 228 posts
- Joined: Dec. 2012
- Offline
-
- graham
- Member
- 1926 posts
- Joined: Nov. 2006
- Offline
-
- KMcNamara
- Member
- 228 posts
- Joined: Dec. 2012
- Offline
-
- Quick Links


derp. Thanks!