Jump to content

Copying Network Dots and other Network Items to Clipboard


Mikal

Recommended Posts

Hi...

Am trying to automate the copying of a selection of nodes and dots to the clipboard..

If you copy these items manually using Ctrl-C then then it will correctly paste all the nodes and items together in the same network tree. 

Before network dots were introduced it was possible to do this in Python using:

hou.copyNodesToClipboard(hou.selectedNodes()) - however this doesn't include any items, so the dots aren't included and your network chain breaks if you paste this into your scene again.

It also doesn't seem possible to pass the items to the Clipboard with this function using: 

hou.copyNodesToClipboard(hou.selectedItems())  - returns a Type error.

So I was wondering if anyone else has encountered this issue, and if there's a function in HOM I'm missing, or a sensible workaround etc? Feels like if Ctrl-C works there should be something that can be done. 

Cheers

 

 

 

Edited by Mikal
Link to comment
Share on other sites

Hey man,

Did you try to use the node.copyItems ?

# Get all the selected nodes including dots
sel_items = hou.selectedItems()

# Get the node to copy the selected items to
copy_to_node = hou.node("/obj/geo1")

# To copy the selected items to your node
copy_to_node.copyItems(sel_items)

This should copy all the selected nodes including the dots on to whichever node you specify.

Hope this helps :)

Cheers

-J

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...