ianwaters
An interesting problem...

When I add objects to a set in the interface, the order of objects looks like the first image attached...

However, when I come to calculate the values and set them, they are set in completely the wrong order (not backwards, or anything that would make sense, but seemingly random)... See second image, the shape that should be first (number 1) is WAAAAY down at the bottom...

I'm getting the set members with this code:

 

Quote:

thisNode = self.thisMObject()

selList = om.MSelectionList()

fnSet = om.MFnSet(thisNode)

setMembers = fnSet.getMembers(selList,0)



So, any clues why this selection list is out of order?

Thanks for any advice!
Ian

 

Screen_Shot_2012-11-23_at_17.11.44.png Screen_Shot_2012-11-23_at_17.12.27.png
Reply 0 0
pshipkov
What happens if you query the set using commands ?
I usually trace the connections of the set.
Reply 0 0
ianwaters
It returns the bad order...

So the order the objects are displayed in the interface would appear to be irrelevant as there is some hidden internal order?
Reply 0 0
pshipkov
what happens if you go through the connections ?
Reply 0 0
ianwaters
It returns the bad order...

This is so odd... Screen_Shot_2012-11-23_at_17.28.03.png
Reply 0 0
ianwaters
Perhaps I should access the dagSetMembers in a different way (as I would an array attribute, if that's possible). 
Reply 0 0
pshipkov
It appears the outliner sorts things by name.
I never needed ordered list of objects in the set so never encountered the problem.
You will probably need custom solution.
Reply 0 0
Reply