Go to: Synopsis. Return value. Keywords.
Flags. Python
examples.
clearCache([allNodes=boolean], [computed=boolean], [dirty=boolean])
Note: Strings representing object names and
arguments must be separated by commas. This is not depicted in the
synopsis.
clearCache is NOT undoable, NOT queryable, and
NOT editable.
Even though dependency graph values are computed or dirty they may
still occupy space temporarily within the nodes. This command goes
in to all of the data that can be regenerated if required and
removes it from the caches (datablocks), thus clearing up space in
memory.
int |
Number of items removed from caches |
dependency, graph, cache, optimize, performance, memory
allNodes, computed, dirty
Long name (short name) |
Argument types |
Properties |
allNodes(all) |
boolean |
 |
|
If toggled then all nodes in the graph are cleared. Otherwise
only those nodes that are selected are cleared. |
|
computed(c) |
boolean |
 |
|
If toggled then remove all data that is computable. (Warning:
If the data is requested for redraw then the recompute will
immediately fill the data back in.) |
|
dirty(d) |
boolean |
 |
|
If toggled then remove all heavy data that is dirty. |
|
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
# Clear one node's datablock cache
cmds.clearCache( 'node' )
# Clear caches in all dependency graph nodes
cmds.clearCache( all=True )