pymel.core.animation.timeEditorAnimSource¶
- timeEditorAnimSource(*args, **kwargs)¶
Commands for managing animation sources.
Flags:
Long Name / Short Name Argument Types Properties addObjects / ao unicode Populate the given object(s) and their attributes to anim source to Time Editor. For multiple object, pass each name separated by semicolon. In query mode, return the number of attributes that will be populated given the flags, along with the animation’s first and last frames for the given object(s). Similar to -addSelectedObjectsflag but acts on given object(s) instead. This flag will override the flag -addSelectedObjects. addRelatedKG / akg bool During population, determine if associated keying groups should be populated or not. Normally used for populating HIK. By default the value is false. addSelectedObjects / aso bool Populate the currently selected objects and their attributes to anim source or Time Editor. In query mode, return the number of attributes that will be populated given the flags, along with the animation’s first and last frames. addSource / asc unicode Add single new target attribute with its animation. apply / ap bool Connect anim source’s animation directly to the target objects. If the Time Editor is not muted, connect to scene storage instead. attribute / at unicode Populate a specific attribute on a object. bakeToAnimSource / bas unicode Create a new anim source with the same animation as this anim source. All non-curve inputs will be baked down, whereas curve sources will be shared. calculateTiming / ct bool Adjust start/duration when adding/removing sources. If query it returns the [start,duration] pair. copyAnimation / cp bool Copy animation when adding source. drivenClips / dc bool Return all clips driven by the given anim source. exclusive / exc bool Populate all types of animation sources which are not listed by typeFlag. export / ex unicode Export given anim source and the animation curves to a specified Maya file. importAllFbxTakes / aft bool Import all FBX takes into the new anim sources (for timeEditorAnimSource command) or new containers (for timeEditorClip command). importFbx / fbx unicode Import an animation from FBX file into the new anim source (for timeEditorAnimSource command) or new container (for timeEditorClip command). importFbxTakes / ft unicode Import multiple FBX takes (separated by semicolons) into the new anim sources (for timeEditorAnimSource command) or new containers (for timeEditorClip command). importMayaFile / mf unicode Import an animation from Maya file into the new anim sources (for timeEditorAnimSource command) or new containers (for timeEditorClip command). importOption / io unicode Option for importing animation source. Specify either ‘connect’ or ‘generate’. connect: Only connect with nodes already existing in the scene. Importing an animation source that does not match with any element of the current scene will not create any clip. (connect is the default mode). generate: Import everything and generate new nodes for items not existing in the scene. importPopulateOption / ipo unicode Option for population when importing. importedContainerNames / icn unicode Internal use only. To be used along with populateImportedAnimSourcesto specify names for the created containers. includeRoot / irt bool Populate transform (Translate, Rotate, Scale) of hierarchy root nodes. isUnique / iu bool Return true if the anim source node is only driving a single clip. populateImportedAnimSources / pia unicode Internal use only. Populate the Time Editor with clips using the Animation Sources specified (use ; as a delimiter for multiple anim sources). poseClip / poc bool Populate as pose clip with current attribute values. recursively / rec bool Populate selection recursively, adding all the children. removeSceneAnimation / rsa bool If true, remove animation from scene when creating clips or anim sources. Only Time Editor will drive the removed scene animation. removeSource / rs unicode Remove single attribute. showAnimSourceRemapping / sar bool Show a remapping dialog when the imported anim source attributes do not match the scene attributes. takeList / tl unicode Internal use only. To be used along with populateImportedAnimSourcesto specify the imported take names. takesToImport / toi unicode Internal use only. To be used along with populateImportedAnimSourcesto specify the imported take indices. targetIndex / ti unicode Get target index. targets / trg bool Get a list of all targets in this anim source. type / typ unicode Only populate the specified type of animation source. Flag can have multiple arguments, passed either as a tuple or a list. Derived from mel command maya.cmds.timeEditorAnimSource
Example:
- ::
import pymel.core as pm
import maya.cmds as cmds def setKey(time, value):
pm.currentTime(time) pm.setAttr(‘cube.tx’, value) pm.setKeyframe(‘cube.tx’)pm.file(f=True, new=True) pm.polyCube(name=’cube’) setKey( 1, 0) setKey( 5, -5) setKey(10, 5)
# Add cube.translateX with its animation to the anim source and calculate and save timing afterwards pm.timeEditorAnimSource(“AnimSourceNode”, edit=1, addSource=”cube.translateX”, calculateTiming=1)
# Add cube.translateX with a copy of its animation to the anim source pm.timeEditorAnimSource(“AnimSourceNode”, edit=1, addSource=”cube.translateX”, copyAnimation=1)
# Remove cube.translateX from the anim source pm.timeEditorAnimSource(“AnimSourceNode”, edit=1, removeSource=”cube.translateX”)