Skip to content

Instantly share code, notes, and snippets.

@masqu3rad3
Created February 23, 2021 10:47
Show Gist options
  • Select an option

  • Save masqu3rad3/49f17413e6d5aaba00c6f1cdedcf8653 to your computer and use it in GitHub Desktop.

Select an option

Save masqu3rad3/49f17413e6d5aaba00c6f1cdedcf8653 to your computer and use it in GitHub Desktop.
Small gist to get all the selected vertex id's
def get_selected_vertices():
sel = cmds.ls(sl=True)
for x in sel:
if ":" not in x:
yield int(x[s.find("[")+1:x.find("]")])
else:
start_v = int(x[x.index("[") + 1: x.index(":")])
end_v = int(x[x.index(":") + 1:x.index("]")])
for v in range(start_v, end_v+1):
yield v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment