something is wrong with the second line. any ideas? basically i want to object merge all selected sop nodes into its own /obj/geo container with the proper naming. thanks…
selNodes=hou.selectedNodes()selNodes_children=[]fornodeinselNodes:forchildinnode.children():selNodes_children.append(child)geo=hou.node('/obj').createNode('geo')geo.children()[0].destroy()objmerge=geo.createNode('object_merge')#for parm in objmerge.parms():# print parmobjmerge.parm('numobj').eval()objmerge.setParms({'numobj':len(selNodes_children)})foriinrange(len(selNodes_children)):objmerge.setParms({'objpath%d'%(i+1):selNodes_children[i].path()})
thanks i was impatient and got help from a colleague… that code works as a shelf tool. any idea how it could work on a button referencing itself into a geo container?
You need to convert your geo container into a digital asset first and add your code as a function under the scripts tab in TypeProperties. Then add a button and have the button run your function as a callback script. Please check these docs for more info about digital assets.