pymel.core.general.itemFilterRender¶
- itemFilterRender(*args, **kwargs)¶
Flags:
Long Name / Short Name Argument Types Properties anyTextures / at bool category / cat unicode classification / cls unicode exclusiveLights / exl bool exists / ex bool lightSets / ls bool lights / l bool linkedLights / ll bool listBuiltInFilters / lbf bool listOtherFilters / lof bool listUserFilters / luf bool negate / neg bool nodeClassification / nc unicode nonExclusiveLights / nxl bool nonIlluminatingLights / nil bool parent / p unicode postProcess / pp bool renderUtilityNode / run bool renderableObjectSets / ros bool renderingNode / rn bool shaders / s bool text / t unicode textures2d / t2d bool textures3d / t3d bool texturesProcedural / tp bool 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 )