Jump to content
TomRaynor

Saving selection of nodes to a new hip file

Recommended Posts

I was wondering if anyone had any nice ways to script the saving of a selection of nodes to a clean (new) hip file?

 

a function like hou.saveSelectionToNewHipFile() would be nice ;)

 

Thanks.

Share this post


Link to post
Share on other sites

It really depends on what you mean by a clean/new hip file.

 

You can use hou.copyNodesToClipboard() and hou.pasteNodesFromClipboard() to basically copy your nodes, then create a new hip and paste them into that.

 

If you want to basically extract them directly to a new file while maintaining the current session, that gets a lot more complicated.

Share this post


Link to post
Share on other sites

I am aware of the first method. Annoyingly the latter was what I was going for. I started off looking for an "Export selection" option under the main houdini "File" menu and was quite surprised when I didn't see one as both Maya and XSI have one.

Share this post


Link to post
Share on other sites

Whoa, cool subtleness there. I would never have thought of that workflow. I'd put in an RFE.

Share this post


Link to post
Share on other sites

What about using opscript command on nodes to save them into .cmd file and source that file into new houdini session? (There is nice example of this workflow in Ari Danesh GoProcedural - Light Shade and Render lesson 10)

There is also asCode() method in python.

Share this post


Link to post
Share on other sites

Recently I am create tool with similar functionality. Tool can import/export selected nodes to the file. I am used for it hython.

Share this post


Link to post
Share on other sites

the opscript and opwrite commands I had considered and I will definitely look into using those. Thanks Petr.

Vlad, would you care to share your tool or maybe suggest what method you used?

 

Thanks!

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

×