Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #41216 > unrolled thread

Getting a list in user defined selection order

Started bye.tekinalp@gmx.de
First post2013-03-14 02:34 -0700
Last post2013-03-14 16:13 -0700
Articles 4 — 2 participants

Back to article view | Back to comp.lang.python


Contents

  Getting a list in user defined selection order e.tekinalp@gmx.de - 2013-03-14 02:34 -0700
    Re: Getting a list in user defined selection order e.tekinalp@gmx.de - 2013-03-14 02:38 -0700
    Re: Getting a list in user defined selection order Terry Reedy <tjreedy@udel.edu> - 2013-03-14 18:38 -0400
    Re: Getting a list in user defined selection order e.tekinalp@gmx.de - 2013-03-14 16:13 -0700

#41216 — Getting a list in user defined selection order

Frome.tekinalp@gmx.de
Date2013-03-14 02:34 -0700
SubjectGetting a list in user defined selection order
Message-ID<658b2c00-16e8-4284-940c-c88442e7f169@googlegroups.com>
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

[toc] | [next] | [standalone]


#41217

Frome.tekinalp@gmx.de
Date2013-03-14 02:38 -0700
Message-ID<ed06e5c5-07a6-47f9-b8b6-33d4291f2990@googlegroups.com>
In reply to#41216
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. :)

[toc] | [prev] | [next] | [standalone]


#41246

FromTerry Reedy <tjreedy@udel.edu>
Date2013-03-14 18:38 -0400
Message-ID<mailman.3324.1363300723.2939.python-list@python.org>
In reply to#41216
On 3/14/2013 5:34 AM, e.tekinalp@gmx.de wrote:
> 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?

-- 
Terry Jan Reedy

[toc] | [prev] | [next] | [standalone]


#41249

Frome.tekinalp@gmx.de
Date2013-03-14 16:13 -0700
Message-ID<a354ad85-4dd9-4c33-a2f3-a3b992ccf06a@googlegroups.com>
In reply to#41216
Am Donnerstag, 14. März 2013 10:34:31 UTC+1 schrieb e.tek...@gmx.de:
> 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

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

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web