pymel.core.rendering.editRenderLayerMembers

static rendering.editRenderLayerMembers(*args, **kwargs)

This command is used to query and edit memberships to render layers. Only transform and geometry nodes may be members. At render time, all descendants of the members of a render layer will also be included in the render layer.

Flags:
Long name (short name) Argument Types Properties
fullNames (fn) bool ../../../_images/query.gif
 
(Query only.) If set then return the full DAG paths of the objects in the layer. Otherwise return just the name of the object.
noRecurse (nr) bool ../../../_images/create.gif
 

If set then only add selected objects to the render layer. Otherwise all descendants of the selected objects will also be added. This flag may be applied to adding or removing objects from the layer.

remove (r) bool ../../../_images/create.gif
 
Remove the specified objects from the render layer. Flag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.editRenderLayerMembers

Example:

import pymel.core as pm

pm.editRenderLayerMembers( 'layer1', 'sphere1', 'cone1' )
# Result : 4
pm.editRenderLayerMembers( 'layer1', query=True )
# Result : sphere1 sphere1Shape cone1 cone1Shape
pm.editRenderLayerMembers( 'layer1', 'expression1', 'sphere2' )
# Result : 2
pm.editRenderLayerMembers( 'layer1', 'sphere1', remove=True)
# Result : 2