--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/5c511357-544d-4530-bbde-c5e59b17441a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CADKA4CrUfp0HedNetTQ-jrZoyOps5Tdqf3FfOg%3DdU6RZZoAVUA%40mail.gmail.com.
wow, simple as that. thanks all for your help here!
Sam
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/a3bf69f4-2a24-443f-a548-f3fc19405eda%40googlegroups.com.
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.
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/a218df4d-4ae5-4937-9a18-bd84596fd8c0%40googlegroups.com.
You may need to remove duplicates, when there are more than one shape under a transform.
from maya import cmds
transform = cmds.createNode("transform")
shape1 = cmds.createNode("nurbsCurve", parent=transform)
shape2 = cmds.createNode("nurbsCurve", parent=transform)
shapes = cmds.ls(type="nurbsCurve")
transforms = cmds.listRelatives(shapes, parent=True)
assert len(transforms) == 2 # Should be 1
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOBADKuRRWxYxNrmb4xYsEzqMbSbbSGGzW57PG0oW0v9WQ%40mail.gmail.com.