Getting a list in user defined selection order

E

e.tekinalp

Hello everybody,

I want to select components(vertices) in a particular Order with python.
So when I create a list the main problem is, that maya is not listing the verts in the correct selected order as I did.

Here an example:

I have selected from a polySphere the following vtx

[sphere.vtx400, sphere.vtx250, sphere.vtx260, sphere.vtx500, sphere.vtx100]

so maya is giving me a list like that:

[sphere.vtx100, sphere.vtx250, sphere.vtx260, sphere.vtx400, sphere.vtx500]

I know that there is a flag in the cmds.ls that created a list in ordered Selection and that you have to enable the tos flag from the selectPref command

cmds.selectPref(tso = 1)
vtx = cmds.ls(os = 1, flatten = 1)
cmds.select(vtx)

But then he gives me an empty list, I also tried to toggle it in the preference window, but to be honest that couldn't be the way.

So how can I get a list in an userdefined selection order.

Thank you guys for any help.

Cheerio
the turkish engineer
 
E

e.tekinalp

Ah sorry this is the correct snippet

cmds.selectPref(tso = 1)
vtx = cmds.ls(os = 1, flatten = 1)
print vtx

the other one wouldn't make any sense. :)
 
T

Terry Reedy

Hello everybody,

I want to select components(vertices) in a particular Order with python.
So when I create a list the main problem is, that maya is not listing the verts in the correct selected order as I did.

Here an example:

I have selected from a polySphere the following vtx

[sphere.vtx400, sphere.vtx250, sphere.vtx260, sphere.vtx500, sphere.vtx100]

so maya is giving me a list like that:

[sphere.vtx100, sphere.vtx250, sphere.vtx260, sphere.vtx400, sphere.vtx500]

It is sorting by name.
I know that there is a flag in the cmds.ls that created a list in ordered Selection and that you have to enable the tos flag from the selectPref command

cmds.selectPref(tso = 1)
vtx = cmds.ls(os = 1, flatten = 1)
cmds.select(vtx)

But then he gives me an empty list, I also tried to toggle it in the preference window, but to be honest that couldn't be the way.

So how can I get a list in an userdefined selection order.

Thank you guys for any help.

This is a maya question rather than a python question. Is not there a
maye list where you can ask? If not, is a a stackovevflow-like site that
covers maya?
 
E

e.tekinalp

Am Donnerstag, 14. März 2013 10:34:31 UTC+1 schrieb (e-mail address removed):
Hello everybody,



I want to select components(vertices) in a particular Order with python.

So when I create a list the main problem is, that maya is not listing theverts in the correct selected order as I did.



Here an example:



I have selected from a polySphere the following vtx



[sphere.vtx400, sphere.vtx250, sphere.vtx260, sphere.vtx500, sphere.vtx100]



so maya is giving me a list like that:



[sphere.vtx100, sphere.vtx250, sphere.vtx260, sphere.vtx400, sphere.vtx500]



I know that there is a flag in the cmds.ls that created a list in orderedSelection and that you have to enable the tos flag from the selectPref command



cmds.selectPref(tso = 1)

vtx = cmds.ls(os = 1, flatten = 1)

cmds.select(vtx)



But then he gives me an empty list, I also tried to toggle it in the preference window, but to be honest that couldn't be the way.



So how can I get a list in an userdefined selection order.



Thank you guys for any help.



Cheerio

the turkish engineer

ah thank you Terry I was in the wrong group.. XD
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,818
Latest member
Brigette36

Latest Threads

Top