houdini, python, scripts

Python: Split Into Groups


This little script for Houdini is one I’ve had knocking about and thought might be useful to throw out onto t’interweb. Select the node at which you want to split out the groups and it will create a bunch of blasts and OUT nodes to separate out per group.

import hou

selectedNodes = hou.selectedNodes()

for n in selectedNodes:
    groups = n.geometry().primGroups()
    for group in groups:
    
        blastNode = n.createOutputNode('blast')
        blastNode.setName(group.name())
        blastNode.parm('group').set(group.name())
        blastNode.parm('negate').set(1) 
        
        outNull = blastNode.createOutputNode('null')
        outNull.setName('OUT_' + group.name())
        
        outNull.setColor(hou.Color([1,0,0]))

Leave a Reply

Your email address will not be published. Required fields are marked *

one + 10 =