The problem is, the user selects a face. But i need both the face
number and object to drive two different functions.
For example -
pCube1.f[4] I'd need the number '4' and the object 'pCube1'.
Therefore i thought i needed to tokenize the user selection string to
get both the face number and the object name. I did this by -
# User selects face. Get user selected Face
selected = om.MSelectionList()
om.MGlobal.getActiveSelectionList(selected)
selectedObj = []
selected.getSelectionStrings(selectedObj)
# Tokenize for the correct face number
faceNumString = selectedObj
# Tokenize String
tokenFace = re.findall('\[(\d+:*\d*)\]$', faceNumString)[0]
print tokenFace
I understand that the findall command is not reading the variable but
reading it as it's own stand alone characters. I was wondering if
there was any way to tokenize the variable so i get both the face
number and the object name? Any help any one can give would be greatly
appreciated.
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/python_inside_maya
-~----------~----~----~----~------~----~------~--~---