Christoph_H Posted May 8, 2018 Share Posted May 8, 2018 (edited) 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 May 14, 2018 by Christoph_H Quote Link to comment Share on other sites More sharing options...
Christoph_H Posted May 14, 2018 Author Share Posted May 14, 2018 This page shows the principle: http://www.tokeru.com/cgwiki/index.php?title=HoudiniPython#press_.27save_to_disk.27_on_a_rop My problem is that I have no experience with python. I'm just starting to get along with vex. It would be very nice 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. Quote Link to comment Share on other sites More sharing options...
bunker Posted May 15, 2018 Share Posted May 15, 2018 here is a simple example to render all Mantra ROPs: #find all nodes of type 'ifd' (Mantra) in the 'driver' context (ROP) for i in hou.nodeTypeCategories()["Driver"].nodeTypes()["ifd"].instances(): # display their full path print "render: " , i.path() # press the 'Render to Disk' Button i.parm("execute").pressButton() render_all_mantra_rop_bunker.hipnc Quote Link to comment Share on other sites More sharing options...
bunker Posted May 15, 2018 Share Posted May 15, 2018 and this creates a mantra node per selected object and set the image output path based on the node name: # before running the script, select "a,b,c" nodes ropnet = hou.node('/obj/ropnet1') # delete all nodes inside ropnet1 for i in ropnet.children(): i.destroy() # create a mantra node for each selected node for i in hou.selectedNodes(): n = i.name() m = ropnet.createNode("ifd") m.setName("mantra_"+n) m.parm("vm_picture").set("/tmp/myfilepath/"+n+".$"+"F4.exr") render_all_mantra_rop_bunker2.hipnc 1 Quote Link to comment Share on other sites More sharing options...
Christoph_H Posted May 17, 2018 Author Share Posted May 17, 2018 (edited) many thanks. very helpful. How is it possbile to exclude the null object from script? Edited May 18, 2018 by Christoph_H Quote Link to comment Share on other sites More sharing options...
bunker Posted May 19, 2018 Share Posted May 19, 2018 (edited) you can put that script on a shelf button if you prefer, same thing. if you mean exclude the null from all the selected nodes, you can filter by node types: # filter out all null nodes for i in hou.selectedNodes(): if i.type().name()!='null': m = ropnet.createNode("ifd") m.setName("mantra_"+n) m.parm("vm_picture").set("/tmp/myfilepath/"+n+".$"+"F4.exr") Edited May 19, 2018 by bunker Quote Link to comment Share on other sites More sharing options...
Christoph_H Posted May 23, 2018 Author Share Posted May 23, 2018 hi, yes this is what i meant. I added your new line but this will not work. What am I doing wrong? thanks. Quote Link to comment Share on other sites More sharing options...
bunker Posted May 27, 2018 Share Posted May 27, 2018 hard to tell without a hip file. Quote Link to comment Share on other sites More sharing options...
Christoph_H Posted May 30, 2018 Author Share Posted May 30, 2018 (edited) ok. Here it is. render_all_mantra_rop_exclude_problem.hipnc Edited May 30, 2018 by Christoph_H Quote Link to comment Share on other sites More sharing options...
bunker Posted June 14, 2018 Share Posted June 14, 2018 you were missing the indent block after the "if" statement: render_all_mantra_rop_fixed.hipnc Quote Link to comment Share on other sites More sharing options...
Christoph_H Posted June 18, 2018 Author Share Posted June 18, 2018 many thanks. I have to learn python next. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.