Prateek Rangineni

prateekfxtd

About Me

Connect

LOCATION
Not Specified
ウェブサイト

Houdini Skills

Availability

Not Specified

Recent Forum Posts

Load the python file saved using hou.Node.asCode() 2021年7月16日2:19

Hi Folks!

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:
node_to_disk.asCode(False, True)
I can load the saved file from a shelf tool using the code:
execfile(file_path)
But if I want to wrap that code in a function, using
node_to_disk.asCode(False, True, function_name="func_name")
It saves the python file as expected.

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.
Thanks!