検索 - User list
Full Version: Cops Multi ROPs: Save All with One Click? {[SOLVED]}
Root » Technical Discussion » Cops Multi ROPs: Save All with One Click? {[SOLVED]}
olivierth
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?
Jonathan de Blok
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()
tamte
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
olivierth
Thanks for the ideas!

I know nothing about python so I like the simple button reference to other buttons.
Jonathan de Blok
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
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.