Depending on the size of the selection the extra overhead of casting
each node to a PyNode could be to much of an overhead. String
comparison might be faster.

perhaps this would be faster?

myNode.longName() in cmds.ls(sl=True, l=True)

The fastest solution could be implemented as myNode.isSelected().



On Thu, Jun 10, 2010 at 2:29 AM, Paul Molodowitch <elron...@gmail.com> wrote:
> You mean something that would do:
>
> myNode in pm.selected()
>
> ?
>
> Obviously, this would be pretty trivial to implement... but given how
> easy it is to just type in the above, and that it seems just as
> readable, I'm not sure how much need for it there is.
>
> Anybody else on here have any opinions?
>
> - Paul
>
> On Wed, Jun 9, 2010 at 3:55 PM, shawnpatapoff <shawnpatap...@gmail.com> wrote:
>> Is there any way to test if a node is selected, other than storing the
>> current selection list and testing against it?
>>
>> Would be nice if I had something like node.isSelected()...
>>
>> Cheers,
>> Shawn
>>
>> --
>> http://groups.google.com/group/python_inside_maya
>
> --
> http://groups.google.com/group/python_inside_maya
>



-- 
David Moulder
http://www.google.com/profiles/squish3d

-- 
http://groups.google.com/group/python_inside_maya

Reply via email to