This command creates a named renderTypeFilter object. This object can be attached to selectionConnection objects, or to editors, in order to filter the renderType lists going through them. Using union and intersection filters, complex composite filters can be created.
Long name (short name) | Argument Types | Properties | |
---|---|---|---|
anyTextures (at) | bool | ||
Pass texture objects if set to true. Value is false by default. To get all objects that are not textures then set this flag to true and use the -neg/negateflag to invert the result. |
|||
category (cat) | unicode | ||
|
|||
classification (cls) | unicode | ||
|
|||
exclusiveLights (exl) | bool | ||
Pass exclusive light objects if set to true. Value is false by default. To get all objects that are not exclusive lights then set this flag to true and use the -neg/negateflag to invert the result. |
|||
exists (ex) | bool | ||
lightSets (ls) | bool | ||
Pass light set objects if set to true. Value is false by default. To get all objects that are not light sets then set this flag to true and use the -neg/negateflag to invert the result. |
|||
lights (l) | bool | ||
Pass light objects if set to true. Value is false by default. To get all objects that are not lights then set this flag to true and use the -neg/negateflag to invert the result. |
|||
linkedLights (ll) | bool | ||
Pass linked light objects if set to true. Value is false by default. To get all objects that are not linked lights then set this flag to true and use the -neg/negateflag to invert the result. |
|||
listBuiltInFilters (lbf) | bool | ||
|
|||
listOtherFilters (lof) | bool | ||
|
|||
listUserFilters (luf) | bool | ||
|
|||
negate (neg) | bool | ||
|
|||
nodeClassification (nc) | unicode | ||
nonExclusiveLights (nxl) | bool | ||
Pass non-exclusive light objects if set to true. Value is false by default. To get all objects that are not non-exclusive lights then set this flag to true and use the -neg/negateflag to invert the result. |
|||
nonIlluminatingLights (nil) | bool | ||
Pass non-illuminating light objects if set to true. Value is false by default. To get all objects that are not non-illuminating lights then set this flag to true and use the -neg/negateflag to invert the result. |
|||
parent (p) | unicode | ||
Optional. If specified, the filter’s life-span is linked to that of the parent. When the parent goes out of scope, so does the filter. If not specified, the filter will exist until explicitly deleted. |
|||
postProcess (pp) | bool | ||
Pass post process objects if set to true. Value is false by default. To get all objects that are not post processes then set this flag to true and use the -neg/negateflag to invert the result. |
|||
renderUtilityNode (run) | bool | ||
Pass render utility node objects if set to true. Value is false by default. To get all objects that are not render utility nodes then set this flag to true and use the -neg/negateflag to invert the result. |
|||
renderableObjectSets (ros) | bool | ||
Pass renderable object sets if set to true. Value is false by default. To get all objects that are not renderable object sets then set this flag to true and use the -neg/negateflag to invert the result. |
|||
renderingNode (rn) | bool | ||
shaders (s) | bool | ||
Pass shader objects if set to true. Value is false by default. To get all objects that are not shaders then set this flag to true and use the -neg/negateflag to invert the result. |
|||
text (t) | unicode | ||
|
|||
textures2d (t2d) | bool | ||
Pass 2D texture objects if set to true. Value is false by default. To get all objects that are not 2D textures then set this flag to true and use the -neg/negateflag to invert the result. |
|||
textures3d (t3d) | bool | ||
Pass 3D texture objects if set to true. Value is false by default. To get all objects that are not 3D textures then set this flag to true and use the -neg/negateflag to invert the result. |
|||
texturesProcedural (tp) | bool | ||
Pass procedural texture objects if set to true. Value is false by default. To get all objects that are not procedural textures then set this flag to true and use the -neg/negateflag to invert the result.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.itemFilterRender
Example:
import pymel.core as pm
# If an object is a shader or any type of texture, it will pass
# this filter.
#
# If an object is not a 3d Texture, it will pass this filter.
#
no3dTextures = pm.itemFilterRender(negate=True, textures3d=True)
# A couple more filters. One showing only lights, the other showing
# everything but lights.
#
lights = pm.itemFilterRender(lights=True)
noLights = pm.itemFilterRender(lights=True, negate=True)
# Create a window with an outliner editor, along with some buttons that
# will apply a different filter to the outliner.
#
window = pm.window()
form = pm.formLayout()
editor = pm.outlinerEditor(showDagOnly=False)
column = pm.columnLayout(adjustableColumn=True)
pm.button( label='No Filter', command='pm.outlinerEditor("'+editor+'", edit=True, filter="")')
# Result: ui.Button('window1|formLayout58|columnLayout54|button46') #
pm.button( label='Shaders and Textures', command='pm.outlinerEditor("'+editor+'", edit=True, filter="'+shadersAndTextures+'")')
pm.button( label='No 3D Textures', command='pm.outlinerEditor("'+editor+'", edit=True, filter="'+no3dTextures+'")')
pm.button( label='Light', command='pm.outlinerEditor("'+editor+'", edit=True, filter="'+lights+'")')
pm.button( label='No Light', command='pm.outlinerEditor("'+editor+'", edit=True, filter="'+noLights+'")')
input = pm.selectionConnection(worldList=True)
pm.editor( editor, edit=True, mainListConnection=input )
# Apply the layout attachments.
#
pm.formLayout(form, edit=True,
attachForm=((column, 'top', 0), (column, 'left', 0),
(column, 'bottom', 0), (editor, 'top', 0),
(editor, 'bottom', 0), (editor, 'right', 0)),
attachNone=(column, 'right'),
attachControl=(editor, 'left', 0, column))
# Put some objects in the scene.
#
pm.spotLight()
pm.pointLight()
pm.shadingNode( 'bulge', asTexture=True )
pm.shadingNode( 'checker', asTexture=True )
pm.shadingNode( 'granite', asTexture=True )
pm.shadingNode( 'wood', asTexture=True )
pm.shadingNode( 'lambert', asShader=True )
pm.shadingNode( 'blinn', asShader=True )
pm.showWindow( window )