Go to: Synopsis. Return value. Keywords. Flags. Python examples.
evaluator([clusters=boolean], [configuration=string], [enable=boolean], [info=boolean], [name=string], [nodeType=string], [nodeTypeChildren=boolean], [priority=int], [valueName=string])
Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.
evaluator is NOT undoable, queryable, and NOT editable.
Handles turning on and off custom evaluation overrides used by the evaluation
manager.
Query no flag to see all available custom evaluators.
Query the 'enable' flag to check if an evaluator is currently enabled.
If the 'name' flag isn't used then return all modes and their current
active state.
string[] | the list of available evaluators (querying with no evaluator flag or invalid evaluator name) |
boolean | the previous active state of the named evaluator (with 'name' and 'enable' flags) |
boolean | the active state of the named evaluator (query with 'name' and 'enable' flags) |
string[] | the list of evaluators in the requested active state (query 'enable' flag alone) |
string[] | the list of nodes for which the evaluator was activated or deactivated (with 'nodeType' or 'nodeTypeChildren' flags) |
string | the queried value for the evaluator (with 'name' and 'valueName' flags) |
boolean | true if the configuration request was accepted by the evaluator (with 'name' flag and 'configuration' flag) |
string[] | the list of configuration parameters accepted by the evaluator (query mode with 'name' flag and 'configuration' flag) |
string[] | the list of clusters currently assigned to the evaluator with intervening sublist sizes (query mode with 'name' flag and 'clusters' flag) |
string | the help information supplied by the evaluator (query mode with 'name' flag and 'info' flag) |
int | the priority value of the evaluator (query mode with 'name' flag and 'priority' flag) |
In query mode, return type is based on queried flag.
evaluation, manager, DG, runtime
clusters, configuration, enable, info, name, nodeType, nodeTypeChildren, priority, valueName
Long name (short name) |
Argument types |
Properties |
clusters(cl)
|
boolean
|
|
|
This flag queries the list of clusters currently assigned to the named custom evaluator.
The return value will be an array of strings where the array consists of a
set of (number, string[]) groups. e.g. If an evaluator has 2 clusters with
2 and 3 nodes in them respectively the output would be something like:
(2, 'transform2', 'transform3', 3, 'joint1', 'joint2', 'joint3')
|
|
configuration(c)
|
string
|
|
|
Sends configuration information to a custom evaluator. It's up to the evaluator
to understand what they mean.
Multiple configuration messages can be sent in a single command.
Query this flag for a given evaluator to find out what configuration
messages it accepts.
|
|
enable(en)
|
boolean
|
|
|
Enables or disables a specific graph evaluation runtime, depending on the
state of the flag. In order to use this flag you must also specify the
name in the 'name' argument.
When the 'enable' flag is used in conjunction with the 'nodeType' flag then
it is used to selectively turn on or off the ability of the given evaluator
to handle nodes of the given type (i.e. it no longer toggles the evaluator
enabled state).
When the 'enable' flag is used in conjunction with the 'configuration' flag then
it is passed along with the configuration message interpreted by the custom
evaluator.
|
|
info(i)
|
boolean
|
|
|
Queries the evaluator information. Only valid in query mode since the
information is generated by the evaluator's internal state and cannot be
changed.
In order to use this flag, the 'name' argument must also be specified.
|
|
name(n)
|
string
|
|
|
Names a particular DG evaluation override evaluator. Evaluators are registered
automatically by name. Query this flag to get a list of available runtimes.
When a runtime is registered it is enabled by default. Use the 'enable'
flag to change its enabled state.
In query mode, this flag can accept a value.
|
|
nodeType(nt)
|
string
|
|
|
Names a particular node type to be passed to the evaluator request.
Evaluators can either use or ignore the node type information as passed.
In query mode, this flag can accept a value.
|
|
nodeTypeChildren(ntc)
|
boolean
|
|
|
If enabled when using the 'nodeType' flag then handle all of the node types
derived from the given one as well. Default is to only handle the named
node type.
|
|
priority(p)
|
int
|
|
|
Query or set the evaluator priority. Custom evaluator with highest priority
order will get the chance to claim the nodes first. Evaluators must have
unique priority values.
In order to use this flag you must also specify the name in the 'name' argument.
|
|
valueName(vn)
|
string
|
|
|
Queries a value from a given evaluator. Evaluators can define a set of
values for which they answer.
In query mode, this flag can accept a value.
|
|
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
import maya.cmds as cmds
# Load a custom evaluator plug-in (not a real plug-in, just an example)
cmds.loadPlugin( 'MY_CUSTOM_EVALUATOR' );
# Result: MY_CUSTOM_EVALUATOR #
# List the available evaluators
cmds.evaluator( query=True );
# Result: [u'MY_CUSTOM_EVALUATOR'] #
# Is 'MY_CUSTOM_EVALUATOR' disabled?
cmds.evaluator( query=True, name='MY_CUSTOM_EVALUATOR' )
# Result: False #
# Check which evaluators are disabled
cmds.evaluator( enable=False, query=True )
# Result: [u'MY_CUSTOM_EVALUATOR'] #
# Turn on 'MY_CUSTOM_EVALUATOR'
cmds.evaluator( enable=True, name='MY_CUSTOM_EVALUATOR' )
# Result: False #
# Check to see which evaluators are enabled
cmds.evaluator( enable=True, query=True )
# Result: [u'MY_CUSTOM_EVALUATOR'] #
# Make 'MY_CUSTOM_EVALUATOR' handle nodes of type 'transform'
cmds.evaluator( enable=True, name='MY_CUSTOM_EVALUATOR', nodeType='transform' )
# Result: [u'transform'] #
# Make 'MY_CUSTOM_EVALUATOR' handle nodes of type 'transform' and all derived types
cmds.evaluator( enable=True, name='MY_CUSTOM_EVALUATOR', nodeType='transform', nodeTypeChildren=True )
# Result: [u'transform', u'joint', <large list omitted>] #
# Get the list of clustered nodes handled by 'MY_CUSTOM_EVALUATOR' in the current scene.
cmds.evaluator( name='MY_CUSTOM_EVALUATOR', query=True, clusters=True )
# Result: ['2', 'transform1', 'transform2', '3', 'joint3', 'joint4', 'joint5' ] #
# Send a configuration message to 'MY_CUSTOM_EVALUATOR'
cmds.evaluator( name='MY_CUSTOM_EVALUATOR', configuration='cluster=subgraph' )
# Result: #
# Query information about 'MY_CUSTOM_EVALUATOR'
cmds.evaluator( query=True, name='MY_CUSTOM_EVALUATOR', info=True )
# Result: #
# Query 'pruneRoots' priority
cmds.evaluator( query=True, name='pruneRoots', priority=True )
# Result: 1000
# Set "pruneRoots" priority to 2500
cmds.evaluator( name='pruneRoots', priority=2500 )
# Result: True