pymel.core.windows.progressWindow

static windows.progressWindow(*args, **kwargs)

The progressWindow command creates a window containing a status message, a graphical progress gauge, and optionally a Hit ESC to Cancellabel for interruptable operations. Only one progress window is allowed on screen at a time. While the window is visible, the busy cursor is shown.

Flags:
Long name (short name) Argument Types Properties
endProgress (ep) bool ../../../_images/create.gif
 

Terminates the progress window. No other flags can be used at the same time. This is normally issued through MEL in response to the -ic/isCancelled flag being set or if the progress value reaches its maximum. Flag can have multiple arguments, passed either as a tuple or a list.

isCancelled (ic) bool ../../../_images/query.gif
 
Returns true if the user has tried to cancel the operation. Returns false otherwise.
isInterruptable (ii) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Returns true if the progress window should respond to attempts to cancel the operation. The cancel button is disabled if this is set to true.
maxValue (max) int ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

The maximum or endingvalue of the progress indicator. If the progress value is greater than the -max/maxValue, the progress value will be set to the maximum. Default value is 100.

minValue (min) int ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

The minimum or startingvalue of the progress indicator. If the progress value is less than the -min/minValue, the progress value will be set to the minimum. Default value is 0.

progress (pr) int ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
The amount of progress currently shown on the control. The value will always be between min and max. Default is equal to the minimum when the control is created.
status (st) unicode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
The status text appearing above the progress gauge.
step (s) int ../../../_images/edit.gif
 
Increments the -pr/progress value by the amount specified.
title (t) unicode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
The window title.

Derived from mel command maya.cmds.progressWindow

Example:

import pymel.core as pm

# +-+------------------+
# |-|  Doing Nothing   |
# +--------------------+
# | Sleeping: 40%      |
# |                    |
# | +----------------+ |
# | |||||||          | |
# | +----------------+ |
# |                    |
# | Hit ESC to Cancel  |
# +--------------------+

# Always use the progress dialog from a script, never directly
# from the Script Editor.

amount = 0

pm.progressWindow(  title='Doing Nothing',
                                    progress=amount,
                                    status='Sleeping: 0%',
                                    isInterruptable=True )
while True :
    # Check if the dialog has been cancelled
    if pm.progressWindow( query=True, isCancelled=True ) :
            break

    # Check if end condition has been reached
    if pm.progressWindow( query=True, progress=True ) "= 100 :
            break

    amount += 5

    pm.progressWindow( edit=True, progress=amount, status=('Sleeping: ' + `amount` + '%' ) )

    pm.pause( seconds=1 )

pm.progressWindow(endProgress=1)

Previous topic

pymel.core.windows.progressBar

Next topic

pymel.core.windows.promptBox

Core

Core Modules

Other Modules

This Page