Hello Guys,
I am trying to use a Wedge node attribute in Tops to push the values inside a switch node in sops. But instead of using an Integer, I want the Attribute string type in Tops to control the values in the switch node.
For example in my tops I have a Wedge node with a attribute name: balls , the type is a String and the string values are: 1. Red, 2. Blue, 3. Purple.
How do I then connect this to a switch node and allow it to connect to the right integer value on the switch now.
I have attached a quick test scene demonstration what i am trying to do.
Convert Integer values to string in switch node.
1789 2 1-
- longedesigns
- Member
- 10 posts
- Joined: April 2019
- Offline
-
- tamte
- Member
- 9417 posts
- Joined: July 2007
- Offline
you can do it for example with python expression like this
which would switch to the input whose name is the same as balls attribute value
colors = [input.name() for input in hou.pwd().inputs()] color = pdg.workItem().attribValue("balls") return colors.index(color)
Tomas Slancik
CG Supervisor
Framestore, NY
CG Supervisor
Framestore, NY
-
- longedesigns
- Member
- 10 posts
- Joined: April 2019
- Offline
-
- Quick Links

