Skip to content

Instantly share code, notes, and snippets.

@tb-animator
Created November 21, 2015 18:17
Show Gist options
  • Select an option

  • Save tb-animator/c599e9fb5f4c09098c6d to your computer and use it in GitHub Desktop.

Select an option

Save tb-animator/c599e9fb5f4c09098c6d to your computer and use it in GitHub Desktop.
import pymel.core as pm
def select_keyed_objs():
# empty list for our keyed objects to go in
keyed_objects = []
# loop over all objects in the scene (transform as mask to ignore animcurves etc)
for obj in pm.ls(type='transform'):
# check the keyframe count on the object
if pm.keyframe(obj, query=True, keyframeCount=True):
# if it's keyed, append it to our list
keyed_objects.append(obj)
return keyed_objects
# usage
'''
import pymel.core as pm
pm.select(select_keyed_objs(), replace=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment