Hello,

I'm trying to get all the infos from an MSelectionList().

Example :
If I select a transform in maya and then run this script :

sel = om.MSelectionList()
om.MGlobal.getActiveSelectionList(sel)

mDagPath = om.MDagPath()
sel.getDagPath(0, mDagPath)
print(mDagPath.fullPathName())
print(mDagPath.length())


I get : 

|pSphere1
1

And that' great, but when I select edeges of |pSphere1 and execute this:

sel = om.MSelectionList()
om.MGlobal.getActiveSelectionList(sel)

component = om.MObject()
mDagPath = om.MDagPath()
sel.getDagPath(0, mDagPath, component)
print(mDagPath.fullPathName())
print(mDagPath.length())

I also get :

|pSphere1
1


Where is the component's info inside my MSelectionList() ? 
I know the component's info is in my variable component, but is it possible 
to directly extract it from my MSelectionList ?


And a second question:
How to get the same thing but without selecting anything, like this:

sel = om.MSelectionList()
sel.add(pSphere1Shape1)
sel.add(pSphere1.e[317])   <------- I want to had the dges directly in my 
MSelection

        
component = om.MObject()
meshDagPath = om.MDagPath()
sel.getDagPath(0, meshDagPath, component)


Thank you

-- 
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/bf9d3aa6-1566-418b-aaf1-f3ebbfa9395f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to