Callback Script and Current Parm

   12244   3   1
User Avatar
Member
19 posts
Joined: Sept. 2011
Offline
Hi,

Does anyone know how I can get current parm on Callback Script? Doesn't look hou.evaluatingParm() works on Callback. And I don't wanna specify the parameter name like hou.pdw().parm(“something”)

for example, I just want to print current value whenever the parameter changed or printing button name when I press the button.


Thanks,
Ryoji
User Avatar
Member
2625 posts
Joined: June 2008
Offline
This works for me.
def btnClick (passedData):
    n =  hou.node("/obj/pythonscript1")
    if n:
        p = n.parm("btn_example")
        print dir(p)
        print p.name()
        print p.description() # This is the button caption.

Here is the callback code. Remember to switch from Hscript to Python.
exec(hou.node("/obj/pythonscript1").parm('python').eval());btnClick("") 
Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
402 posts
Joined: June 2014
Offline
Hi,

you should be able to get what you need from the kwargs dictionary, you can check out the docs on that stuff here [www.sidefx.com]
Henry Dean
User Avatar
Member
19 posts
Joined: Sept. 2011
Offline
Oh yeah! I totally forgot kwargs or kwargs.

Thant works for something I want.

Thanks a lot,
Ryoji
  • Quick Links