Single line Python Callback Script from Toggle Button

   358   0   0
User Avatar
Member
21 posts
Joined: Oct. 2019
Offline
For anyone interested in creating a single line Callback Script to turn nodes on/off from a Toggle Button, here is the code tested and working.
What I did was create a list of nodes and evaluate it with the Lambda function to avoid external files or the unnecessary creation of HDA containers, so this way I can choose which nodes to target.

(lambda bypass_value: [hou.node(path).bypass(bypass_value) for path in hou.parm("/obj/SCENE_001/CTRL/bypassNodes").eval().split()])(hou.parm("/obj/SCENE_001/CTRL/bypass").eval())

Long live to Houdini!

...

Attachments:
CallBackScript.JPG (294.3 KB)

  • Quick Links