Reference Copy with Python .

   447   4   1
User Avatar
Member
21 posts
Joined: Jan. 2018
Offline
Hello everyone, I am wondering how I can make this thing(Copy reference) work using Python. I have tried using the functions 'copyNodesTo' and 'copyTo', but they only copy nodes without any reference. I would appreciate any help.

Thank you very much.

Attachments:
Screenshot 2024-04-08 231536.png (45.7 KB)

User Avatar
Member
1908 posts
Joined: Nov. 2006
Offline
You need to use hou.Node.copyItems() with the requisite parameters set:

https://www.sidefx.com/docs/houdini/hom/hou/Node.html#adding-and-removing [www.sidefx.com]
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
21 posts
Joined: Jan. 2018
Offline
graham
You need to use hou.Node.copyItems() with the requisite parameters set:

https://www.sidefx.com/docs/houdini/hom/hou/Node.html#adding-and-removing [www.sidefx.com]

Thanks for your assistance. May I ask if "Parameters set" refers to the name of each parameter I want to copy ?
User Avatar
Member
1908 posts
Joined: Nov. 2006
Offline
I just mean you need to set the function parameters that would cause it to create a reference copy:
geo = hou.node("/obj/geo1")
xform_to_reference = geo.node("transform1")
geo.copyItems([xform_to_reference], channel_reference_originals=True)
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
21 posts
Joined: Jan. 2018
Offline
graham
I just mean you need to set the function parameters that would cause it to create a reference copy:
geo = hou.node("/obj/geo1")
xform_to_reference = geo.node("transform1")
geo.copyItems([xform_to_reference], channel_reference_originals=True)
Wow, that worked! Thanks so much, Graham.
  • Quick Links