python class question

   1784   1   2
User Avatar
Member
29 posts
Joined: Aug. 2013
Offline
I am trying to use a class I created in python within Houdini, and I'm struggling to figure out how to source it so it becomes usable. I would like to utilize it in a python node, but as it is quite long I don't want to actually have the code in the same node as my execution.

I know there has to be a way, but for the life of me I can't figure it out. I have tried a few things, but none of them seem to be having a functional result.
User Avatar
Member
36 posts
Joined: Sept. 2014
Offline
I personally like creating a subnetwork and saving it as a Houdini asset (.hda)

Then you can embed all your python code into it

Right clicking your asset, edit type properties
Then choose the ‘scripts’ tab, then you need it you just install your asset in your scene, you update the asset to update across scenes using it

Also can call the embedded script from within the asset or from the assets UI

Can link code when I get home tonight if you like
todo: add signature
  • Quick Links