Go to: Synopsis. Return value. Flags. Python examples.
play([forward=boolean], [playSound=boolean], [record=boolean], [sound=string], [state=boolean], [wait=boolean])
Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.
play is undoable, queryable, and NOT editable.
This command starts and stops playback.
In order to change the frame range of playback,
see the playbackOptions command.
None
In query mode, return type is based on queried flag.
forward, playSound, record, sound, state, wait
Long name (short name) |
Argument types |
Properties |
forward(f)
|
boolean
|
|
|
When true, play back the animation from the
currentTime to the maximum of the playback range.
When false, play back from the currentTime to the
minimum of the playback range. When queried,
returns an int.
|
|
state(st)
|
boolean
|
|
|
start or stop playing back
|
|
record(rec)
|
boolean
|
|
|
enable the recording system and start one playback loop
|
|
wait(w)
|
boolean
|
|
|
Wait till completion before returning control to
command Window.
|
|
sound(s)
|
string
|
|
|
Specify the sound node to be used during playback
|
|
playSound(ps)
|
boolean
|
|
|
Specify whether or not sound should be used during playback
|
|
Flag can appear in Create mode of command
|
Flag can appear in Edit mode of command
|
Flag can appear in Query mode of command
|
Flag can have multiple arguments, passed either as a tuple or a list.
|
import maya.cmds as cmds
# Begin playback from min to max
#
cmds.play( forward=True )
# Begin playback from max to min
#
cmds.play( forward=False )
# Stop (forward or backward) playback
#
cmds.play( state=False )
# Record mode through one playback loop
#
cmds.play( record=True )
# Are we playing back? Returns 1 if yes, 0 if no.
#
cmds.play( q=True, state=True )