Automating rops with python

   2228   5   0
User Avatar
Member
48 posts
Joined: Feb. 2018
Offline
Hi,

Is it possible to render all existing rops and also rops in obj levels one after the other?
So without manual links?

It is a file with over 100 different rops.

Can i achieve in hscript that a rop in an obj level takes the name of the obj level?

thanks.
Edited by Christoph_H_ - May 14, 2018 07:07:37
User Avatar
Member
2537 posts
Joined: June 2008
Online
Check out the bottom of this page.
http://www.tokeru.com/cgwiki/index.php?title=HoudiniPython [www.tokeru.com]

You can press the button on any ROP using Python.
Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
48 posts
Joined: Feb. 2018
Offline
thanks. This is what I'm looking for.

My problem is that I have no experience with python. I'm just starting to get along with vex.

It would be very kind of you to give me a hint.
How should the script look like, with which I manage to create my own “mantra rop” with “output path with object names” from the selected objects?
Could I set the scene floor to be added to each one?

thanks.
User Avatar
Member
17 posts
Joined: March 2015
Offline
You can create mantra rop set to render only curently selected objects with script like this:

mantraRop = rop = hou.node('/out').createNode('Mantra', node_name="mantra")
selectedObjects = ' '.join(list(map(lambda x: x.name(), hou.selectedItems())))
mantraRop.setParms({'vobject': '', 'forceobject': selectedObjects})

if you also want to set output path acording to object selection You have to simply construct it (using ‘hou.selectedObjects()’) and set ‘vm_picture’ parameter on mantra rop
Edited by skoora - May 14, 2018 18:40:38
User Avatar
Member
655 posts
Joined: Feb. 2006
Offline
qLib has a lovely tool to handle these kind of scenearios like re-generation of caches and renders…
User Avatar
Member
48 posts
Joined: Feb. 2018
Offline
thanks.
  • Quick Links