Create a new display layer. The display layer number will be assigned based on the first unassigned number not less than the base index number found in the display layer global parameters. Normally all objects and their descendants will be added to the new display layer but if the ‘-nr’ flag is specified then only the objects themselves will be added.
Long name (short name) | Argument Types | Properties | |
---|---|---|---|
empty (e) | bool | ||
|
|||
makeCurrent (mc) | bool | ||
|
|||
name (n) | unicode | ||
|
|||
noRecurse (nr) | bool | ||
|
|||
number (num) | int | ||
|
Derived from mel command maya.cmds.createDisplayLayer
Example:
import pymel.core as pm
import maya.cmds as cmds
# Create a sphere.
#
objectArray = pm.sphere()
# Select the sphere.
#
pm.select( objectArray[0] )
# Create a layer. The selected object will be placed
# in this layer. Note in this case both the nurbsSphere
# and nurbsSphere shape are placed in the layer.
#
pm.createDisplayLayer()
# Result: nt.DisplayLayer(u'displayLayer') #
# Create a cone.
#
objectArray = pm.cone()
# Select the cone.
#
pm.select( objectArray[0] )
# Create a layer but only put the nurbsCone in the layer.
# The nurbsConeShape will remain in the default layer
# as a result of specifying the -nr/noRecurse flag.
#
# Note also that you can specify the name of the layer
# with the -n/name flag.
#
pm.createDisplayLayer( noRecurse=True, name='ExampleLayer' )
# Result: nt.DisplayLayer(u'ExampleLayer') #