Hey, I'm kida stuck on how to do this - in short, i've got a shelf tool that adds an ordered menu UI to selected nodes. And I need a callback when the selection changes in this menu. Easy with static UI, but I couldn't figure it out with dynamically created one. This is a simplified code:
This line is obviously a wrong syntax that crashes Houdini: script_callback=hou.MenuParmTemplate.setScriptCallback(node.parm("select_texture_node"), print('pressed'))
Not sure how it should look to make it work. Docs not helping. ChatGPT was giving me BS on this one. Any hints?
Thanks Tomas, the first and the most obvious solution works. That was actually the first thing I tried and it was giving me error. I didn't realize the default script language is Hscript so it was needed to specifically set it to Python. Stupid but easy Thanks.