Hey Guys:
I'm wondering if there's a preferred way to call a function in a PythonModule even handler from a parameter callback. Let's say I have a function called “foo” in my PythonModule. Which of the following is more correct? Or, are they different ways to skin the cat?
kwargs.hdaModule().foo(kwargs)
hou.pwd().hdaModule().foo(kwargs)
hou.node('.').hdaModule().foo(kwargs)
hou.phm().foo(kwargs)
Thanks!
Frankie Rodriguez
Python Callback Syntax
11020 7 2- fxrod
- Member
- 133 posts
- Joined: 7月 2005
- Offline
- graham
- Member
- 1909 posts
- Joined: 11月 2006
- Offline
- fxrod
- Member
- 133 posts
- Joined: 7月 2005
- Offline
- rdg
- Member
- 401 posts
- Joined:
- Offline
- fxrod
- Member
- 133 posts
- Joined: 7月 2005
- Offline
- graham
- Member
- 1909 posts
- Joined: 11月 2006
- Offline
Not really. kwargs is just a dictionary so that is the only arg the function takes. Whether or not the function actually uses everything in the dictionary is up to you.
I do like passing kwargs and usually do if the function requires more than just the node argument (parm name, instance number, etc). If it just needs the node though I generally just pass hou.pwd(), leaving me the option of using the function elsewhere as well.
I do like passing kwargs and usually do if the function requires more than just the node argument (parm name, instance number, etc). If it just needs the node though I generally just pass hou.pwd(), leaving me the option of using the function elsewhere as well.
Graham Thompson, Technical Artist @ Rockstar Games
- fxrod
- Member
- 133 posts
- Joined: 7月 2005
- Offline
- graham
- Member
- 1909 posts
- Joined: 11月 2006
- Offline
-
- Quick Links