Go to: Synopsis. Return value. Related.
Flags. Python
examples.
stereoRigManager( objects , [addRig=[string, string, string]],
[cameraSetFunc=[string,
string]], [creationProcedure=[string,
string]], [defaultRig=string], [delete=string], [language=[string, string]], [listRigs=boolean], [rigDefinition=string])
Note: Strings representing object names and
arguments must be separated by commas. This is not depicted in the
synopsis.
stereoRigManager is undoable, queryable, and NOT
editable.
This command manages the set of stereo rig tools.
None
In query mode, return type is based on queried flag.
camera
addRig, cameraSetFunc, creationProcedure, defaultRig, delete,
language, listRigs, rigDefinition
Long name (short name) |
Argument types |
Properties |
Database manipulation |
addRig(add) |
[string, string, string] |
|
|
Adds a new stereo rig definition. This flag takes 3 arguments:
name, language, create:
- name: A unique name for the rig type.
- lang: The language used for the callback. Valid values are
"Python" and "MEL". Use the Python interface when possible.
- create: Procedure used to create a new rig of this type. This
procedure takes no argument, and must return an array of strings.
The first element is the root DAG node of the rig. The second and
third elements are respectively the left and right cameras.
|
|
cameraSetFunc(csf) |
[string, string] |
|
|
Specifies the function to call when a rig is about to be added
to a camera set. This function must be the same language as
originally defined by the tool. |
|
language(l) |
[string, string] |
|
|
Changes the language of an existing rig definition. Valid
values are "Python" and "MEL". This flag takes 2 arguments: the
name of the existing rig definition and the language keyword. |
|
creationProcedure(cp) |
[string, string] |
|
|
Changes the creation procedure of an existing rig definition.
This flag takes 2 arguments: the name of the existing rig
definition and the procedure. |
|
delete(d) |
string |
|
|
Removes the definition of a stereo rig. The argument must be
the name of one of the rigs added using the add flag. |
|
defaultRig(dr) |
string |
|
|
Sets the default rig tool. The argument must be the name of one
of the rigs added using the add flag. Returns True if the
default could be set, False otherwise. |
|
Database query |
listRigs(lr) |
boolean |
|
|
When present, returns the list of all defined rigs. All other
flags are ignored. |
|
rigDefinition(rd) |
string |
|
|
Returns the definition of a rig, in the same format as the add
flag. A string array containing lang, create
cameraSet. If an empty string is passed as the argument,
then the default rig is used. |
|
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
# Make sure the stereo plug-in is loaded
cmds.loadPlugin("stereoCamera", quiet=True)
# Remember the default rig
defRigBefore = cmds.stereoRigManager(query=True, defaultRig=True)
# Register new rig types, using MEL or Python implementations.
cmds.stereoRigManager(add=['StereoCameraHier', 'Python', 'maya.app.stereo.stereoCameraHierarchicalRig.createRig'])
cmds.stereoRigManager(add=['StereoCameraMulti', 'Python', 'maya.app.stereo.stereoCameraComplexRig.createRig'])
cmds.stereoRigManager(add=['StereoCameraSimple', 'MEL', 'stereoCameraSimpleRig'])
# Make the second one the default rig
cmds.stereoRigManager(defaultRig='StereoCameraMulti')
# Remove it
cmds.stereoRigManager(delete='StereoCameraMulti')
# Query the default rig.
defRig = cmds.stereoRigManager(query=True, defaultRig=True)
print 'Default rig is now "'+defRig+'"'
# Print the definition of each rig type
rigs = cmds.stereoRigManager(listRigs=True)
for rig in rigs:
defs = cmds.stereoRigManager(rigDefinition=rig)
print 'Rig "'+rig+'": (language '+defs[0]+') create callback: '+defs[1]
# Cleanup after we are done
cmds.stereoRigManager(delete='myDefaultRig')
cmds.stereoRigManager(delete='mySimpleRig')
cmds.stereoRigManager(defaultRig=defRigBefore)
print 'After cleanup'
defRig = cmds.stereoRigManager(query=True, defaultRig=True)
print 'Default rig is now "'+defRig+'"'
rigs = cmds.stereoRigManager(listRigs=True)
for rig in rigs:
defs = cmds.stereoRigManager(rigDefinition=rig)
print 'Rig "'+rig+'": (language '+defs[0]+') create callback: '+defs[1]