Select all animated objects in scene

22 views
Skip to first unread message

Kamran Khan

unread,
Aug 24, 2020, 8:45:26 AM8/24/20
to Python Programming for Autodesk Maya
Hello,

How could I select all animated objects in my scene including cameras, nurbs curves, mesh etc in one click ? 

Thank you

craGato Salvaje

unread,
Aug 24, 2020, 9:09:46 AM8/24/20
to python_in...@googlegroups.com

I really do not know if that is the best way but this works.

import maya.cmds as cmds

def select_animated():
    animated = []
    xforms = cmds.ls(tr=True)

    for xf in xforms:
        if cmds.keyframe(xf, q=True):
            animated.append(xf)

    cmds.select(animated, r=True)

select_animated()

Run this in  a python tab in the script editor . Cheers.


--
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/bfcd79e0-f383-48d5-b3ee-58acdfa9084en%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages