Jump to content

hda Tools/script access question


holycause

Recommended Posts

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

 

post-8419-0-60898300-1457501017_thumb.pn

Link to comment
Share on other sites

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 by anim
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...