J D

JohnDoe777

About Me

EXPERTISE
VFX Artist
INDUSTRY
Film/TV

Connect

LOCATION
Canada
WEBSITE

Houdini Skills

Availability

Not Specified

Recent Forum Posts

python Toggle buttons visability June 30, 2025, 2:04 p.m.

First create a toggle parm and name it "button_toggle".

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)

python Toggle buttons visability June 29, 2025, 5:47 a.m.

You could use a hidden toggle parm in the "hide when" and then use a bit of python in the buttons callback to turn said toggle parm off and on.

Using python in parms without the constant calls? June 29, 2025, 5:39 a.m.

Hello,

When you use python in a parameter it's not only ran once when the node updates in any capacity but multiple times. This becomes even worse if you use python in a multi parm as this causes the python parm to evaluate exponentially.

I don't know if this is a long time bug or an uncontrollable aspect of how nodes evaluate. I try to avoid using Python in general in parms but sometimes it's necessary. So I was wondering if anyone knows if there's a work around to get these python parms not to run inefficiently or if this is just how it's unfortunately got to work?

Thanks