Created
February 23, 2021 10:47
-
-
Save masqu3rad3/49f17413e6d5aaba00c6f1cdedcf8653 to your computer and use it in GitHub Desktop.
Small gist to get all the selected vertex id's
This file contains hidden or 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
| 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