pymel.core.general.itemFilterRender

itemFilterRender(*args, **kwargs)

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.

Flags:
Long name (short name) Argument Types Properties
anyTextures (at) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

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 ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
A string for categorizing the filter.
classification (cls) unicode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Internal use only. Indicates whether the filter is a built-in or user filter. The string argument is one of “builtIn” | “user” | “other”.
exclusiveLights (exl) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

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 ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

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 ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

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 ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

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 ../../../_images/query.gif
 
Returns an array of all item filters with classification “builtIn”.
listOtherFilters (lof) bool ../../../_images/query.gif
 
Returns an array of all item filters with classification “other”.
listUserFilters (luf) bool ../../../_images/query.gif
 
Returns an array of all item filters with classification “user”.
negate (neg) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
This flag can be used to cause the filter to invert itself, and reverse what passes and what fails.
nodeClassification (nc) unicode  
   
nonExclusiveLights (nxl) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

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 ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

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 ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

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 ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

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 ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

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 ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

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 ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

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 ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Defines an annotation string to be stored with the filter
textures2d (t2d) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

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 ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

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 ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

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

import maya.cmds as cmds

#    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|formLayout53|columnLayout53|button44') #
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 )

Previous topic

pymel.core.general.itemFilterAttr

Next topic

pymel.core.general.itemFilterType

Core

Core Modules

Other Modules

This Page