monomind Posted March 25, 2020 Share Posted March 25, 2020 I'm trying to get the active switch input op name - how is that possible? Quote Link to comment Share on other sites More sharing options...
ikoon Posted March 25, 2020 Share Posted March 25, 2020 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] switch.hiplc Quote Link to comment Share on other sites More sharing options...
monomind Posted March 25, 2020 Author Share Posted March 25, 2020 How about doing this in COP Quote Link to comment Share on other sites More sharing options...
ikoon Posted March 25, 2020 Share Posted March 25, 2020 Do you have a sample scene? Quote Link to comment Share on other sites More sharing options...
monomind Posted March 25, 2020 Author Share Posted March 25, 2020 I can prepare - that'd be creating an empty scene and creating a cop network - I just don't know how to script in COPs basically, there is no wrangle in that concept. Quote Link to comment Share on other sites More sharing options...
ikoon Posted March 25, 2020 Share Posted March 25, 2020 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() Quote Link to comment Share on other sites More sharing options...
monomind Posted March 25, 2020 Author Share Posted March 25, 2020 How/where do you run python? Quote Link to comment Share on other sites More sharing options...
ikoon Posted March 25, 2020 Share Posted March 25, 2020 This is great Masterclass: https://vimeo.com/14612897 You don't need to see the whole video, first hour (or less) should help you do amazing things. Quote Link to comment Share on other sites More sharing options...
monomind Posted March 25, 2020 Author Share Posted March 25, 2020 Thank you!! 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.