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

Synopsis

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.

Return value

boolean

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

Keywords

binMembership

Flags

addToBin, exists, inheritBinsFromNodes, isValidBinName, listBins, makeExclusive, notifyChanged, removeFromBin
Long name (short name) Argument types Properties
addToBin(add) string create
Add the nodes in a node list to a bin.
exists(ex) string create
Query if a node exists in a bin. The exists flag can take only one node.
inheritBinsFromNodes(ibn) name create
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.
isValidBinName(ivn) string create
Query if the specified bin name is valid. If so, return true. Otherwise, return false.
listBins(lb) boolean createquery
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 create
Make the specified nodes belong exclusively in the specified bin.
notifyChanged(nfc) boolean create
This flag is used to notify that binMembership has been changed.
removeFromBin(rm) string create
Remove the nodes in a node list from a bin.

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

# 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' )