Question about the MSelectionList object in Maya API.
I see that the getSelectionStrings() function returns selection on the format of pCube1.vtx[0:7] instead of a flattened list which you can get via maya.cmds.ls(flatten=True). Is there any smart way around this?
Problem I have with this is that you can’t really loop thru a component selection (without getting the DAG-path and running a mesh iterator on the entire mesh - which will go through ALL the components if I am not mistaken?) I want an easy way of storing partial component selections and the ability to loop thru these at a later stage.
I tried doing maya.cmds.ls(selectionList.getSelectionStrings(), flatten=True) but ran into some performance problems (100k vertices) where it would lag for several seconds. I also tried making my own flattened string list using regular expressions (which was 5x faster but still slow). It feels like I’m fighting this from the wrong end here.