pymel.core.animation.timeWarp¶
- timeWarp(*args, **kwargs)¶
This command is used to create a time warp input to a set of animation curves.
Flags:
Long Name / Short Name Argument Types Properties deleteFrame / df int The flag value indicates the 0-based index of the warp frame to delete. This flag can only be used in edit mode. frame / f float In create and edit mode, this flag can be used to specify warp frames added to the warp operation. In query mode, this flag returns a list of the frame values where warping occurs. The moveFrame flag command can be used to query the associated warped values. g / g bool In create mode, creates a global time warp node which impacts every animated object in the scene. In query mode, returns the global time warp node. Note: only one global time warp can exist in the scene. interpType / it int, unicode This flag can be used to set the interpolation type for a given span. Valid interpolation types are linear, easeIn and easeOut. When queried, it returns a string array of the interpolation types for the specified time warp. moveFrame / mf int, float This flag can be used to move a singular warp frame. The first value specified indicates the 0-based index of the warp frame to move. The second value indicates the new warp frame value. This flag can only be used in edit and query mode. When queried, it returns an array of the warped frame values. Flag can have multiple arguments, passed either as a tuple or a list. Derived from mel command maya.cmds.timeWarp
Example:
import pymel.core as pm # Create a time warp on the animation curves driving a cylinder and a sphere, # and specify the warping is to occur at frames 1 and 20. # Note: Time warps are only applied to animated objects. # warp = pm.timeWarp( 'pCylinder1', 'pSphere1',f=[1,20]) # Move the first warp to frame 5 # pm.timeWarp(warp,e=1,mf=(0,5)) # Move the 2nd warp to frame 10 # pm.timeWarp(warp,e=1,mf=(1,10)) # Modify the interpolation between the 1st and 2nd warp to easeIn # pm.timeWarp(warp,e=1,it=(0,'easeIn')) # query the original frames # pm.timeWarp(warp,q=1,f=1) [1.0, 20.0, 30.0] # query the modified frames # pm.timeWarp(warp,q=1,mf=1) [5.0, 10.0, 30.0] # query the interpolation # pm.timeWarp(warp,q=1,it=1) [u'easeIn', u'linear']