Command to assign nodes to bins.
Long name (short name) | Argument Types | Properties | |
---|---|---|---|
addToBin (add) | unicode | ||
|
|||
exists (ex) | unicode | ||
|
|||
inheritBinsFromNodes (ibn) | PyNode | ||
|
|||
isValidBinName (ivn) | unicode | ||
Query if the specified bin name is valid. If so, return true. Otherwise, return false.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list. |
|||
listBins (lb) | bool | ||
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) | unicode | ||
|
|||
notifyChanged (nfc) | bool | ||
|
|||
removeFromBin (rm) | unicode | ||
|
Derived from mel command maya.cmds.binMembership
Example:
import pymel.core as pm
import maya.cmds as cmds
# Add a given node to a bin.
#
pm.binMembership( 'lambert1', addToBin='wood' )
# Add a selection of nodes to a given bin.
#
newLambertNode = pm.createNode('lambert')
list = ("lambert1", newLambertNode)
pm.binMembership( list, addToBin='grass' )
# Check if a node exists in a bin.
#
pm.binMembership( 'lambert1', exists='wood' )
# Result: True #
# Query and return all the nodes which belong to the bin.
#
newLambertNode = pm.createNode('lambert')
nodeList = ("lambert1", newLambertNode)
pm.binMembership( nodeList, query=True, listBins=True )
# Result: [u'wood', u'grass'] #
# Make the nodes belong exclusively in bin "wood".
#
newLambertNode = pm.createNode('lambert')
nodeList = ("lambert1", newLambertNode)
pm.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.
#
pm.binMembership( 'lambert1', addToBin='wood' )
node = pm.createNode('lambert')
pm.binMembership( node, addToBin='grass' )
srcNodeList = ("lambert1", node)
destNode = pm.createNode('blinn')
pm.binMembership( srcNodeList, inheritBinsFromNodes=destNode )
# Notify that binMembership has been changed.
#
pm.binMembership( notifyChanged=True )
# Check if a bin name is valid or not. If valid, return true.
# Otherwise, return false.
#
pm.binMembership( isValidBinName='wood' )
# Result: True #