Go to: Synopsis. Flags. Return value. Python examples.
progressWindow([endProgress=boolean], [isCancelled=boolean], [isInterruptable=boolean], [maxValue=int], [minValue=int], [progress=int], [status=string], [step=int], [title=string])
Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.
progressWindow is undoable, queryable, and editable.
The progressWindow command creates a window
containing a status message, a graphical progress gauge,
and optionally a "Hit ESC to Cancel" label for interruptable operations.
Only one progress window is allowed on screen at a time. While the window
is visible, the busy cursor is shown.
endProgress, isCancelled, isInterruptable, maxValue, minValue, progress, status, step, title
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.
|
During create, returns true if the window was successfully
created, and false if the window could not be created (possibly
because one is already showing).
Query returns the appropriate flag value.
import maya.cmds as cmds
# +-+------------------+
# |-| Doing Nothing |
# +--------------------+
# | Sleeping: 40% |
# | |
# | +----------------+ |
# | ||||||| | |
# | +----------------+ |
# | |
# | Hit ESC to Cancel |
# +--------------------+
# Always use the progress dialog from a script, never directly
# from the Script Editor.
amount = 0
cmds.progressWindow( title='Doing Nothing',
progress=amount,
status='Sleeping: 0%',
isInterruptable=True )
while True :
# Check if the dialog has been cancelled
if cmds.progressWindow( query=True, isCancelled=True ) :
break
# Check if end condition has been reached
if cmds.progressWindow( query=True, progress=True ) >= 100 :
break
amount += 5
cmds.progressWindow( edit=True, progress=amount, status=('Sleeping: ' + `amount` + '%' ) )
cmds.pause( seconds=1 )
cmds.progressWindow(endProgress=1)
Return to Autodesk Index