Hey
I have two buttons in hda's UI one to 'Start paint' and the other 'Done paint' I want each one to toggle the other visibility so they are not shown together, I been digging around with no success can someone point me for a good tip please
thank you
python Toggle buttons visability
567 3 1-
- shrifazmy
- Member
- 22 posts
- Joined: Oct. 2012
- Offline
-
- JohnDoe777
- Member
- 46 posts
- Joined: Dec. 2014
- Offline
-
- shrifazmy
- Member
- 22 posts
- Joined: Oct. 2012
- Offline
-
- JohnDoe777
- Member
- 46 posts
- Joined: Dec. 2014
- Offline
First create a toggle parm and name it "button_toggle".
In the 2 buttons put in the "Hide When" section this
If this is a HDA:
In both button parms put this in the Callback Script(Set to Python)
Then go to the Scripts tab and add a Python Module and paste this.
If this is not a HDA or you want it to be less clean.
In both button parms put this in the Callback Script.
In the 2 buttons put in the "Hide When" section this
{ button_toggle == 0 }
changing the 0 to a 1 in the second button parm. If this is a HDA:
In both button parms put this in the Callback Script(Set to Python)
hou.phm().toggle_button(kwargs)
Then go to the Scripts tab and add a Python Module and paste this.
def toggle_button(kwargs): node = kwargs["node"] toggle = node.evalParm("button_toggle") node.parm("button_toggle").set(1-toggle)
If this is not a HDA or you want it to be less clean.
In both button parms put this in the Callback Script.
node = kwargs["node"]; toggle = node.evalParm("button_toggle"); node.parm("button_toggle").set(1-toggle)
Edited by JohnDoe777 - June 30, 2025 14:05:01
-
- Quick Links