Created
April 18, 2017 18:17
-
-
Save yone80/3e1cfdb76005c901b7d3f8b1e6ba1557 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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