Skip to content

Instantly share code, notes, and snippets.

@rondreas
Created November 20, 2018 16:04
Show Gist options
  • Select an option

  • Save rondreas/b75de3e98ddb857810711f316ed12c9d to your computer and use it in GitHub Desktop.

Select an option

Save rondreas/b75de3e98ddb857810711f316ed12c9d to your computer and use it in GitHub Desktop.
def getActive():
""" Check current selection to find if we're currently only selecting a specific component. """
if all(isinstance(x, pm.MeshFace) for x in pm.selected()):
return eSelection.face
if all(isinstance(x, pm.MeshEdge) for x in pm.selected()):
return eSelection.edge
if all(isinstance(x, pm.MeshVertex) for x in pm.selected()):
return eSelection.vert
# If no matching component, default to object
return eSelection.object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment