pymel.core.general.containerBind

containerBind(*args, **kwargs)

This is an accessory command to the container command which is used for some automated binding operations on the container. A container’s published interface can be bound using a bindingSet on the associated container template.

Flags:
Long name (short name) Argument Types Properties
allNames (all) bool ../../../_images/create.gif
 

Specifies that all published names on the container should be considered during the binding operation. By default only unbound published names will be operated on. Additionally specifying the ‘force’ option with ‘all’ will cause all previously bound published names to be reset (or unbound) before the binding operation is performed; in the event that there is no appropriate binding found for the published name, it will be left in the unbound state.

bindingSet (bs) unicode ../../../_images/query.gif
 
Specifies the name of the template binding set to use for the bind or query operation. This flag is not available in query mode.
bindingSetConditions (bsc) bool ../../../_images/query.gif
 

Used in query mode, returns a list of binding set condition entries from the specified template binding set. The list returned is composed of of all published name / condition string pairs for each entry in the binding set. This flag returns all entries in the associated binding set and does not take into account the validity of each entry with respect to the container’s list of published names, bound or unbound state, etc.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list.

bindingSetList (bsl) bool ../../../_images/query.gif ../../../_images/edit.gif
 
Used in query mode, returns a list of available binding sets that are defined on the associated container template.
force (f) bool ../../../_images/create.gif
 
This flag is used to force certain operations to proceed that would normally not be performed.
preview (p) bool ../../../_images/create.gif
 

This flag will provide a preview of the results of a binding operation but will not actually perform it. A list of publishedName/boundName pairs are returned for each published name that would be affected by the binding action. If the binding of a published name will not change as a result of the action it will not be listed. Published names that were bound but will become unbound are also listed, in this case the associated boundName will be indicated by an empty string.

Derived from mel command maya.cmds.containerBind

Example:

import pymel.core as pm

import maya.cmds as cmds

# query the template binding sets available for this container
#
pm.containerBind(container1, query=1, bindingSetList=1)
# attempt to bind published names on the container
# using matching information in the bindingSet specified.
# By default only unbound names are considered.
#
pm.containerBind(container1, bindingSet="MayaBindings")
# Attempt to bind all published names on the container
# using matching information in the bindingSet specified.
# Previously bound names will only be re-bound if the bindingSet
# produces an appropriate match.
#
pm.containerBind(container1, bindingSet="MayaBindings", allNames=1)
# Forcibly re-bind all published names on the container
# using matching information in the bindingSet specified.
# All previously bound names will be unbound and will only
# be re-bound if the binding set produces an appropriate match.
#
pm.containerBind(container1, bindingSet="MayaBindings", allNames=1, force=1)
# preview what the results of a binding operation would be, but do
# not actually perform it.
pm.containerBind(container1, bindingSet="MayaBindings", preview=1, allNames=1, force=1)

Previous topic

pymel.core.general.container

Next topic

pymel.core.general.containerProxy

Core

Core Modules

Other Modules

This Page