ジャンプ先: 概要. 戻り値. 関連. フラグ. Python 例.
container(
[string...]
, [addNode=string[]], [asset=string[]], [assetMember=string], [bindAttr=[string, string]], [connectionList=boolean], [current=boolean], [fileName=string[]], [findContainer=string[]], [force=boolean], [includeHierarchyAbove=boolean], [includeHierarchyBelow=boolean], [includeNetwork=boolean], [includeNetworkDetails=string], [includeShaders=boolean], [includeShapes=boolean], [includeTransform=boolean], [isContainer=boolean], [name=string], [nodeList=boolean], [nodeNamePrefix=boolean], [parentContainer=boolean], [preview=boolean], [publishAndBind=[string, string]], [publishAsChild=[string, string]], [publishAsParent=[string, string]], [publishAsRoot=[string, boolean]], [publishAttr=string], [publishConnections=boolean], [publishName=string], [removeContainer=boolean], [removeNode=string[]], [type=string], [unbindAndUnpublish=string], [unbindAttr=[string, string]], [unbindChild=string], [unbindParent=string], [unpublishChild=string], [unpublishName=string], [unpublishParent=string], [unsortedOrder=boolean])
注: オブジェクトの名前と引数を表す文字列は、カンマで区切る必要があります。これはシノプシスに示されていません。
container は、取り消し可能、照会可能、および編集可能です。
このコマンドは、コンテナ ノードの作成と照会に使用できます。また次のような、コンテナに対する操作にも使用します。
- コンテナに対するノードの追加と除去
- コンテナ内のノードからの、アトリビュートのパブリッシュ
- 1 つのコンテナから別のコンテナへの、接続と値の置き換え
- コンテナのメンバー ノードを除去しない、コンテナの除去
照会モードでは、戻り値のタイプは照会されたフラグに基づきます。
containerProxy, containerPublish, containerTemplate, containerView, copyAttr
addNode, asset, assetMember, bindAttr, connectionList, current, fileName, findContainer, force, includeHierarchyAbove, includeHierarchyBelow, includeNetwork, includeNetworkDetails, includeShaders, includeShapes, includeTransform, isContainer, name, nodeList, nodeNamePrefix, parentContainer, preview, publishAndBind, publishAsChild, publishAsParent, publishAsRoot, publishAttr, publishConnections, publishName, removeContainer, removeNode, type, unbindAndUnpublish, unbindAttr, unbindChild, unbindParent, unpublishChild, unpublishName, unpublishParent, unsortedOrder
フラグはコマンドの作成モードで表示できます
|
フラグはコマンドの編集モードで表示できます
|
フラグはコマンドの照会モードで表示できます
|
フラグに複数の引数を指定し、タプルまたはリストとして渡すことができます。
|
import maya.cmds as cmds
# Create a container holding a locator transform only (not its shape)
#
loc = cmds.spaceLocator()
con1 = cmds.container(addNode=[loc[0]])
# Select the nodes that would be in the container, but don't create it
#
cmds.container(preview=True,addNode=[cone[0]],includeNetwork=True,includeHierarchyBelow=True)
# Create a container holding a polygon shape, its transform and its
# history node. Publish its tx attr.
#
cone = cmds.polyCone()
con2 = cmds.container(addNode=[cone[0]],includeNetwork=True,includeHierarchyBelow=True)
# Publish the cone's tx and the locator's tx with the same name
#
cmds.container(con1,edit=True,publishName='main_tx')
cmds.container(con1,edit=True,bindAttr=['%s.tx' % loc[0],'main_tx'])
cmds.container(con2,edit=True,publishName='main_tx')
cmds.container(con2,edit=True,bindAttr=['%s.tx' % cone[0],'main_tx'])
# Publish the name "sam", but don't bind it to anything
#
cmds.container(con1,edit=True,publishName='sam')
# Query the bound publications
#
cmds.container(con1,query=True,bindAttr=1)
# Result: [u'locator1.translateX', u'main_tx'] #
# Query all the published names:
#
cmds.container(con1,query=True,publishName=1)
# Result: [u'main_tx' u'sam'] #
# Query just the bound published names:
#
cmds.container(con1,query=True,publishName=1,bindAttr=1)
# Result: [u'main_tx'] #
# Query just the unbound published names:
#
cmds.container(con1,query=True,publishName=1,unbindAttr=1)
# Result: [u'sam'] #
# Query just the published name for the published attribute locator1.translateX
#
cmds.container(con1,query=True,publishName=1,publishAttr='locator1.translateX')
# Result: [u'main_tx'] #
# keyframe the cone's tx
#
cmds.currentTime(0)
coneTx = '%s.tx' % cone[0]
cmds.setKeyframe(coneTx)
cmds.currentTime(4)
cmds.setAttr(coneTx,10.0)
cmds.setKeyframe(coneTx)
# Query the nodes in the container
#
nodes = cmds.container(con2,query=True,nodeList=True)
# Remove a node from the container
#
cmds.container(con2,edit=True,removeNode=nodes[2])
# Remove the container without deleting the nodes within it
#
cmds.container(con2,edit=True,removeContainer=True)
# query a referenced scenes for its assets
#
cmds.container(q=True,fileName='C:/My Documents/maya/projects/default/scenes/refFile.mb')