Jump to content
shadowst17

(SOLVED) Import nodes from file using Python

Recommended Posts

Posted (edited)

Hi guys,

Is there a way through Python to import a file(not sure which type) that has a bunch of nodes already fully set up and can placed inside a pre-defined location? I can't use digital asset due to pipeline reasons so what ever it reads needs to be imported RAW with no connections to outside dependencies. 

Edited by shadowst17
Solved

Share this post


Link to post
Share on other sites

you can use:

hou.Node.saveItemsToFile()

hou.Node.loadItemsFromFile()

it's similar to copy/paste but you can choose the location of CPIO file

  • Thanks 1

Share this post


Link to post
Share on other sites
24 minutes ago, anim said:

you can use:

hou.Node.saveItemsToFile()

hou.Node.loadItemsFromFile()

it's similar to copy/paste but you can choose the location of CPIO file

Can I control where those items from the file end up or will they be imported into whatever my current node network location is? 

Share this post


Link to post
Share on other sites
Posted (edited)

they'll end up under the node you are calling the function from, like help says

Quote

Load the contents of a file (saved with hou.Node.saveItemsToFile()) into the contents of this node.

 

Edited by anim
  • Thanks 1

Share this post


Link to post
Share on other sites
1 minute ago, anim said:

they'll end up under the node you are calling the function from, like help says

 

Ah yes sorry! Don't know what I was thinking. Thank you for your help!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×