pymel.core.animation.autoKeyframe

autoKeyframe(*args, **kwargs)

With no flags, this command will set keyframes on all attributes that have been modified since an autoKeyframe -state oncommand was issued. To stop keeping track of modified attributes, use autoKeyframe -state offautoKeyframe does not create new animation curves. An attribute must have already been keyframed (with the setKeyframe command) for autoKeyframe to add new keyframes for modified attributes. You can also query the current state of autoKeyframing with autoKeyframe -query -state.

Flags:

Long Name / Short Name Argument Types Properties
addAttr / aa PyNode ../../../_images/edit.gif
  Add to the list of plugs (node.attribute) that autoKeyframe is currently considering for auto keying. This list is transient and short-lived, and is reset as soon as autoKeyframe sets the keyframe or decides that no keyframe is to be set, on completion of the next set attribute.
characterOption / co unicode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
  Valid options are: standard, all. Dictates whether when auto-keying characters the auto-key works as usual or whether it keys all of the character attributes. Default is standard.
listAttr / lsa bool ../../../_images/query.gif
  Returns the list of plugs (node.attribute) that autoKeyframe is currently considering for auto keying. This list is transient and short-lived, and is reset as soon as autoKeyframe sets the keyframe or decides that no keyframe is to be set, on completion of the next set attribute.
noReset / nr bool ../../../_images/create.gif ../../../_images/edit.gif
  Must be used in conjunction with the state/st flag. When noReset/nr is specified, the list of plugs to be autokeyed is not cleared when the state changes
state / st bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
  turns on/off remembering of modified attributes Flag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.autoKeyframe

Example:

import pymel.core as pm

# Start remembering attributes that have changed
#
pm.autoKeyframe( state=True )
# Result: True #

# Set a keyframe for all attributes that have changed
# since the last "autoKeyframe( state=True )
#
pm.autoKeyframe()
# Result: 0 #

# Stop remembering attributes that have changed.
# Note that Subsequent "autoKeyframe" commands
# (with no flags) will have no effect until an
# autoKeyframe( state=True ) command is executed.
#
pm.autoKeyframe( state=False )
# Result: False #

# When auto-keying, key all character attributes, not just
# those that have changed.
#
pm.autoKeyframe( characterOption="all" )
# Result: u'all' #