Assign code-value to a Toggle Interface Parameter

   5587   2   2
User Avatar
Member
25 posts
Joined: Nov. 2016
Offline
I have a subnetwork which creates grids for motion graphics. In the parameter interface I want to specify the method of spacing with two toggles: by_Size and by_Copies. Only one method can be used at a time so I want to assign a value to each of these toggles to make them opposite of the other. So when by_Size is toggled on, by_Copies should automatically turn off and vice versa.

I am fairly new to Houdini so I thought maybe I am overlooking something I don't know about yet.
Cheers!
User Avatar
Staff
3465 posts
Joined: July 2005
Online
you could try a Button Strip
see the attached hda

Attachments:
toggle.hda (16.0 KB)

Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
User Avatar
Member
2658 posts
Joined: June 2008
Offline
Place a pythonscript node inside your subnet. Then setup a callback script hook for each toggle. When the toggle changes the script will run.

Here is the example code that you can place in a callback script.
exec(hou.node("/obj/subnet1/pythonscript_INTERFACE_CODE").parm('python').eval());toggle1Option()
You must also remember to switch the processing language for the callback from HScript to Python.
Edited by Enivob - March 30, 2017 09:57:57

Attachments:
ap_toggle_callback.hiplc (53.9 KB)
Untitled-1.jpg (189.9 KB)

Using Houdini Indie 20.5
Windows 11 64GB Ryzen 16 core.
nVidia 3060RTX 12BG RAM.
  • Quick Links