copy node from 1 network to another with python

   12229   6   1
User Avatar
Member
277 posts
Joined: July 2006
Offline
Hi!

How can I copy a node from 1 network to other with python?

This node is a “base node” for some settings - it has about 500 parameters and I want to copy it and then tweak these params - the way of creating node of this type and then setting each parameter is slow

So is there any method to “copy and paste” node with python ?

thank you
User Avatar
Member
1926 posts
Joined: Nov. 2006
Offline
Take a look at hou.copyNodesTo().

http://www.sidefx.com/docs/houdini11.0/hom/hou/copyNodesTo [sidefx.com]
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
277 posts
Joined: July 2006
Offline
Thank you!
User Avatar
Member
277 posts
Joined: July 2006
Offline
graham could you please post simple python expression demonstrating this expression?

Everytime I want to use it (in several h10 builds) houdini crashes
User Avatar
Member
1926 posts
Joined: Nov. 2006
Offline
You need to pass the node(s) you want to copy as a list/tuple or it will crash in crash as you've observed. It now longer crashes in Houdini 11.0 when you do this however.

# One node
hou.copyNodesTo( , hou.node(“/obj”) )
# Multiple nodes.
hou.copyNodesTo( , hou.node(“/obj”) )
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
277 posts
Joined: July 2006
Offline
thank you!

I was trying to pass it as tuple , but as array it works

thank you once again
User Avatar
Member
85 posts
Joined: Aug. 2010
Offline
That is very handy though a bit confusing.
I had the same issue until i found this thread
cheers
Sam Swift-Glasman
Art Director
Five AI
  • Quick Links