pymel.core.animation.evaluationManager

evaluationManager(*args, **kwargs)

Handles turning on and off the evaluation manager method of evaluating the DG. Query the ‘mode’ flag to see all available evaluation modes. The special mode ‘off’ disables the evaluation manager. The scheduling override flags ‘nodeTypeXXX’ force certain node types to use specific scheduling types, even though the node descriptions might indicate otherwise. Use with caution; certain nodes may not react well to alternative scheduling types. Only one scheduling type override will be in force at a time, the most restrictive one. In order, they are untrusted, globally serialized, locally serialized, and parallel. The node types will however remember all overrides. For example, if you set a node type override to be untrusted, then to be parallel it will continue to use the untrusted override. If you then turn off the untrusted override, the scheduling will advance to the parallel one. The actual node scheduling type is always superceded by the overrides. For example, a serial node will still be considered as parallel if the node type has the parallel override set, even though ‘serial’ is a more restrictive scheduling type. See the ‘dbpeek’ command ‘graph’ operation with arguments ‘evaluationGraph’ and ‘scheduling’ to see what scheduling type any particular node will end up using after the hierarchy of overrides and native scheduling types is applied.

Flags:

Long Name / Short Name Argument Types Properties
cycleCluster / ccl unicode ../../../_images/create.gif ../../../_images/query.gif
  Returns a list of nodes that are stored together with the given one in a cycle cluster. The list will be empty when the evaluation mode is not active or the node is not in a cycle.
downstreamFrom / dst unicode ../../../_images/create.gif ../../../_images/query.gif
  Find the DG nodes that are immediately downstream of the named one in the evaluation graph. Note that the connectivity is via evaluation mode connections, not DG connections. In query mode the graph is walked and any nodes downstream of the named one are returned. The return type is alternating pairs of values that represent the graph level and the node name, e.g. if you walk downstream from A in the graph A -B -C then the return will be the array of strings (0,A,1,B,2,C). Scripts can deconstruct this information into something more visually recognizable. Note that cycles are likely to be present so any such scripts would have to handle them.
enabled / e bool ../../../_images/query.gif
  Valid in query mode only. Checks to see if the evaluation manager is currently enabled. This is independent of the current mode.
idleBuild / ib bool ../../../_images/create.gif ../../../_images/query.gif
  This flag sets the rebuild option. If set to true then the evaluation graph will rebuild on an idle event as soon as it is able to do so. If false then it will only rebuild when required, for example at the start of playback. Note: This only applies to the graph attached to the normal context. All other graphs will be built according to their own rules. The disadvantage of building on an idle event is that for some workflows that are changing the graph frequently, or very large graphs, the graph build time may impact the workflow. The default is to have idleBuild turned on. If the build time is impacted, this flag can be turned off.
invalidate / inv bool ../../../_images/create.gif ../../../_images/query.gif
  This flag invalidates the graph. Value is used to control auto rebuilding on idle (false) or forced (true). This command should be used as a last resort. In query mode it checks to see if the graph is valid.
manipulation / man bool ../../../_images/create.gif ../../../_images/query.gif
  This flag is used to activate evaluation manager manipulation support.
mode / m unicode ../../../_images/create.gif ../../../_images/query.gif
  Changes the current evaluation mode in the evaluation manager. Supported values are off, serial, serialUncachedand parallel.
nodeTypeGloballySerialize / ntg bool ../../../_images/create.gif ../../../_images/query.gif
  This flag is used only when the evaluation manager is in parallelmode but can be set at anytime. It activates or deactivates the override to force global serial scheduling for the class name argument(s) in the evaluation manager. Legal object values are class type names: e.g. transform, skinCluster, mesh. When queried without specified nodes, it returns the list of nodes with the global serial scheduling override active. Scheduling overrides take precedence over all of the node and node type scheduling rules. Use with caution; certain nodes may not react well to alternative scheduling types.
nodeTypeParallel / ntp bool ../../../_images/create.gif ../../../_images/query.gif
  This flag is used only when the evaluation manager is in parallelmode but can be set at anytime. It activates or deactivates the override to force parallel scheduling for the class name argument(s) in the evaluation manager. Legal object values are class type names: e.g. transform, skinCluster, mesh. When queried without specified nodes, it returns the list of nodes with the parallel scheduling override active. Scheduling overrides take precedence over all of the node and node type scheduling rules. Use with caution; certain nodes may not react well to alternative scheduling types.
nodeTypeSerialize / nts bool ../../../_images/create.gif ../../../_images/query.gif
  This flag is used only when the evaluation manager is in parallelmode but can be set at anytime. It activates or deactivates the override to force local serial scheduling for the class name argument(s) in the evaluation manager. Legal object values are class type names: e.g. transform, skinCluster, mesh. When queried without specified nodes, it returns the list of nodes with the local serial scheduling override active. Scheduling overrides take precedence over all of the node and node type scheduling rules. Use with caution; certain nodes may not react well to alternative scheduling types.
nodeTypeUntrusted / ntu bool ../../../_images/create.gif ../../../_images/query.gif
  This flag is used only when the evaluation manager is in parallelmode but can be set at anytime. It activates or deactivates the override to force untrusted scheduling for the class name argument(s) in the evaluation manager. Legal object values are class type names: e.g. transform, skinCluster, mesh. When queried without specified nodes, it returns the list of nodes with the untrusted scheduling override active. Scheduling overrides take precedence over all of the node and node type scheduling rules. Use with caution; certain nodes may not react well to alternative scheduling types. Untrusted scheduling will allow nodes to be evaluated in a critical section, separately from any other node evaluation. It should be used only as a last resort since the lost parallelism caused by untrusted nodes can greatly reduce performance.
safeMode / sfm bool ../../../_images/create.gif ../../../_images/query.gif
  This flag activates/deactivates parallel evaluation safe mode. When enabled, parallel execution will fall back to serial when evaluation graph is missing dependencies. Detection is happening on scheduling of parallel evaluation, which means potential fallback will happen at the next evaluation. WARNING: This mode should be disabled with extreme caution. It will prevent parallel mode from falling back to serial mode when an invalid evaluation is detected. Sometimes the evaluation will still work correctly in those situations and use of this flag will keep the peak parallel performance running. However since the safe mode is used to catch invalid evaluation disabling it may also cause problems with evaluation, anything from invalid values, missing evaluation, or even crashes. Flag can have multiple arguments, passed either as a tuple or a list.
upstreamFrom / ust unicode ../../../_images/create.gif ../../../_images/query.gif
  Find the DG nodes that are immediately upstream of the named one in the evaluation graph. Note that the connectivity is via evaluation mode connections, not DG connections. In query mode the graph is walked and any nodes upstream of the named one are returned. The return type is alternating pairs of values that represent the graph level and the node name, e.g. if you walk upstream from C in the graph A -B -C then the return will be the array of strings (0,C,1,B,2,A). Scripts can deconstruct this information into something more visually recognizable. Note that cycles are likely to be present so any such scripts would have to handle them.

Derived from mel command maya.cmds.evaluationManager

Example:

::

import pymel.core as pm

import maya.cmds as cmds

# Enable evaluation manager in serial mode pm.evaluationManager( mode=”serial” ) # Result: True #

# Confirm that the evaluation manager is currently enabled pm.evaluationManager( query=True, enabled=True ) # Result: True #

# Does nothing since it was already in serial mode pm.evaluationManager( mode=”serial” ) # Result: True #

# Return the current evaluation manager mode and graph state pm.evaluationManager( query=True, mode=True ) # Result: [u’serial’] #

# Return all legal evaluation modes pm.evaluationManager( query=True ) # Result: [u’off’, u’serial’, u’serialUncached’, u’parallel’] #

# Disable evaluation manager pm.evaluationManager( mode=”off” ) # Result: True #

# Activate parallel scheduling override on transform nodes pm.evaluationManager( “transform”, nodeTypeParallel=True, on=True ) True

# Query for node types with the parallel scheduling override pm.evaluationManager( query=True, nodeTypeParallel=True ) [“transform”]

# Query the parallel scheduling override of a particular node type pm.evaluationManager( “transform”, query=True, nodeTypeParallel=True ) True

# Activate locally serial scheduling override on transform nodes pm.evaluationManager( “transform”, nodeTypeSerialize=True, on=True ) True

# Query for node types with the locally serial scheduling override pm.evaluationManager( query=True, nodeTypeSerialize=True ) [“transform”]

# Query the locally serial scheduling override of a particular node type pm.evaluationManager( “transform”, query=True, nodeTypeSerialize=True ) True

# Activate globally serial scheduling override on transform nodes pm.evaluationManager( “transform”, nodeTypeGloballySerialize=True, on=True ) True

# Query for node types with the globally serial scheduling override pm.evaluationManager( query=True, nodeTypeGloballySerialize=True ) [“transform”]

# Query the globally serial scheduling override of a particular node type pm.evaluationManager( “transform”, query=True, nodeTypeGloballySerialize=True ) True

# Activate untrusted scheduling override on transform nodes pm.evaluationManager( “transform”, nodeTypeUntrusted=True, on=True ) True

# Query for node types with the untrusted scheduling override pm.evaluationManager( query=True, nodeTypeUntrusted=True ) [“transform”]

# Query the untrusted scheduling override of a particular node type pm.evaluationManager( “transform”, query=True, nodeTypeUntrusted=True ) True

# Force rebuild of evaluation graph for normal context pm.evaluationManager( invalidate=True ) True

# Test if evaluation graph is valid for normal context pm.evaluationManager( query=True, invalidate=True ) False

# Activate safe mode for parallel executor pm.evaluationManager( safeMode=True ) True

# Query safe mode for parallel executor pm.evaluationManager( query=True, safeMode=True ) True

# Enable manipulation with evaluation manager pm.evaluationManager( manipulation=True ) True

# Query manipulation with evaluation manager pm.evaluationManager( query=True, manipulation=True ) True

# Show downstream nodes pm.evaluationManager( downstreamFrom=’myNode’ ) [‘myDownstreamNode’]

# Show all downstream nodes pm.evaluationManager( query=True, downstreamFrom=’myRoot’ ) [‘0’, ‘myRoot’, ‘1’, ‘myNode’, ‘2’, ‘myDownstreamNode’ ]

# Show upstream nodes pm.evaluationManager( upstreamFrom=’myDownstreamNode’ ) [‘myNode’]

# Show cycle cluster pm.evaluationManager( cycleCluster=’myNodeInCycle’ ) [‘myNode’, ‘myNodeInCycle’, ‘myNode’]

# Deactivate idle build pm.evaluationManager( idleBuild=False ) True

# Query idleBuild pm.evaluationManager( query=True, idleBuild=True ) False