pymel.core.general.refresh

refresh(*args, **kwargs)

This command is used to force a redraw during script execution. Normally, redraw is suspended while scripts are executing but sometimes it is useful to show intermediate results for purposes such as capturing images from the screen. If the -cv flag is specified, then only the current active view is redrawn.

Flags:

Long Name / Short Name Argument Types Properties
currentView / cv bool ../../../_images/create.gif
  Redraw only the current view (default redraws all views).
fileExtension / fe unicode ../../../_images/create.gif
  Specify the type of file to save using the filename flag.
filename / fn unicode ../../../_images/create.gif
  Specify the name of a file in which to save a snapshot of the viewports, or just the current one if the currentView flag is set.
force / f bool ../../../_images/create.gif
  Force the refresh regardless of the state of the model.
suspend / su bool ../../../_images/create.gif
  Suspends or resumes Maya’s handling of refresh events. Specify onto suspend refreshing, and offto resume refreshing. Note that resuming refresh does not itself cause a refresh – the next natural refresh event in Maya after refresh -suspend offis issued will cause the refresh to occur. Use this flag with caution: although it provides opportunities to enhance performance, much of Maya’s dependency graph evaluation in interactive mode is refresh driven, thus use of this flag may lead to slight solve differences when you have a complex dependency graph with interrelations. Flag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.refresh

Example:

import pymel.core as pm

pm.refresh()