Go to: Synopsis. Return value. Flags. Python examples.
stringArrayIntersector(
string
, [allowDuplicates=boolean], [defineTemplate=string], [exists=boolean], [intersect=string[]], [reset=boolean], [useTemplate=string])
Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.
stringArrayIntersector is undoable, queryable, and editable.
The stringArrayIntersector command creates and edits an object which is
able to efficiently intersect large string arrays. The intersector object
maintains a sense of "the intersection so far", and updates the
intersection when new string arrays are provided using the -i/intersect
flag.
Note that the string intersector object may be deleted using the deleteUI
command.
string | The name of the intersector. |
In query mode, return type is based on queried flag.
allowDuplicates, defineTemplate, exists, intersect, reset, useTemplate
Long name (short name) |
Argument types |
Properties |
|
allowDuplicates(ad)
|
boolean
|
|
|
Should the intersector allow duplicates in the input arrays (true),
or combine all duplicate entries into a single, unique entry (false).
This flag must be used when initially creating the intersector.
Default is 'false'.
|
|
defineTemplate(dt)
|
string
|
|
|
Puts the command in a mode where any other flags and arguments are
parsed and added to the command template specified in the argument.
They will be used as default arguments in any subsequent
invocations of the command when templateName is set as the
current template.
|
|
exists(ex)
|
boolean
|
|
|
Returns whether the
specified object exists or not. Other flags are ignored.
|
|
intersect(i)
|
string[]
|
|
|
Intersect the specified string array with the current intersection
being maintained by the intersector.
|
|
reset(r)
|
boolean
|
|
|
Reset the intersector to begin a new intersection.
|
|
useTemplate(ut)
|
string
|
|
|
Forces the command to use a command template other than
the current one.
|
|
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.
|
import maya.cmds as cmds
# Create an intersector
#
myIntersector = cmds.stringArrayIntersector('stringArrayIntersector')
# Intersect some string arrays using the intersector
#
initialArray = ['Excellent', 'Smithers', 'doh']
cmds.stringArrayIntersector( myIntersector, edit=True, intersect=initialArray )
cmds.stringArrayIntersector( myIntersector, edit=True, intersect=['Smithers', 'Homer'] )
# Query the intersector to see what the intersection is so far
#
cmds.stringArrayIntersector( myIntersector, query=True )
# Result: Smithers #
# Reset the intersector so that you can use it again with new string
# arrays
#
cmds.stringArrayIntersector( myIntersector, edit=True, reset=True )
# Delete the intersector as we are now done with it
#
cmds.deleteUI( myIntersector )