Home Website Youtube GitHub

Picker and control association list

In the picker I have an item and inside it has a list of controls, will it be possible that the selection is based on how the order of the list is formulated, the associated controls? The question is because with another script I make copy and paste information based on a selection list already established.

  1. Are you asking if the Picker selects controllers in the order of the list? (You can test that. Press the button to select the controls. Then just print to see what the order is:
import maya.cmds as cmds
for each in cmds.ls(sl=True):
    print(each)
  1. Or are you asking if it’s possible to change the order of the list?

  2. Or are you saying that when you make an ordered selection, and then load it into “Control Association”, the resulting order changes, and you don’t want that to happen?


Can you say more about the copy/pasting? What are you copy/pasting, and how does the order affect that? And why does the order affect that?

1 Like

I was referring to option 3.

1 Like

Ok cool, and my last question? Maybe there is a workaround where order doesn’t matter for your workflow.

Otherwise maybe the code for the Anim Picker could be adjusted to use an OrderedSet. Maybe someone can fix that.

Yeah a very brief look at the code and I see a comment that says it returns “sets”, which are not ordered. There are quite a few different files in the anim_picker module, so I can’t easily find where the problem is, or if it would be quick to fix.

But once it’s found, it might be very easy. I think it would make sense to make a PR that makes the controls return in selected order. And no good reason it should ever not respect the order. (I don’t think I’ll have time for this, personally.)

2 Likes

In this case it is a requirement to have the exact order of the elements as listed in the picker. :grimacing:

It is good to know that the order is not respected, thank you very much for your time, it is much appreciated what you do.