Go to: Synopsis. Return value. Related. Flags. Python examples.

Synopsis

filterInstances([shapes=boolean])

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

filterInstances is undoable, queryable, and NOT editable.

This command filters the selection list to remove duplicate instances that refer to the same object/components. If any such instances are found they will be merged with the first selected instance.

Returns a string array containing all matching selection items or true/false if the query flag is used.

Return value

string[]Command result

In query mode, return type is based on queried flag.

Related

filterExpand

Flags

shapes
Long name (short name) Argument types Properties
shapes(s) boolean create
If this is true then the command will check for an instanced shapes below the selected transform(s) and use them to decide whether the parent transforms should be considered instances. Default is false.

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can have multiple arguments, passed either as a tuple or a list.

Python examples

import maya.cmds as cmds

# Returns true if any selected object(s) are instances of another selected object.
cmds.filterInstances( q=True )

# Returns a new selection list with duplicate instances removed.
cmds.filterInstances()