Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save codedependant/4058325 to your computer and use it in GitHub Desktop.
Save codedependant/4058325 to your computer and use it in GitHub Desktop.
Maya Python Select Verticies by Material
import pymel.core as pm
import maya.cmds as cmds
cmds.hyperShade(o="lambert1")
cmds.ConvertSelectionToVertices()
#shrink selected region to avoid border verticies
cmds.ShrinkPolygonSelectionRegion()
#list selected verticies, sl for selected, fl for ungrouped
print pm.ls(sl=True,fl=True,l=True)
@Roumenov
Copy link

Roumenov commented Dec 3, 2021

I'd always wondered what the command was for selecting by material. Thanks for sharing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment