Automating rops with python

   2931   5   0
User Avatar
Member
48 posts
Joined: 2月 2018
オフライン
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_ - 2018年5月14日 07:07:37
User Avatar
Member
2658 posts
Joined: 6月 2008
オフライン
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.5
Windows 11 64GB Ryzen 16 core.
nVidia 3060RTX 12BG RAM.
User Avatar
Member
48 posts
Joined: 2月 2018
オフライン
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: 3月 2015
オフライン
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 - 2018年5月14日 18:40:38
User Avatar
Member
655 posts
Joined: 2月 2006
オフライン
qLib has a lovely tool to handle these kind of scenearios like re-generation of caches and renders…
User Avatar
Member
48 posts
Joined: 2月 2018
オフライン
thanks.
  • Quick Links