I'm trying to serialize and save nodes to disk using the hou.Node.asCode()
When I save a node to disk using asCode() like this:
I can load the saved file from a shelf tool using the code:
But if I want to wrap that code in a function, using
It saves the python file as expected.
node_to_disk.asCode(False, True, function_name="func_name")
But how do I load this file in houdini again?? If I try to call that function, I get an error saying hou is not defined.
Also, if I have multiple functions in that file, can I just call one at a time?
Any help will be appreciated.