Just one thing to note about the cmds vs the pymel approach. If you have at
least a few curves, the performance difference is pretty big:

* in Maya 2015 on a Macbook Pro

# curves   cmds    pymel
  500      0.02s   0.12s
 1000      0.03s   0.25s
 5000      0.16s   1.33s
10000      0.33s   2.48s
20000      0.69s   5.32s

A lot more overhead on creating all the PyNodes in a loop. Especially if
you don't need the PyNodes and just the string names.


On Tue, Mar 10, 2015 at 4:30 PM AK Eric [email protected]
<http://mailto:[email protected]> wrote:

How about one more way? :)
>
> import pymel.core as pm
> curves = map(lambda x:x.firstParent().nodeName(), pm.ls
> (type='nurbsCurve'))
>
> This returns the string names of the parent transforms.  If you want the
> actual PyNodes, just get rid of the nodeName() method.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/a218df4d-4ae5-4937-9a18-bd84596fd8c0%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/a218df4d-4ae5-4937-9a18-bd84596fd8c0%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
​

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA3NtyqC1_FiFqDEwD1GYqkEokjKZ_ZkDV72ntUrhsoKVQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to