Skip to content

Instantly share code, notes, and snippets.

@TSCG
Created September 19, 2023 07:15
Show Gist options
  • Save TSCG/d85ef06190926055a5144269ccaed287 to your computer and use it in GitHub Desktop.
Save TSCG/d85ef06190926055a5144269ccaed287 to your computer and use it in GitHub Desktop.
selShortestEdgePath/ Maya
# -*- coding: utf-8 -*-
import maya.cmds as cmds
import re
def selShortestEdgePath():
sel = cmds.ls(sl=1,fl=1)
objName = cmds.ls(sl=1,o=1)[0]
numA = int( re.findall("(?<=\[).+?(?=\])", sel[0])[0])
numB = int( re.findall("(?<=\[).+?(?=\])", sel[1])[0])
cmds.polySelect( objName,shortestEdgePath=(numA, numB) )
selShortestEdgePath()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment