I can’t remember what was the command that I need to enter when I want to get my selection list in order in which the components were selected.
To make it a bit clearer, I selected some vertices and when I enter pm.selected(flatten = True) I don’t get the vertices in order I selected them. I’m pretty sure that there needs to be a command before that tells Maya to store the selection correctly.
The flag you are looking for is orderedSelection.
But before you can retrieve an ordered component selection you have to turn the option on in Maya preferences: Preferences > Selection > Track selection order
or
cmds.selectPref(trackSelectionOrder=True)
Thanks capper. That was exactly what I was looking for. I knew that there was something that needs to be turned on but I would probably remember what it was in a couple of days when I wouldn’t need it any more.