pymel.core.rendering.cameraSet

cameraSet(*args, **kwargs)

This command manages camera set nodes. Camera sets allow the users to break a single camera shot into layers. Instead of drawing all objects with a single camera, you can isolate the camera to only focus on certain objects and layer another camera into the viewport that draws the other objects. The situation to use camera sets primarily occurs when building stereoscopic scenes. For example, a set of stereo parameters may make the background objects divergent beyond the tolerable range of the human perceptual system. However, you like the settings because the main focus is in the foreground and the depth is important to the visual look of the scene. You can use camera sets to break apart the shot into a foreground stereo camera and background stereo camera. The foreground stereo camera will retain the original parameters; however, it will only focus on the foreground elements. The background stereo camera will have a different set of stereo parameters and will only draw the background element. Camera sets can be viewed using the stereo viewer and are currently only designed to work with stereo camera rigs.

Flags:
Long name (short name) Argument Types Properties
active (a) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Gets / sets the active camera layer.
appendTo (atl) bool ../../../_images/create.gif ../../../_images/edit.gif
 

Append a new camera and/or object set to then end of the cameraSet layer list. This flag cannot be used in conjunction with insert flag. Additionally, it requires the camera and/or objectSet flag to be used.

camera (cam) PyNode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Set/get the camera for a particular layer. When in query mode, You must specify the layer with the layer flag.
clearDepth (cd) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

Specifies if the drawing buffer should be cleared before beginning the draw for that layer.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list.

deleteAll (da) bool ../../../_images/create.gif ../../../_images/edit.gif
 
Delete all camera layers
deleteLayer (d) bool ../../../_images/create.gif ../../../_images/edit.gif
 
Delete a layer from the camera set. You must specify the layer using the layer flag.
insertAt (ins) bool ../../../_images/create.gif ../../../_images/edit.gif
 

Inserts the specified camera and/or object set at the specified layer. This flag cannot be used in conjunction with the append flag. Additionally, this flag requires layer and camera (or objectSet) flag to be used.

layer (l) int ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Specifies the layer index to be used when accessing layer information
name (n) PyNode ../../../_images/create.gif ../../../_images/query.gif
 
Gets or sets the name for the created camera set.
numLayers (nl) bool ../../../_images/create.gif ../../../_images/query.gif
 
Returns the number of layers defined in the specified cameraSet
objectSet (os) PyNode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Set/get the objectSet for a particular layer. When in query mode, you must specify the layer with the layer flag.
order (o) int ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Set the order in which a particular layer is processed. This flag must be used in conjunction with the layer flag.

Derived from mel command maya.cmds.cameraSet

Example:

import pymel.core as pm

# create some objects
pm.sphere(n='sphere1')
# Result: [nt.Transform(u'sphere1'), nt.MakeNurbSphere(u'makeNurbSphere1')] #
pm.cone(n='cone1')
# Result: [nt.Transform(u'cone1'), nt.MakeNurbCone(u'makeNurbCone1')] #

# create a set with whatever is currently active
pm.select( 'sphere1', 'cone1')
newSet2 = pm.sets()

pm.loadPlugin( "stereoCamera", qt=True )
# Result: [u'stereoCamera'] #
from maya.app.stereo import stereoCameraRig
rig = stereoCameraRig.createStereoCameraRig('StereoCamera')

# Create a new cameraSet node.
pm.cameraSet()
# Result: nt.CameraSet(u'cameraSet1') #

# Add the cam " object set to the set
pm.cameraSet( 'cameraSet1', edit=True, appendTo=True, cam=rig[0], objectSet=newSet2 )

Previous topic

pymel.core.rendering.camera

Next topic

pymel.core.rendering.cameraView

Core

Core Modules

Other Modules

This Page