pymel.core.rendering.createRenderLayer

createRenderLayer(*args, **kwargs)

Create a new render layer. The render layer number will be assigned based on the first unassigned number not less than the base index number found in the render layer global parameters. Normally all objects and their descendants will be added to the new render layer but if ‘-noRecurse’ is specified then only the objects themselves will be added. Only transforms and geometry will be added to the new render layer.

Modifications:
  • returns a PyNode object
Flags:
Long name (short name) Argument Types Properties
empty (e) bool ../../../_images/create.gif
 
If set then create an empty render layer. The global flag or specified member list will take precidence over use of this flag.
g (g) bool ../../../_images/create.gif
 

If set then create a layer that contains all DAG objects in the scene. Any future objects created will also automatically become members of this layer. The global flag will take precidence over use of the empty flag or specified member list.

makeCurrent (mc) bool ../../../_images/create.gif
 
If set then make the new render layer the current one.
name (n) unicode ../../../_images/create.gif
 
Name of the new render layer being created.
noRecurse (nr) bool ../../../_images/create.gif
 
If set then only add specified objects to the render layer. Otherwise all descendants will also be added.
number (num) int ../../../_images/create.gif
 
Number for the new render layer being created.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.createRenderLayer

Example:

import pymel.core as pm

import maya.cmds as cmds

# Add nut and nutShape to a new render layer
#
pm.select( 'nut' )
pm.createRenderLayer()
renderLayer1
# Add only bolt to a new render layer
#
pm.createRenderLayer( 'bolt', noRecurse=True )
renderLayer2
# Add washer to the new render layer 'assembly'.
#
pm.createRenderLayer( 'washer', noRecurse=True, name='assembly' )
assembly
# Create a layer that will always contains everything
#
pm.createRenderLayer( g=True )
renderLayer3