Hi I am writing a small shelf tool
I written a module in the script
any idea of how to import a module in script section of type properties by python script?
we can do this by going and r.clicking and going to type properties window.
but i want to know how this can be done by script.
so that when i click the shelf tool,the module also can be run
python otl doubt
2260 2 0- omy
- Member
- 71 posts
- Joined: Feb. 2010
- Offline
- graham
- Member
- 1908 posts
- Joined: Nov. 2006
- Offline
Assuming your asset has a function called foo() in the PythonModule you can do something like this:
node = hou.node(“/path/to/my/node”)
node.hdaModule().foo()
You can also do it without an instance of the node as well:
node_type = hou.nodeType(hou.sopNodeTypeCategory(), “myhda”)
node_type.hdaModule().foo()
In this case ‘myhda’ is the node type name of your asset and it is a SOP.
node = hou.node(“/path/to/my/node”)
node.hdaModule().foo()
You can also do it without an instance of the node as well:
node_type = hou.nodeType(hou.sopNodeTypeCategory(), “myhda”)
node_type.hdaModule().foo()
In this case ‘myhda’ is the node type name of your asset and it is a SOP.
Graham Thompson, Technical Artist @ Rockstar Games
- omy
- Member
- 71 posts
- Joined: Feb. 2010
- Offline
-
- Quick Links