Hey Justin, thx for replying.
I think it's mainly just the iterators that I'm not really clear on. The docs
seem to hit on the function sets, but I'm not really finding anything that
explains iterators in detail, maybe Im missing it?
so would you use a function set to access points of a polymesh, then use an
iterator to iterate through each point? is there a common direct useage between
the function sets & iterators? or is it just case by case?
anyhow. I'm working with the 2.0 python api right now, since I just noticed
yesterday that quite a few more classes were added with sp4.
With the code below, which would be the proper way to write it? I feel like
the first way is best. what does the iterator really contribute? speed? am I
even using the iter correctly? ;)
#=======================================
import maya.api.OpenMaya as om2
selList = om2.MSelectionList( om2.MGlobal.getActiveSelectionList() )
dagList = om2.MSelectionList()
for i in range( selList.length() ):
dagList.add( selList.getDagPath(i) )
print dagList
#=======
selList = om2.MSelectionList( om2.MGlobal.getActiveSelectionList() )
selIter = om2.MItSelectionList( selList )
dagList = om2.MSelectionList()
while not selIter.isDone():
dagList.add( selIter.getDagPath() )
selIter.next()
print dagList
#=======================================
Thanks!
Kev
--
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/6ed87828-bc64-4f4c-8774-312039ae7d9a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.