Go to: Synopsis. Return value. Keywords.
Flags. Python
examples.
binMembership([addToBin=string], [exists=string], [inheritBinsFromNodes=name],
[isValidBinName=string],
[listBins=boolean], [makeExclusive=string], [notifyChanged=boolean], [removeFromBin=string])
Note: Strings representing object names and
arguments must be separated by commas. This is not depicted in the
synopsis.
binMembership is undoable, queryable, and NOT
editable.
Command to assign nodes to bins.
In query mode, return type is based on queried flag.
binMembership
addToBin, exists, inheritBinsFromNodes, isValidBinName, listBins, makeExclusive, notifyChanged, removeFromBin
Long name (short name) |
Argument types |
Properties |
addToBin(add) |
string |
 |
|
Add the nodes in a node list to a bin. |
|
removeFromBin(rm) |
string |
 |
|
Remove the nodes in a node list from a bin. |
|
exists(ex) |
string |
 |
|
Query if a node exists in a bin. The exists flag can take only
one node. |
|
listBins(lb) |
boolean |
  |
|
Query and return a list of bins a list of nodes belong to. If a
bin contains any of the nodes in the selection list, then it should
be included in the returned bin list. |
|
makeExclusive(mke) |
string |
 |
|
Make the specified nodes belong exclusively in the specified
bin. |
|
inheritBinsFromNodes(ibn) |
name |
 |
|
Let the node in the flag's argument inherit bins from nodes in
the specified node list. The node list is specified as the object
of the command. |
|
notifyChanged(nfc) |
boolean |
 |
|
This flag is used to notify that binMembership has been
changed. |
|
isValidBinName(ivn) |
string |
 |
|
Query if the specified bin name is valid. If so, return true.
Otherwise, return 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. |
import maya.cmds as cmds
# Add a given node to a bin.
#
cmds.binMembership( 'lambert1', addToBin='wood' )
# Add a selection of nodes to a given bin.
#
newLambertNode = cmds.createNode('lambert')
list = ("lambert1", newLambertNode)
cmds.binMembership( list, addToBin='grass' )
# Check if a node exists in a bin.
#
cmds.binMembership( 'lambert1', exists='wood' )
# Query and return all the nodes which belong to the bin.
#
newLambertNode = cmds.createNode('lambert')
nodeList = ("lambert1", newLambertNode)
cmds.binMembership( nodeList, query=True, listBins=True )
# Make the nodes belong exclusively in bin "wood".
#
newLambertNode = cmds.createNode('lambert')
nodeList = ("lambert1", newLambertNode)
cmds.binMembership( nodeList, makeExclusive='wood' )
# Let the dest node inherit bins from nodes in the src node list.
# The dest node is specified by the "inheritBinsFromNodes" flag's
# argument.
#
cmds.binMembership( 'lambert1', addToBin='wood' )
node = cmds.createNode('lambert')
cmds.binMembership( node, addToBin='grass' )
srcNodeList = ("lambert1", node)
destNode = cmds.createNode('blinn')
cmds.binMembership( srcNodeList, inheritBinsFromNodes=destNode )
# Notify that binMembership has been changed.
#
cmds.binMembership( notifyChanged=True )
# Check if a bin name is valid or not. If valid, return true.
# Otherwise, return false.
#
cmds.binMembership( isValidBinName='wood' )