When you query the selection of vert via
How can you get just the vert id number
ls()
, it will give you back data like so: pPlane1.vtx[60]
.How can you get just the vert id number
60
from that string? Python's re
module makes this pretty easy:# Python code import re myStr = 'pPlane1.vtx[60]' pattern = r'\d+' # This will return a list ["1", "60"], so grab the last item, & turn it into an int: vid = int(re.findall(pattern, myStr)[-1]) # 60