Description
A quick solution to a problem I encountered at work – using Houdini GUI functions to merge multiple assets on either a manual selection or name space identification
Code
### set name ### cfname = hou.ui.readInput("Name output", buttons=('create outputs',)) cfname = cfname[1] ##print cfname ###set parent path ### def spawn_obj(node): null0 = node.parent().createNode('null','OUT_'+cfname) null0.setInput(0, node, 0) null0.setColor(hou.Color((0, 0,0))) null0.moveToGoodPosition() file = node.parent().createNode('file',cfname+'_filecache') file.setInput(0,null0,0) file.setColor(hou.Color((0, 0.5,0))) file.moveToGoodPosition() null1 = node.parent().createNode('null','OUT_'+cfname+'_CACHE') null1.setInput(0,file,0) null1.setColor(hou.Color((0, 0,0))) null1.moveToGoodPosition() def spawn_rop(out): ### create rop ### ropOut = out.createNode('geometry', cfname) ropOut.moveToGoodPosition() return ropOut def spawn_merge(out): ### create merge ### ropM = out.createNode('merge', cfname+'_MERGE_HERE') ropM.setInput(0, spawn_rop(out)) ropM.moveToGoodPosition() return ropM def spawn_tractor(out): ### create CINESITE TRACTOR ### roptr = out.createNode('cs.jensm::tractor::1.0',cfname+'_TRACTOR') roptr.setInput(0,spawn_merge(out)) roptr.moveToGoodPosition() def spawn_nodes(node, out): spawn_obj(node) spawn_merge(out) spawn_tractor(out) spawn_nodes(hou.selectedNodes()[0], hou.node('out'))