Can I determine whaat parameter is calling a menu script?

   5788   8   0
User Avatar
Member
14 posts
Joined: 12月 2007
Offline
Is there a way to determine what the calling parm is when a menu script is run?

The usual kwargs data does not appear to be availiable, which can be problematic in a multiparm situation. It seems the best I can do is to run some kind of post/validation job as an additional parm callback (ugh).

If this is currently impossible, then this would be a useful RFE.
User Avatar
Member
1922 posts
Joined: 11月 2006
Online
kwargs and it's corresponding ‘parm’ information seems to work fine for me in Python menu scripts regardless of them being in a multiparm or not. Can you provide an example where you are having issues?
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
14 posts
Joined: 12月 2007
Offline
Please check /out/This.

There is one user parm with a menu script.

I would like to access kwargs-type data.

Attachments:
example.hip (48.5 KB)

User Avatar
Member
8836 posts
Joined: 7月 2007
Offline
you have accessed it
you just need to return pairs of value, label

like this
t = kwargs
l = kwargs
return
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
14 posts
Joined: 12月 2007
Offline
I get an error trying to do tamte's example.

—-

Traceback (most recent call last):
File “<stdin>”, line 2, in expression
NameError: global name ‘kwargs’ is not defined
User Avatar
Member
8836 posts
Joined: 7月 2007
Offline
weird, because your scene worked for me, just the menu was populated with wrong values, but kwargs was recognized
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
14 posts
Joined: 12月 2007
Offline
I am running 11.0.469 on Linux. Is this a bug with this version? Can anyone else verify that this works (or doesn't…)?
User Avatar
Member
1922 posts
Joined: 11月 2006
Online
Friday, August 27, 2010
Houdini 11.0.486: Passing a kwargs variable into Python menu scripts to let you know which parameter contains the menu.
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
14 posts
Joined: 12月 2007
Offline
Thank you.
  • Quick Links