Button parameter to change the input of a switch node

   123   2   1
User Avatar
Member
5 posts
Joined: Sept. 2023
Offline
Hi there,

For a tool that I'm building, I need to have a switch node (with two inputs) switch from the current input to the other. This has to be driven by a button press on my hda. Im not good with python or hscript but i tried everything i could think of (python callbacks on the button, python modules in the hda that the button refers to, hscript links, trying to make a button increment an integer and have the integer parm toggle a switch-if node...) but nothing works. I know, a button parameter is not intended to drive a switch node but I'm trying to hook it up to a "renderexec" button of a renderrop.

Thank you guys in advance
User Avatar
Member
251 posts
Joined: May 2017
Offline
Hi read the current value of the switch input parm and set a negated value each time you press the button. Result is same as using a toggle.

Image Not Found

Attachments:
button_switch_state.hipnc (75.6 KB)

User Avatar
Member
5 posts
Joined: Sept. 2023
Offline
vikus
Hi read the current value of the switch input parm and set a negated value each time you press the button. Result is same as using a toggle.

Image Not Found

That works like a charm, Thank you so much.
  • Quick Links