Search code examples
pythonanimationmaya

Maya - animation curves for selected objects using python


As the title says, I am trying to get all animation curves from selected objects(transforms) using python in maya.

How would I do that?


Solution

  • Use the listConnections command, which by default acts on selected objects. The t='animCurve' ensures that you're only returned animation curves.

    cmds.listConnections(t='animCurve')
    

    This returns a list of animation curves driving your selection.