Go to: Synopsis. Return value. Flags. Python examples.

Synopsis

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.

Return value

None

In query mode, return type is based on queried flag.

Flags

forward, playSound, record, sound, state, wait
Long name (short name) Argument types Properties
forward(f) boolean createquery
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.
playSound(ps) boolean createquery
Specify whether or not sound should be used during playback
record(rec) boolean createquery
enable the recording system and start one playback loop
sound(s) string createquery
Specify the sound node to be used during playback
state(st) boolean createquery
start or stop playing back
wait(w) boolean create
Wait till completion before returning control to command Window.

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.

Python examples

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 )