holycause Posted March 9, 2016 Share Posted March 9, 2016 hey guys, I'm writing an otl with multiple tools. And I would like to use one of the tools to store functions I will need in all the other tools. If you look at the screen capture, I have a "test" function in the hda_functions tool. I would like to call that function from any other tool, ie from the load_preset tool. I've been trying to figure that out for a while today and couldn't find the solution. Is it even possible? cheers Quote Link to comment Share on other sites More sharing options...
anim Posted March 9, 2016 Share Posted March 9, 2016 (edited) I'd store all necessary functions in PythonModule section of the asset instead of a tool then to access them from any tool just call hda = hou.nodeType(hou.sopNodeTypeCategory(), '$HDA_NAME') hda.hdaModule().test() and of course adjust type category to fit the category of the asset you are defining tools in Edited March 9, 2016 by anim Quote Link to comment Share on other sites More sharing options...
holycause Posted March 9, 2016 Author Share Posted March 9, 2016 cheers I tried something similar, but am getting that same error I had 'module' object has no attribute 'test' Quote Link to comment Share on other sites More sharing options...
anim Posted March 9, 2016 Share Posted March 9, 2016 seems to work for me test.hda Quote Link to comment Share on other sites More sharing options...
holycause Posted March 9, 2016 Author Share Posted March 9, 2016 I see, that make sense, I didn't put my test function inside the python module but inside another tool. still wondering if I can access it from another tool. will do like this for now. cheers Quote Link to comment Share on other sites More sharing options...
anim Posted March 9, 2016 Share Posted March 9, 2016 since Tools section is stored in hda in the format of XML shelf file, and accessing code of the functions from within is possible through parsing, It wouldn't be very practical. What advantages it would have over PythonModule or over Extra Files section? 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.