import maya.OpenMaya as om import maya.cmds as cmds def castStrToFloatArray(input): #break the string appart vector=[0.0,0.0,0.0]; #0: Start #1: firstSpace #2: Header #3: SecondSpace #4: X #5: Y #6: Z step=0; workingString=""; for x in range(0,len(input)): if step==0 and input[x]==" ": step+=1; if step==1 and input[x]!=" ": step+=1; if step==2 and input[x]==" ": step+=1; if step==3 and input[x]!=" ": step+=1; if step==4: if input[x]==" ": #x+=1 vector[0]=workingString; workingString="" step+=1; continue; else: workingString+=input[x]; if step==5: if input[x]==" ": #x+=1 vector[1]=workingString; workingString="" step+=1; continue; else: workingString+=input[x]; if step==6: workingString+=input[x]; vector[2]=workingString; print(vector); return vector; def faceNormal(): selected = cmds.ls(sl=True); face=cmds.polyInfo(fn=True); cmds.makeIdentity(apply=True,t=1,r=1,s=1,n=0,pn=1); normal1=castStrToFloatArray(face[0]); normal2=castStrToFloatArray(face[1]);