pymel.core.general.containerPublish

containerPublish(*args, **kwargs)

This is an accessory command to the container command which is used for some advanced publishing operations on the container. For example, the “publishConnections” flag on the container will publish all the connections, but this command can be used to publish just the inputs, outputs, or to collapse the shared inputs into a single attribute before publishing.

Flags:
Long name (short name) Argument Types Properties
bindNode (bn) unicode, unicode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Bind the specified node to the published node name.
bindTemplateStandins (bts) bool ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 

This flag will create a temporary stand-in attribute for any attributes that exist in the template but are not already bound. This enables you to set values for unbound attributes.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list.

inConnections (ic) bool ../../../_images/create.gif
 
Specifies that the unpublished connections to nodes in the container from external nodes should be published.
mergeShared (ms) bool ../../../_images/create.gif
 

For use with the inConnections flag. Indicates that when an external attribute connects to multiple internal attributes within the container, a single published attribute should be used to correspond to all of the internal attributes.

outConnections (oc) bool ../../../_images/create.gif
 
Specifies that the unpublished connections from nodes in the container to external nodes should be published.
publishNode (pn) unicode, unicode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Publish a name and type. When first published, nothing will be bound. To bind a node to the published name, use the bindNode flag.
unbindNode (ubn) unicode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Unbind the node that is published with the name specified by the flag.
unpublishNode (upn) unicode ../../../_images/create.gif ../../../_images/query.gif ../../../_images/edit.gif
 
Unpublish the specified published node name.

Derived from mel command maya.cmds.containerPublish

Example:

import pymel.core as pm

import maya.cmds as cmds

# create a proxy for container1
#
pm.containerPublish(container1,inConnections=True,mergeShared=True)
# add a published name 'mainShader' of type 'objectSet'
#
pm.containerPublish(container1,publishNode=['mainShadingSet','objectSet']
# bind a shading group to the published name
#
containerPublish -bindNode "mainShadingSet" blinn1SG container1;
# query what is bound
#
container -q -bindNode container1;
# unbind the shading group
#
containerPublish -unbindNode "mainShadingSet" container1;

Previous topic

pymel.core.general.containerProxy

Next topic

pymel.core.general.containerTemplate

Core

Core Modules

Other Modules

This Page