Cops Multi ROPs: Save All with One Click? {[SOLVED]}

   282   4   1
User Avatar
Member
1251 posts
Joined: 4月 2017
オフライン
Hi!

I'm making an HDA to bake multiple textures (Diffuse, normals, rougness, etc). How can I have a single "Render" button that saves all ROPs?
Edited by olivierth - 昨日 11:02:44

Attachments:
Houdini_Multi_Bake_Cops_01.jpg (50.0 KB)

-Olivier
User Avatar
Member
307 posts
Joined: 7月 2013
オンライン
In you HDA type properties add a 'Python Module' in the script tap, in that module make a function:

def SomeFunction(kwargs):
print(kwargs)

then add a button to your HDA's interface and add a callback to it like this:
hou.pwd().hm().SomeFunction(kwargs)

When you press the button you can see the arguments passed to it.. final code will be a more elegant version of this:

def SomeFunction(kwargs)
kwargs['node'].node("rop_comp1").parm("execute").pressButton()
kwargs['node'].node("rop_comp2").parm("execute").pressButton()
kwargs['node'].node("rop_comp2").parm("execute").pressButton()
Edited by Jonathan de Blok - 昨日 04:04:02
More code, less clicks.
User Avatar
Member
9729 posts
Joined: 7月 2007
オフライン
You dont need to write callback script, just channel reference their Render button to a single button on your HDA

Or create a ROPnet inside of your HDA, Fetch them all in there, merge and promote the render button on the Merge ROP

Similarly you can ROP Fetch them into a TOPnet
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
1251 posts
Joined: 4月 2017
オフライン
Thanks for the ideas!

I know nothing about python so I like the simple button reference to other buttons.
-Olivier
User Avatar
Member
307 posts
Joined: 7月 2013
オンライン
tamte
You dont need to write callback script, just channel reference their Render button to a single button on your HDA

Nice! I didn't even knew that was a thing
Edited by Jonathan de Blok - 昨日 15:08:11
More code, less clicks.
  • Quick Links