Skip to content

Instantly share code, notes, and snippets.

@yone80
Created April 18, 2017 18:17
Show Gist options
  • Save yone80/3e1cfdb76005c901b7d3f8b1e6ba1557 to your computer and use it in GitHub Desktop.
Save yone80/3e1cfdb76005c901b7d3f8b1e6ba1557 to your computer and use it in GitHub Desktop.
import soptoolutils
selection = None
if type(kwargs['pane']) is hou.SceneViewer:
viewer = kwargs['pane']
selection = viewer.selectGeometry(geometry_types=(hou.geometryType.Primitives, hou.geometryType.Edges,))
n = soptoolutils.genericTool(kwargs, '$HDA_NAME')
if selection is not None:
selstring = ''
for sel in selection.selectionStrings():
selstring += sel
selstring += ' '
if len(selstring) != 0:
geotype = selection.geometryType()
if geotype == hou.geometryType.Edges:
n.setParms({'group':selstring, 'grouptype':'edges'})
if geotype == hou.geometryType.Primitives:
n.setParms({'group':selstring, 'grouptype':'prims'})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment