anicg Posted February 13, 2019 Share Posted February 13, 2019 (edited) I have a node graph that generates a geometry. tweaked a few parameters and created a few takes, each take is a version (different design) of the same geometry. I manually click to see each take on the take list. Now I want to use this geometry: A - inside Houdini, several times in the same scene but ask it to be take 1 here, and take 2 there, take 3 somewhere else... B - Outside Houdini: Export all the takes (each as a separate obj) without doing it manually one by one? Any idea how I can do A, and how I can do B? Edited February 13, 2019 by anicg Quote Link to comment Share on other sites More sharing options...
vtrvtr Posted February 13, 2019 Share Posted February 13, 2019 There's no straight forward way to do A. You can hack it with python, but it's likely not the most practical approach. Your best bet is to export the geometry and reload it after wards, which is what you want in B anyway. Unfortunately there's also no support for something like that out-of-the-box. But you can script it, here's a way node = hou.pwd() geo = node.geometry() ## PARAMETERS ## rop = node.parm("rop_node").evalAsNode() # Get the node you want to export your geometry from rop_output_template = rop.parm("sopoutput").unexpandedString() network_destination = hou.node("/out") # Where it will create the ROPs to export rop_type = "geometry" # The type of node used to export. Usually 'geometry' ## FUNCTION ## for take in hou.takes.takes(): new_rop_name = "{}_exporter".format(take.name()) if not network_destination.node(new_rop_name): new_rop = network_destination.createNode(rop_type, new_rop_name) # Create rop nodes new_rop_output_path = rop_output_template.replace("\$ACTIVETAKE", take.name()) new_rop_output_path = new_rop_output_path.replace("\$OS", rop.name()) new_rop.setParms({"soppath": rop.path(), "sopoutput": new_rop_output_path, "take": take.name()}) # Now that we have exporters, we'll have to read them back new_read_name = new_rop_name.replace("exporter", "reader") if not node.parent().node(new_read_name): new_read = node.parent().createNode("filecache", new_rop_name.replace("exporter", "reader")) read_file_name = rop_output_template.replace("\$OS", new_read.name()) new_read.setParms({"take": take.name(), "file": new_rop_output_path, "loadfromdisk": 1}) In the example file I'm using it on a python sop, but you can put it on a shelf tool. take_export_of.hip 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.