I'm not sure if it's what you told me to do but I did it like this :
def isEdgesConnected(e1Index=None, e2Index=None, objShape=None):
if not objShape:
# Get the object from selection
sel = om.MSelectionList()
om.MGlobal.getActiveSelectionList(sel)
else:
sel = om.MSelectionList()
cmds.select('{0}.e[{1}]'.format(objShape, e1Index),
'{0}.e[{1}]'.format(objShape, e2Index), r=True)
om.MGlobal.getActiveSelectionList(sel)
component = om.MObject()
meshDagPath = om.MDagPath()
sel.getDagPath(0, meshDagPath, component)
eIter = om.MItMeshEdge(meshDagPath, component)
eIter2 = om.MItMeshEdge(meshDagPath, component)
while not eIter.isDone():
eIter2.next()
returnValue = eIter.connectedToEdge(eIter2.index())
break
return returnValue
Now I can call the function like this :
isEdgesConnected(281, 282, 'pSphereShape1')
isEdgesConnected()
What I mean by more direct way is to note hqve to select anything like a
did in my script (cmds.select('{0}.e[{1}]'.format(objShape, e1Index),
'{0}.e[{1}]'.format(objShape, e2Index), r=True)) and just give this
information directly in a function.
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/a76f21c5-6de3-4b65-b54f-0160b2c989fa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.