I'm having trouble retrieving a list of individual component names within the API. In Mel I can use the commands ls -sl -flatten; or filterExpand -ex true to list each component individually even if they where selected with a marque box. But the MSelectionList and MItSelectionList classes do not seem to give me that option.
For example. If I select all cvs on a sphere with a marque box and execute:
string $selection[] = ls -sl - fl
;
I would get...
// Result: spher.cv[0] [0] spher.cv[0] [1] spher.cv[0] [2] spher.cv[0] [3] spher.cv[0] [4] spher.cv[1] [0] and so on...
With the same selection in the API:
MStringArray components;
MSelectionList selection;
MItSelectionList iter (selection, MFn::kComponents, &stat );
iter.getStrings(components);//inserts the names of selections into MStringArray
int size = components.length();// equals 1: sphere.cv[0:4] [0:5];
How do I iterate through each component with "sphere.cv[0:4] [0:5]"? Please don't say I have to parse the string.
60