afx Posted January 18, 2023 Share Posted January 18, 2023 Is there a way to query the parameter you right clicked, essentially what I want to do is right-click on said parameter - query it - and then create a copy right underneath it. I have a PARMmenu.xml file going, I am just not clear in how to get the query. Noob to python, but long time houdini user. Quote Link to comment Share on other sites More sharing options...
DonRomano Posted February 1, 2023 Share Posted February 1, 2023 I am not sure of what you want to achieve, but here is a hint of how to print the clicked parameter name <?xml version="1.0" encoding="UTF-8"?> <menuDocument> <menu> <subMenu id="parmmenu.print_parm"> <insertBefore /> <label>Print Parm</label> <scriptCode><![CDATA[ parms = kwargs["parms"] for parm in parms: print(parm.name()) ]]> </scriptCode> </subMenu> <separatorItem> <insertAfter>parmmenu.print_parm</insertAfter> </separatorItem> </menu> </menuDocument> The "parms" keyword argument is a tuple containing the clicked parameters that triggered the menu (it is a tuple because in some cases there are multiple parameters for the same parameter on the interface, a translate has tx, ty and tz for exemple). If I understant what you mean by creating a copy of the parameter, you can copy its parm template and add it to the node which the clicked parm belongs to. Cheers, Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.