移動先: 概要 戻り値 キーワード. 関連項目. フラグ. Python 例.
containerTemplate([addNames=boolean], [addView=string], [attributeList=string], [baseName=string], [delete=boolean], [exists=boolean], [expandCompounds=boolean], [fileName=string], [force=boolean], [fromContainer=string], [layoutMode=int], [load=boolean], [matchFile=string], [matchName=string], [removeView=string], [save=boolean], [searchPath=string], [silent=boolean], [templateList=string], [unload=boolean], [viewList=string])
注意: オブジェクト名や引数を表す文字列はカンマで区切ります。これは概要には示されていません。
containerTemplate は 「元に戻す」が不可能、「照会」が可能、「編集」が可能 です。
コンテナ テンプレートは、コンテナのパブリッシュされたインタフェースの説明です。このコマンドは、コンテナのテンプレート ファイルを作成して保存したり、既存のテンプレート ファイルをロードしたりする機能を提供します。テンプレートが存在する限り、ユーザはそのテンプレート情報を照会できます。
なし
戻り値の型は照会モードでは照会フラグが基になります。
container, template
container, containerView
addNames, addView, attributeList, baseName, delete, exists, expandCompounds, fileName, force, fromContainer, layoutMode, load, matchFile, matchName, removeView, save, searchPath, silent, templateList, unload, viewList
: コマンドの作成モードで使用可能なフラグ
|
: コマンドの編集モードで使用可能なフラグ
|
: コマンドの照会モードで使用可能なフラグ
|
: タプルまたはリストとして渡された複数の引数を持てるフラグ
|
import maya.cmds as cmds
# Create a container template.
#
cmds.containerTemplate( 'characterRig' )
# Create a container template using the published attribute information from
# container1.
cmds.containerTemplate ( 'characterRig', fromContainer='container1');
#
# Save the template to a template file in the default template location.
cmds.containerTemplate -save characterRig;
# Load a template (the template is located along the template search path)
cmds.containerTemplate ('characterRig', load=True);
# Re-load a template that has already been loaded
# This is useful if you have made edits to the template outside of maya
cmds.containerTemplate ('characterRig', force=True, load=True);
# Determine the file that a template was loaded from
cmds.containerTemplate ('characterRig', query=True, fileName=True);
# Result: C:/myTemplates/characterRig.template #
#
# Add a view to a container template. This view will be generated from the
# given container, and will use a group-by-node hierarchical layout.
# The view can be subesequently customized if desired.
#
cmds.containerTemplate('characterRig', edit=True, addView='newView', fromContainer='container1', layoutMode=1)
cmds.containerTemplate ('characterRig', save=True)
#
# Add another view to a container template.
# This view will be generated with a default layout and can be
# subsequently customized.
#
cmds.containerTemplate ('characterRig', edit=True, addView="newView2")
cmds.containerTemplate ('characterRig', save=True)
#
# Get the list of attributes in the template. This will return
# a flat list of attribute names in the order in which they appear
# in the template definition.
#
cmds.containerTemplate ('characterRig', query=True, attributeList=True)
# Result: [u'attribute1', u'attribute2', u'attribute3'] #
#
# List all loaded templates
list = cmds.containerTemplate(query=True, templateList=True);
# Result: [u'Object', u'characterRig'] #
#
# List all templates matching a a given template name
# Note that all templates with matching base name (in any package) will
# be returned.
cmds.containerTemplate (query=True, templateList=True, matchName='characterRig')
# Result: [u'characterRig'] #
#