How to save a node network as py script?

   6452   4   0
User Avatar
Member
61 posts
Joined: Feb. 2006
Offline
Hi,

I have large networks that I want to automatically record as python code so I can run it in a python script later on and recreate the network, varying parm values procedurally. I don't want to make otl's, hda's. I want to do it like you would in cmd file. From ready made networks so I don't have to echo and recreate networks by hand again to record the building of the network.

I can loop through and grab parm values and node names and kinda do it in a top town way but its time consuming and needs editing for every different network. Is there a ready made .hou method that will do just that, grab a selected node network and make a recreatableb copy as python code/commands in a py module?

Thx
User Avatar
Member
387 posts
Joined: Nov. 2008
Offline
http://www.sidefx.com/docs/houdini14.0/hom/hou/Node#asCode [sidefx.com]
User Avatar
Member
61 posts
Joined: Feb. 2006
Offline
pezetko
http://www.sidefx.com/docs/houdini14.0/hom/hou/Node#asCode [sidefx.com]


EDIT***

Actually, that is helpful. Thanks. I was confusing .node and .Node classes.


Hi,

Cheers. It kinda helps combined with the connections switch but still requires a whole host of other overhead to setup soemthing workable. Pretty much what I have been doing so far.

If there isn't a network, “HDA” style option that works in a more global manner on a whole network, that would be what I am ideaaly seeking. Exporting out python or c++ style scripts from unity and maya is a straightforward, defined routine. I was thinking it would be the same in the hou interface but maybe not.

Thx
User Avatar
Member
387 posts
Joined: Nov. 2008
Offline
Also you can drag and drop your whole network to the shelf and create new shelf tool. Then you can recreate whole network with that one button only and single click. So look in that tool's script tab to see script that recreates your network.

Attachments:
shelf_tool_script.gif (1.0 MB)

User Avatar
Member
14 posts
Joined: Aug. 2016
Offline
Great!
  • Quick Links