/python/pymel/core/animation.py

https://bitbucket.org/jspatrick/emacs · Python · 7855 lines · 6779 code · 727 blank · 349 comment · 851 complexity · dda5befde114d007a2b321196b33fce8 MD5 · raw file

Large files are truncated click here to view the full file

  1. import pymel.internal.factories as _factories
  2. import general as _general
  3. import pymel.util as _util
  4. import pymel.internal.pmcmds as cmds
  5. import pymel.versions as versions
  6. from pymel.internal.pmcmds import *
  7. def aimConstraint(*args, **kwargs):
  8. """
  9. Constrain an object's orientation to point at a target object or at the average position of a number of targets. An
  10. aimConstraint takes as input one or more targetDAG transform nodes at which to aim the single constraint objectDAG
  11. transform node. The aimConstraint orients the constrained object such that the aimVector (in the object's local
  12. coordinate system) points to the in weighted average of the world space position target objects. The upVector (again
  13. the the object's local coordinate system) is aligned in world space with the worldUpVector.
  14. Maya Bug Fix:
  15. - when queried, angle offsets would be returned in radians, not current angle unit
  16. Modifications:
  17. - added new syntax for querying the weight of a target object, by passing the constraint first::
  18. aimConstraint( 'pCube1_aimConstraint1', q=1, weight ='pSphere1' )
  19. aimConstraint( 'pCube1_aimConstraint1', q=1, weight =['pSphere1', 'pCylinder1'] )
  20. aimConstraint( 'pCube1_aimConstraint1', q=1, weight =[] )
  21. Flags:
  22. - aimVector : aim (float, float, float) [create,query,edit]
  23. Set the aim vector. This is the vector in local coordinates that points at the target. If not given at creation time,
  24. the default value of (1.0, 0.0, 0.0) is used.
  25. - layer : l (unicode) [create,edit]
  26. Specify the name of the animation layer where the constraint should be added.
  27. - maintainOffset : mo (bool) [create]
  28. The offset necessary to preserve the constrained object's initial rotation will be calculated and used as the offset.
  29. - name : n (unicode) [create,query,edit]
  30. Sets the name of the constraint node to the specified name. Default name is constrainedObjectName_constraintType
  31. - offset : o (float, float, float) [create,query,edit]
  32. Sets or queries the value of the offset. Default is 0,0,0.
  33. - remove : rm (bool) [edit]
  34. removes the listed target(s) from the constraint.
  35. - skip : sk (unicode) [create,edit]
  36. Specify the axis to be skipped. Valid values are x, y, zand none. During creation, noneis the default.
  37. Flag can have multiple arguments, passed either as a tuple or a list.
  38. - targetList : tl (bool) [query]
  39. Return the list of target objects.
  40. - upVector : u (float, float, float) [create,query,edit]
  41. Set local up vector. This is the vector in local coordinates that aligns with the world up vector. If not given at
  42. creation time, the default value of (0.0, 1.0, 0.0) is used.
  43. - weight : w (float) [create,query,edit]
  44. Sets the weight value for the specified target(s). If not given at creation time, the default value of 1.0 is used.
  45. - weightAliasList : wal (bool) [query]
  46. Returns the names of the attributes that control the weight of the target objects. Aliases are returned in the same
  47. order as the targets are returned by the targetList flag
  48. - worldUpObject : wuo (PyNode) [create,query,edit]
  49. Set the DAG object use for worldUpType objectand objectrotation. See worldUpType for greater detail. The default value
  50. is no up object, which is interpreted as world space.
  51. - worldUpType : wut (unicode) [create,query,edit]
  52. Set the type of the world up vector computation. The worldUpType can have one of 5 values: scene, object,
  53. objectrotation, vector, or none. If the value is scene, the upVector is aligned with the up axis of the scene and
  54. worldUpVector and worldUpObject are ignored. If the value is object, the upVector is aimed as closely as possible to the
  55. origin of the space of the worldUpObject and the worldUpVector is ignored. If the value is objectrotationthen the
  56. worldUpVector is interpreted as being in the coordinate space of the worldUpObject, transformed into world space and the
  57. upVector is aligned as closely as possible to the result. If the value is vector, the upVector is aligned with
  58. worldUpVector as closely as possible and worldUpMatrix is ignored. Finally, if the value is noneno twist calculation is
  59. performed by the constraint, with the resulting upVectororientation based previous orientation of the constrained
  60. object, and the great circlerotation needed to align the aim vector with its constraint. The default worldUpType is
  61. vector.
  62. - worldUpVector : wu (float, float, float) [create,query,edit]
  63. Set world up vector. This is the vector in world coordinates that up vector should align with. See -wut/worldUpType
  64. (below)for greater detail. If not given at creation time, the default value of (0.0, 1.0, 0.0) is used.
  65. Derived from mel command `maya.cmds.aimConstraint`
  66. """
  67. pass
  68. def animCurveEditor(*args, **kwargs):
  69. """
  70. Edit a characteristic of a graph editor
  71. Flags:
  72. - autoFit : af (unicode) [query,edit]
  73. on | off | tgl auto fit-to-view
  74. - classicMode : cm (bool) []
  75. - clipTime : ct (unicode) [query,edit]
  76. Valid values: onoffDisplay the clips with their offset and scale applied to the anim curves in the clip.
  77. - constrainDrag : cd (int) [create,query,edit]
  78. Constrains all Graph Editor animation curve drag operations to either the X-axis, the Y-axis, or to neither of those
  79. axes. Values to supply are: 0 for not constraining any axis, 1 for constraing the X-axis, or 2 for constraining the
  80. Y-axis. When used in queries, this flag returns the latter values and these values have the same interpretation as
  81. above. Note: when the shift key is pressed before dragging the animation curve, the first mouse movement will instead
  82. determine (and override) any prior set constrained axis. Flag can have multiple arguments, passed
  83. either as a tuple or a list.
  84. - control : ctl (bool) [query]
  85. Query only. Returns the top level control for this editor. Usually used for getting a parent to attach popup menus.
  86. Caution: It is possible, at times, for an editor to exist without a control. This flag returns NONEif no control is
  87. present.
  88. - curvesShown : cs (bool) [query]
  89. Returns a string array containing the names of the animCurve nodes currently displayed in the graph editor.
  90. - curvesShownForceUpdate : csf (bool) []
  91. - defineTemplate : dt (unicode) [create]
  92. Puts a command in a mode where any other flags and args are parsed and added to the command template specified in the
  93. argument. They will be used as default arguments in any subsequent invocations of the command when templateName is set
  94. as the current template.
  95. - denormalizeCurvesCommand : dcc (unicode) [create,edit]
  96. Sets the script which is run to denormalize curves in the graph editor. This is intended for internal use only.
  97. - displayActiveKeyTangents : dat (unicode) [edit]
  98. on | off | tgl display tangents in the editor
  99. - displayActiveKeys : dak (unicode) [edit]
  100. on | off | tgl display tangents in the editor
  101. - displayInfinities : di (unicode) [edit]
  102. on | off | tgl display infinities in the editor
  103. - displayKeys : dk (unicode) [edit]
  104. on | off | tgl display keyframes in the editor
  105. - displayNormalized : dn (bool) [query,edit]
  106. When on, display all curves normalized to the range -1 to +1.
  107. - displayTangents : dtn (unicode) [edit]
  108. on | off | tgl display tangents in the editor
  109. - docTag : dtg (unicode) [create,query,edit]
  110. Attaches a tag to the Maya editor.
  111. - exists : ex (bool) [create]
  112. Returns true|false depending upon whether the specified object exists. Other flags are ignored.
  113. - filter : f (unicode) [create,query,edit]
  114. Specifies the name of an itemFilter object to be placed on this editor. This filters the information coming onto the
  115. main list of the editor.
  116. - forceMainConnection : fmc (unicode) [create,query,edit]
  117. Specifies the name of a selectionConnection object which the editor will use as its source of content. The editor will
  118. only display items contained in the selectionConnection object. This is a variant of the -mainListConnection flag in
  119. that it will force a change even when the connection is locked. This flag is used to reduce the overhead when using the
  120. -unlockMainConnection , -mainListConnection, -lockMainConnection flags in immediate succession.
  121. - highlightConnection : hlc (unicode) [create,query,edit]
  122. Specifies the name of a selectionConnection object which the editor will synchronize with its highlight list. Not all
  123. editors have a highlight list. For those that do, it is a secondary selection list.
  124. - lockMainConnection : lck (bool) [create,edit]
  125. Locks the current list of objects within the mainConnection, so that only those objects are displayed within the editor.
  126. Further changes to the original mainConnection are ignored.
  127. - lookAt : la (unicode) [edit]
  128. all | selected | currentTime fitView helpers
  129. - mainListConnection : mlc (unicode) [create,query,edit]
  130. Specifies the name of a selectionConnection object which the editor will use as its source of content. The editor will
  131. only display items contained in the selectionConnection object.
  132. - menu : m (script) [create]
  133. Specify a script to be run when the editor is created. The function will be passed one string argument which is the new
  134. editor's name.
  135. - normalizeCurvesCommand : ncc (unicode) [create,edit]
  136. Sets the script which is run to normalize curves in the graph editor. This is intended for internal use only.
  137. - panel : pnl (unicode) [create,query]
  138. Specifies the panel that the editor belongs to. By default if an editor is created in the create callback of a scripted
  139. panel it will belong to that panel. If an editor doesn't belong to a panel it will be deleted when the window that it
  140. is in is deleted.
  141. - parent : p (unicode) [create,query,edit]
  142. Specifies the parent layout for this editor. This flag will only have an effect if the editor is currently un-parented.
  143. - preSelectionHighlight : psh (bool) [query,edit]
  144. When on, the curve/key/tangent under the mouse pointer is highlighted to ease selection.
  145. - renormalizeCurves : rnc (bool) [edit]
  146. This flag causes the curve normalization factors to be recalculated.
  147. - resultSamples : rs (time) [query,edit]
  148. Specify the sampling for result curves Note: the smaller this number is, the longer it will take to update the display.
  149. - resultScreenSamples : rss (int) [query,edit]
  150. Specify the screen base result sampling for result curves. If 0, then results are sampled in time.
  151. - resultUpdate : ru (unicode) [query,edit]
  152. Valid values: interactivedelayedControls how changes to animCurves are reflected in the result curves (if results are
  153. being shown). If resultUpdate is interactive, then as interactive changes are being made to the animCurve, the result
  154. curves will be updated. If modelUpdate is delayed (which is the default setting), then result curves are updated once
  155. the final change to an animCurve has been made.
  156. - selectionConnection : slc (unicode) [create,query,edit]
  157. Specifies the name of a selectionConnection object which the editor will synchronize with its own selection list. As
  158. the user selects things in this editor, they will be selected in the selectionConnection object. If the object undergoes
  159. changes, the editor updates to show the change.
  160. - showBufferCurves : sb (unicode) [query,edit]
  161. Valid values: onofftglDisplay buffer curves.
  162. - showResults : sr (unicode) [query,edit]
  163. Valid values: onofftglDisplay result curves from expression or other non-keyed action.
  164. - showUpstreamCurves : suc (bool) [query,edit]
  165. If true, the dependency graph is searched upstream for all curves that drive the selected plugs (showing multiple curves
  166. for example in a typical driven key setup, where first the driven key curve is encountered, followed by the actual
  167. animation curve that drives the source object). If false, only the first curves encountered will be shown. Note that,
  168. even if false, multiple curves can be shown if e.g. a blendWeighted node is being used to combine multiple curves.
  169. - smoothness : s (unicode) [query,edit]
  170. Valid values: coarseroughmediumfineSpecify the display smoothness of animation curves.
  171. - snapTime : st (unicode) [query,edit]
  172. none | integer | keyframe keyframe move snap in time
  173. - snapValue : sv (unicode) [query,edit]
  174. none | integer | keyframe keyframe move snap in values
  175. - stackedCurves : sc (bool) [query,edit]
  176. Switches the display mode between normal (all curves sharing one set of axes) to stacked (each curve on its own value
  177. axis, stacked vertically).
  178. - stackedCurvesMax : scx (float) [query,edit]
  179. Sets the maximum value on the per-curve value axis when in stacked mode.
  180. - stackedCurvesMin : scm (float) [query,edit]
  181. Sets the minimum value on the per-curve value axis when in stacked mode.
  182. - stackedCurvesSpace : scs (float) [query,edit]
  183. Sets the spacing between curves when in stacked mode.
  184. - stateString : sts (bool) [query]
  185. Query only flag. Returns the MEL command that will edit an editor to match the current editor state. The returned
  186. command string uses the string variable $editorName in place of a specific name.
  187. - unParent : up (bool) [create,edit]
  188. Specifies that the editor should be removed from its layout. This cannot be used with query.
  189. - unlockMainConnection : ulk (bool) [create,edit]
  190. Unlocks the mainConnection, effectively restoring the original mainConnection (if it is still available), and dynamic
  191. updates.
  192. - updateMainConnection : upd (bool) [create,edit]
  193. Causes a locked mainConnection to be updated from the orginal mainConnection, but preserves the lock state.
  194. - useTemplate : ut (unicode) [create]
  195. Force the command to use a command template other than the current one.
  196. Derived from mel command `maya.cmds.animCurveEditor`
  197. """
  198. pass
  199. def animDisplay(*args, **kwargs):
  200. """
  201. This command changes certain display options used by animation windows. In query mode, return type is based on queried
  202. flag.
  203. Flags:
  204. - modelUpdate : upd (unicode) [create,query,edit]
  205. Controls how changes to animCurves are propagated through the dependency graph. Valid modes are none, interactiveor
  206. delayed. If modelUpdate is nonethen changing an animCurve will not cause the model to be updated (change currentTime in
  207. order to update the model). If modelUpdate is interactive(which is the default setting), then as interactive changes
  208. are being made to the animCurve, the model will be updated. If modelUpdate is delayed, then the model is updated once
  209. the final change to an animCurve has been made. With modelUpdate set to either interactiveor delayed, changes to
  210. animCurves made via commands will also cause the model to be updated. Flag can have multiple
  211. arguments, passed either as a tuple or a list.
  212. - timeCode : tc (bool) [create,query,edit]
  213. Controls whether the animation windows (time slider, graph editor and dope sheet) use time codes in their displays.
  214. - timeCodeOffset : tco (unicode) [create,query,edit]
  215. This flag has now been deprecated. It still exists to not break legacy scripts, but it will now do nothing. See the
  216. new timeCode command to set and query timeCodes.
  217. Derived from mel command `maya.cmds.animDisplay`
  218. """
  219. pass
  220. def animLayer(*args, **kwargs):
  221. """
  222. This command creates and edits animation layers.
  223. Modifications:
  224. - returns a PyNode object for flags: (query and (root or bestLayer or parent))
  225. - returns a list of PyNode objects for flags: (query and (children or attribute or bestAnimLayer or animCurves or baseAnimCurves or blendNodes or affectedLayers or parent))
  226. Flags:
  227. - addSelectedObjects : aso (bool) [create,query,edit]
  228. Adds selected object(s) to the layer.
  229. - affectedLayers : afl (bool) [query]
  230. Return the layers that the currently selected object(s) are members of
  231. - animCurves : anc (bool) [create,query,edit]
  232. In query mode returns the anim curves associated with this layer
  233. - attribute : at (unicode) [create,query,edit]
  234. Adds a specific attribute on a object to the layer.
  235. - baseAnimCurves : bac (bool) [create,query,edit]
  236. In query mode returns the base layer anim curves associated with this layer, if any.
  237. - bestAnimLayer : blr (bool) [create,query,edit]
  238. In query mode returns the best anim layers for keying for the selected objects. If used in conjunction with -at, will
  239. return the best anim layers for keying for the specific plugs (attributes) specified.
  240. - bestLayer : bl (bool) [query]
  241. Return the layer that will be keyed for specified attribute.
  242. - blendNodes : bld (bool) [create,query,edit]
  243. In query mode returns the blend nodes associated with this layer
  244. - children : c (unicode) [query]
  245. Get the list of children layers. return value is a string array.
  246. - collapse : col (bool) [create,query,edit]
  247. Determine if a layer is collapse in the layer editor.
  248. - copy : cp (unicode) [edit]
  249. Copy from layer.
  250. - copyAnimation : ca (unicode) [create,edit]
  251. copy animation from specified layer to destination layer, only animation that are on attribute layered by both layer
  252. that are concerned.
  253. - copyNoAnimation : cna (unicode) [edit]
  254. Copy from layer without the animation curves.
  255. - excludeBoolean : ebl (bool) [create,query,edit]
  256. When adding selected object(s) to the layer, excludes any boolean attributes.
  257. - excludeDynamic : edn (bool) [create,query,edit]
  258. When adding selected object(s) to the layer, excludes any dynamic attributes.
  259. - excludeEnum : een (bool) [create,query,edit]
  260. When adding selected object(s) to the layer, excludes any enum attributes.
  261. - excludeRotate : ert (bool) [create,query,edit]
  262. When adding selected object(s) to the layer, exclude the rotate attribute.
  263. - excludeScale : esc (bool) [create,query,edit]
  264. When adding selected object(s) to the layer, exclude the scale attribute.
  265. - excludeTranslate : etr (bool) [create,query,edit]
  266. When adding selected object(s) to the layer, excludes the translate attribute.
  267. - excludeVisibility : evs (bool) [create,query,edit]
  268. When adding selected object(s) to the layer, exclude the visibility attribute.
  269. - exists : ex (bool) [query]
  270. Determine if an layer exists.
  271. - extractAnimation : ea (unicode) [create,edit]
  272. transfer animation from specified layer to destination layer, only animation that are on attribute layered by both layer
  273. that are concerned.
  274. - findCurveForPlug : fcv (unicode) [edit]
  275. - forceUIRebuild : fur (bool) [create]
  276. rebuilds the animation layers user interface. Flag can have multiple arguments,
  277. passed either as a tuple or a list.
  278. - forceUIRefresh : uir (bool) [create]
  279. refreshes the animation layers user interface.
  280. - layeredPlug : lp (unicode) [query]
  281. returns the plug on the blend node corresponding to the specified layer
  282. - lock : l (bool) [create,query,edit]
  283. Set the lock state of the specified layer. A locked layer can not receive key. Default is false.
  284. - moveLayerAfter : mva (unicode) [edit]
  285. Move layer after the specified layer
  286. - moveLayerBefore : mvb (unicode) [edit]
  287. Move layer before the specified layer
  288. - mute : m (bool) [create,query,edit]
  289. Set the mute state of the specified layer. Default is false.
  290. - override : o (bool) [create,query,edit]
  291. Set the overide state of the specified layer. Default is false.
  292. - parent : p (unicode) [create,query,edit]
  293. Set the parent of the specified layer. Default is the animation layer root.
  294. - passthrough : pth (bool) [create,query,edit]
  295. Set the passthrough state of the specified layer. Default is true.
  296. - preferred : prf (bool) [create,query,edit]
  297. Determine if a layer is a preferred layer, the best layer algorithm will try to set keyframe in preferred layer first.
  298. - removeAllAttributes : raa (bool) [edit]
  299. Remove all objects from layer.
  300. - removeAttribute : ra (unicode) [edit]
  301. Remove object from layer.
  302. - root : r (unicode) [query]
  303. Return the base layer if it exist
  304. - selected : sel (bool) [create,query,edit]
  305. Determine if a layer is selected, a selected layer will be show in the timecontrol, graph editor.
  306. - solo : s (bool) [create,query,edit]
  307. Set the solo state of the specified layer. Default is false.
  308. - weight : w (float) [create,query,edit]
  309. Set the weight of the specified layer between 0.0 and 1.0. Default is 1.
  310. - writeBlendnodeDestinations : wbd (bool) [edit]
  311. In edit mode writes the destination plugs of the blend nodes that belong to the layer into the blend node. This is used
  312. for layer import/export purposes and is not for general use.
  313. Derived from mel command `maya.cmds.animLayer`
  314. """
  315. pass
  316. def animView(*args, **kwargs):
  317. """
  318. This command allows you to specify the current view range within an animation editor. In query mode, return type is
  319. based on queried flag.
  320. Flags:
  321. - endTime : et (time) []
  322. End time to display within the editor
  323. - maxValue : max (float) []
  324. Upper value to display within the editor
  325. - minValue : min (float) []
  326. Lower value to display within the editor
  327. - nextView : nv (bool) [edit]
  328. Switches to the next view. Flag can have multiple arguments, passed either as a tuple or a list.
  329. - previousView : pv (bool) [edit]
  330. Switches to the previous view.
  331. - startTime : st (time) []
  332. Start time to display within the editor
  333. Derived from mel command `maya.cmds.animView`
  334. """
  335. pass
  336. def applyTake(*args, **kwargs):
  337. """
  338. This command takes data in a device (refered to as a take) and converts it into a form that may be played back and
  339. reviewed. The take can either be imported through the readTake action, or recorded by the recordDevice action. The take
  340. is either converted into animation curves or if the -preview flag is used, into blendDevice nodes. The command looks for
  341. animation curves attached to the target attributes of a device attachment. If animation curves exist, the take is pasted
  342. over the existing curves. If the curves do not exist, new animation curves are created. If devices are not specified,
  343. all of the devices with take data and that are enabled for applyTake, will have their data applied. See also:
  344. recordDevice, enableDevice, readTake, writeTake
  345. Flags:
  346. - channel : c (unicode) [create]
  347. This flag overrides the set channel enable value. If a channel is specified, it will be enabled. C: The default is all
  348. applyTake enabled channels for the device(s).
  349. - device : d (unicode) [create]
  350. Specifies which device contains the take. C: The default is all applyTake enabled devices.
  351. - filter : f (unicode) [create]
  352. This flag specifies the filters to use during the applyTake. If this flag is used multiple times, the ordering of the
  353. filters is from left to right. C: The default is no filters.
  354. - preview : p (bool) [create]
  355. Applies the take to blendDevice nodes attached to the target attributes connected to the device attachments. Animation
  356. curves attached to the attributes will not be altered, but for the time that preview data is defined, the preview data
  357. will be the data used during playback. C: The default is to not preview.
  358. - recurseChannel : rc (bool) [create]
  359. When this flag is used, the children of the channel(s) specified by -c/channel are also applied. C: The default is all
  360. of the enabled channels.
  361. - reset : r (bool) [create]
  362. Resets the blendDevice nodes affected by -preview. The preview data is removed and if animation curves exist, they are
  363. used during playback. Flag can have multiple arguments, passed either as a tuple or a list.
  364. - specifyChannel : sc (bool) [create]
  365. This flag is used with -c/channel flag. When used, applyTake will only work on the channels listed with the -c/channel
  366. flag. C: The default is all of the enabled channels.
  367. - startTime : st (time) [create]
  368. The default start time for a take is determined at record time. The startTime option sets the starting time of the take
  369. in the current animation units. C: The default is the first time stamp of the take. If a time stamp does not exist for
  370. the take, 0 is used.
  371. Derived from mel command `maya.cmds.applyTake`
  372. """
  373. pass
  374. def autoKeyframe(*args, **kwargs):
  375. """
  376. With no flags, this command will set keyframes on all attributes that have been modified since an autoKeyframe -state
  377. oncommand was issued. To stop keeping track of modified attributes, use autoKeyframe -state offautoKeyframe does not
  378. create new animation curves. An attribute must have already been keyframed (with the setKeyframe command) for
  379. autoKeyframe to add new keyframes for modified attributes. You can also query the current state of autoKeyframing with
  380. autoKeyframe -query -state.
  381. Flags:
  382. - characterOption : co (unicode) [create,query,edit]
  383. Valid options are: standard, all. Dictates whether when auto-keying characters the auto-key works as usual or whether it
  384. keys all of the character attributes. Default is standard. Flag can have multiple arguments,
  385. passed either as a tuple or a list.
  386. - noReset : nr (bool) []
  387. - state : st (bool) [create,query,edit]
  388. turns on/off remembering of modified attributes
  389. Derived from mel command `maya.cmds.autoKeyframe`
  390. """
  391. pass
  392. def bakeClip(*args, **kwargs):
  393. """
  394. This command is used to bake clips and blends into a single clip.
  395. Flags:
  396. - blend : b (int, int) [create]
  397. Specify the indicies of the clips being blended.
  398. - clipIndex : ci (int) [create]
  399. Specify the index of the clip to bake.
  400. - keepOriginals : k (bool) [create]
  401. Keep original clips in the trax editor and place the merged clip into the visor. The default is to schedule the merged
  402. clip, and to keep the original clips in the visor. Flag can have multiple
  403. arguments, passed either as a tuple or a list.
  404. - name : n (unicode) [create]
  405. Specify the name of the new clip to create.
  406. Derived from mel command `maya.cmds.bakeClip`
  407. """
  408. pass
  409. def bakeResults(*args, **kwargs):
  410. """
  411. This command allows the user to replace a chain of dependency nodes which define the value for an attribute with a
  412. single animation curve. Command allows the user to specify the range and frequency of sampling. This command operates on
  413. a keyset. A keyset is defined as a group of keys within a specified time range on one or more animation curves. The
  414. animation curves comprising a keyset depend on the value of the -animationflag: keysOrObjects: Any active keys, when no
  415. target objects or -attribute flags appear on the command line, orAll animation curves connected to all keyframable
  416. attributes of objects specified as the command line's targetList, when there are no active keys.keys: Only act on active
  417. keys or tangents. If there are no active keys or tangents, don't do anything. objects: Only act on specified objects.
  418. If there are no objects specified, don't do anything. Note that the -animationflag can be used to override the curves
  419. uniquely identified by the multi-use -attributeflag, which takes an argument of the form attributeName, such as
  420. translateX. Keys on animation curves are identified by either their time values or their indices. Times and indices
  421. should be specified as a range, as shown below. -time 10:20means all keys in the range from 10 to 20, inclusive, in the
  422. current time unit.-index 1:5means the 2nd, 3rd, 4th, 5th, and 6th keys of each animation curve.
  423. Flags:
  424. - animation : an (unicode) [create]
  425. Where this command should get the animation to act on. Valid values are objects,keys,and keysOrObjectsDefault:
  426. keysOrObjects.(See Description for details.)
  427. - attribute : at (unicode) [create]
  428. List of attributes to select
  429. - bakeOnOverrideLayer : bol (bool) [create]
  430. If true, all layered and baked attribute will be added as a top override layer. Flag can have multiple
  431. arguments, passed either as a tuple or a list.
  432. - controlPoints : cp (bool) [create]
  433. This flag explicitly specifies whether or not to include the control points of a shape (see -sflag) in the list of
  434. attributes. Default: false. (Not valid for pasteKeycmd.)
  435. - destinationLayer : dl (unicode) []
  436. - disableImplicitControl : dic (bool) [create]
  437. Whether to disable implicit control after the anim curves are obtained as the result of this command. An implicit
  438. control to an attribute is some function that affects the attribute without using an explicit dependency graph
  439. connection. The control of IK, via ik handles, is an example.
  440. - float : f (floatrange) [create]
  441. value uniquely representing a non-time-based key (or key range) on a time-based animCurve. Valid floatRange include
  442. single values (-f 10) or a string with a lower and upper bound, separated by a colon (-f 10:20
  443. - hierarchy : hi (unicode) [create]
  444. Hierarchy expansion options. Valid values are above,below,both,and none.(Not valid for pasteKeycmd.)
  445. - includeUpperBound : iub (bool) [create]
  446. When the -t/time or -f/float flags represent a range of keys, this flag determines whether the keys at the upper bound
  447. of the range are included in the keyset. Default value: true. This flag is only valid when the argument to the -t/time
  448. flag is a time range with a lower and upper bound. (When used with the pasteKeycommand, this flag refers only to the
  449. time range of the target curve that is replaced, when using options such as replace,fitReplace,or scaleReplace.This flag
  450. has no effect on the curve pasted from the clipboard.)
  451. - index : index (int) [create]
  452. index of a key on an animCurve
  453. - minimizeRotation : mr (unicode) []
  454. - preserveOutsideKeys : pok (bool) [create]
  455. Whether to preserve keys that are outside the bake range when there are directly connected animation curves or a
  456. pairBlend node which has an animation curve as its direct input. The default (false) is to remove frames outside the
  457. bake range. If the channel that you are baking is not controlled by a single animation curve, then a new animation
  458. curve will be created with keys only in the bake range. In the case of pairBlend-driven channels, setting pok to true
  459. will retain both the pairBlend and its input animCurve. The blended values will be baked onto the animCurve and the
  460. weight of the pairBlend weight will be keyed to the animCurve during the baked range.
  461. - removeBakedAttributeFromLayer : ral (bool) [create]
  462. If true, all baked attribute will be removed from the layer. Otherwise all layer associated with the baked attribute
  463. will be muted.
  464. - resolveWithoutLayer : rwl (unicode) []
  465. - sampleBy : sb (time) [create]
  466. Amount to sample by. Default is 1.0 in current timeUnit
  467. - shape : s (bool) [create]
  468. Consider attributes of shapes below transforms as well, except controlPoints. Default: true. (Not valid for
  469. pasteKeycmd.)
  470. - simulation : sm (bool) [create]
  471. Using this flag instructs the command to preform a simulation instead of just evaluating each attribute separately over
  472. the range of time. The simulation flag is required to bake animation that that depends on the whole scene being
  473. evaluated at each time step such as dynamics. The default is false.
  474. - smart : sr ([, <type 'bool'>, <type 'float'>, ]) []
  475. - sparseAnimCurveBake : sac (bool) [create]
  476. When this is true and anim curves are being baked, do not insert any keys into areas of the curve where animation is
  477. defined. And, use as few keys as possible to bake the pre and post infinity behavior. When this is false, one key will
  478. be inserted at each time step. The default is false.
  479. - time : t (timerange) [create]
  480. time uniquely representing a key (or key range) on a time-based animCurve. Valid timeRanges include single values (-t
  481. 10) or a string with a lower and upper bound, separated by a colon (-t 10:20
  482. Derived from mel command `maya.cmds.bakeResults`
  483. """
  484. pass
  485. def bakeSimulation(*args, **kwargs):
  486. """
  487. This command operates on a keyset. A keyset is defined as a group of keys within a specified time range on one or more
  488. animation curves. The animation curves comprising a keyset depend on the value of the -animationflag: keysOrObjects: Any
  489. active keys, when no target objects or -attribute flags appear on the command line, orAll animation curves connected to
  490. all keyframable attributes of objects specified as the command line's targetList, when there are no active keys.keys:
  491. Only act on active keys or tangents. If there are no active keys or tangents, don't do anything. objects: Only act on
  492. specified objects. If there are no objects specified, don't do anything. Note that the -animationflag can be used to
  493. override the curves uniquely identified by the multi-use -attributeflag, which takes an argument of the form
  494. attributeName, such as translateX. Keys on animation curves are identified by either their time values or their indices.
  495. Times and indices can be given individually or as part of a list or range. -time 10palmeans the key at frame 10 (PAL
  496. format).-time 1.0sec -time 15ntsc -time 20means the keys at time 1.0 second, frame 15 (in NTSC format), and time 20 (in
  497. the currently defined global time unit).-time 10:20means all keys in the range from 10 to 20, inclusive, in the current
  498. time unit.Omitting one end of a range means go to infinity, as in the following examples: -time 10:means all keys from
  499. time 10 (in the current time unit) onwards.-time :10means all keys up to (and including) time 10 (in the current time
  500. unit).-time :is a short form to specify all keys.-index 0means the first key of each animation curve. (Indices are
  501. 0-based.)-index 2 -index 5 -index 7means the 3rd, 6th, and 8th keys.-index 1:5means the 2nd, 3rd, 4th, 5th, and 6th keys
  502. of each animation curve.The bakeSimulation command is obsolete. Instead, bakeResults -simulation trueshould be used.
  503. The bakeSimulation command has retained for backwards compatibility. This command allows the user to replace a chain of
  504. dependency nodes, or implicit relationship, such as those between joints and IK handles, which define the value of an
  505. attribute, with a single animation curve. Command allows the user to specify the range and frequency of sampling. Unlike
  506. the bakeResults command, this command will actually set the time of the current scene to all the times, in sequence,
  507. inside the given time interval before it sets the time back to when it is started. As a result, it may modify the scene.
  508. In query mode, return type is based on queried flag.
  509. Flags:
  510. - animation : an (unicode) [create]
  511. Where this command should get the animation to act on. Valid values are objects,keys,and keysOrObjectsDefault:
  512. keysOrObjects.(See Description for details.)
  513. - attribute : at (unicode) [create]
  514. List of attributes to select
  515. - bakeOnOverrideLayer : bol (bool) []
  516. - controlPoints : cp (bool) [create]
  517. This flag explicitly specifies whether or not to include the control points of a shape (see -sflag) in the list of
  518. attributes. Default: false. (Not valid for pasteKeycmd.)
  519. - destinationLayer : dl (unicode) []
  520. - disableImplicitControl : dic (bool) [create]
  521. Whether to disable implicit control after the anim curves are obtained as the result of this command. An implicit
  522. control to an attribute is some function that affects the attribute without using an explicit dependency graph
  523. connection. The control of IK, via ik handles, is an example.
  524. - float : f (floatrange) [create]
  525. value uniquely representing a non-time-based key (or key range) on a time-based animCurve. Valid floatRange include
  526. single values (-f 10) or a string with a lower and upper bound, separated by a colon (-f 10:20
  527. - hierarchy : hi (unicode) [create]
  528. Hierarchy expansion options. Valid values are above,below,both,and none.(Not valid for pasteKeycmd.)
  529. - includeUpperBound : iub (bool) [create]
  530. When the -t/time or -f/float flags represent a range of keys, this flag determines whether the keys at the upper bound
  531. of the range are included in the keyset. Default value: true. This flag is only valid when the argument to the -t/time
  532. flag is a time range with a lower and upper bound. (When used with the pasteKeycommand, this flag refers only to the
  533. time range of the target curve that is replaced, when using options such as replace,fitReplace,or scaleReplace.This flag
  534. has no effect on the curve pasted from the clipboard.)
  535. - index : index (int) [create]
  536. index of a key on an animCurve
  537. - minimizeRotation : mr (unicode) []
  538. - preserveOutsideKeys : pok (bool) [create]
  539. Whether to preserve keys that are outside the bake range when there are directly connected animation curves. The
  540. default (false) is to remove frames outside the bake range. If the channel that you are baking is not controlled by a
  541. single animation curve, then a new animation curve will be created with keys only in the bake range.
  542. - removeBakedAttributeFromLayer : ral (bool) []
  543. - resolveWithoutLayer : rwl (unicode) []
  544. - sampleBy : sb (time) [create]
  545. Amount to sample by. Default is 1.0 in current timeUnit
  546. - shape : s (bool) [create]
  547. Consider attributes of shapes below transforms as well, except controlPoints. Default: true. (Not valid for
  548. pasteKeycmd.)
  549. - simulation : sm (bool) [create]
  550. Using this flag instructs the command to preform a simulation instead of just evaluating each attribute separately over
  551. the range of time. The simulation flag is required to bake animation that that depends on the whole scene being
  552. evaluated at each time step such as dynamics. The default is true.
  553. - smart : sr ([, <type 'bool'>, <type 'float'>, ]) []
  554. - sparseAnimCurveBake : sac (bool) [create]
  555. When baking anim curves, do not insert any keys into areas of the curve where animation is defined. And, use as few
  556. keys as possible to bake the pre and post infinity behaviors. When this is false, one key will be inserted at each time
  557. step. The default is false. Flag can have multiple arguments, passed either as a tuple or a
  558. list.
  559. - time : t (timerange) [create]
  560. time uniquely representing a key (or key range) on a time-based animCurve. Valid timeRanges include single values (-t
  561. 10) or a string with a lower and upper bound, separated by a colon (-t 10:20
  562. Derived from mel command `maya.cmds.bakeSimulation`
  563. """
  564. pass
  565. def bindSkin(*args, **kwargs):
  566. """
  567. This command binds the currently selected objects to the currently selected skeletons. Shapes which can be bound are:
  568. meshes, nurbs curves, nurbs surfaces, lattices, subdivision surfaces, and API shapes. Multiple shapes and multiple
  569. skeletons can be bound at once by selecting them or specifying them on the command line. Selection order is not
  570. important.The skin is bound using the so-called rigidbind, in which the components are rigidly attached to the closest
  571. bone in the skeleton. Flexors can later be added to the skeleton to smooth out the skinning around joints.The skin(s)
  572. can be bound either to the entire skeleton hierarchy of the selected joint(s), or to only the selected joints. The
  573. entire hierarchy is the default. The -tsb/-toSelectedBones flag allows binding to only the selected bones.This command
  574. can also be used to detach the skin from the skeleton. Detaching the skin is useful in a variety of situations, such as:
  575. inserting additional bones, deleting bones, changing the bind position of the skeleton or skin, or simply getting rid of
  576. the skinning nodes altogether. The options to use when detaching the skin depend on how much of the skinning info you
  577. want to get rid of. Namely: (1) -delete or -unbind: remove all skinning nodes, (2) -unbindKeepHistory: remove the
  578. skinning sets, but keep the weights, (3) -disable: disable the skinning but keep the skinning sets and the weights.
  579. Flags:
  580. - byClosestPoint : bcp (bool) [create]
  581. bind each point in the object to the segment closest to the point. The byClosestPoint and byPartition flags are mutually
  582. exclusive. The byClosestPoint flag is the default.
  583. - byPartition : bp (bool) [create]
  584. bind each group in the partition to the segment closest to the group's centroid. A partition must be specified with the
  585. -p/-partition flag
  586. - colorJoints : cj (bool) [create]
  587. In bind mode, this flag assigns colors to the joints based on the colors assigned to the joint's skin set. In delete and
  588. unlock mode, this flag removes the colors from joints that are no longer bound as skin. In disable and unbindKeepHistory
  589. mode, this flag does nothing.
  590. - delete : d (bool) [create]
  591. Detach the skin on the selected skeletons and remove all bind- related construction history.
  592. - doNotDescend : dnd (bool) [create]
  593. Do not descend to shapes that are parented below the selected object(s). Bind only the selected objects.
  594. - enable : en (bool) [create]
  595. Enable or disable a bind that has been disabled on the selected skeletons. To enable the bind on selected bones only,
  596. select the bones and use the -tsb flag with the -en flag. This flag is used when you want to temporarily disable the
  597. bind without losing the set information or the weight information of the skinning, for example if you want to modify the
  598. bindPose.
  599. - name : n (unicode) [create]
  600. This flag is obsolete. Flag can have multiple arguments, passed either as a tuple or a list.
  601. - partition : p (unicode) [create]
  602. Specify a partition to bind by. This is only valid when used with the -bp/-byPartition flag.
  603. - toAll : ta (bool) [create]
  604. objects will be bound to the entire selected skeletons. Even bones with zero influence will be bound, whereas the
  605. toSkeleton will only bind non-zero influences.
  606. - toSelectedBones : tsb (bool) [create]
  607. objects will be bound to the selected bones only.
  608. - toSkeleton : ts (bool) [create]
  609. objects will be bound to the selected skeletons. The toSkeleton, toAll and toSelectedBones flags are mutually exclusive.
  610. The toSkeleton flag is the default.
  611. - unbind : ub (bool) [create]
  612. unbind the selected objects. They will no longer move with the skeleton. Any bin