Jump to content

Active Switch Input - Name


monomind

Recommended Posts

Hi Mono,
something like this, in Python? If you want the result inside a String parm, you have to Add a keyframe to that parm and then change the language to Python. The file is attached.

 

switch = hou.node("../switch")
inputs = switch.inputs()
active = switch.parm("input").eval()
return inputs[active]

image.thumb.png.e660df6096459b11780540c9633b78ab.png

 

switch.hiplc

 

Link to comment
Share on other sites

I am not sure what exactly do you need, but that python can be run in any String parm. Even in a new custom string parm in any node. Btw in Switch COP, the parm is called "index",  not "input". So the third line will be this:

 

active = switch.parm("index").eval()

 

image.thumb.png.fb5d6fee90b9d4210d03e9330bbc5d46.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...