ジャンプ先: 概要. 戻り値. キーワード. 関連. フラグ. Python 例.
deleteExtension([attribute=string], [forceDelete=boolean], [nodeType=string])
注: オブジェクトの名前と引数を表す文字列は、カンマで区切る必要があります。これはシノプシスに示されていません。
deleteExtension は、取り消し不可能、照会不可能、および編集不可能です。
このコマンドは、ノード タイプから拡張子アトリビュートを削除するのに使用されます。アトリビュートは、ロング ネームかショート ネームのどちらかを使用して指定できます。一度に削除できる拡張子アトリビュートは 1 つだけです。複合アトリビュートの子は削除できません。その場合、複合アトリビュート全体を削除する必要があります。このコマンドには元に戻す機能、編集機能、照会機能はありません。
attribute, dependency, graph, delete, extension
addAttr, addExtension, aliasAttr, attributeInfo, connectAttr, deleteAttr, disconnectAttr, getAttr, getClassification, nodeType, objExists, objectType, renameAttr, setAttr
attribute, forceDelete, nodeType
| ロング ネーム(ショート ネーム) |
引数タイプ |
プロパティ |
attribute(at)
|
string
|
|
|
アトリビュートのロング ネームかショート ネームを指定します。
|
|
forceDelete(fd)
|
boolean
|
|
|
このフラグを設定してオンにすると、拡張子アトリビュートのすべてのデータ値が確認なしで削除されます。設定してオフにすると、ノードの既定以外の値を設定した拡張子アトリビュートはそのまま保持されます。このフラグを設定しない場合、拡張子アトリビュートの既定以外の値を保持するかどうかが確認されます。
|
|
nodeType(nt)
|
string
|
|
|
|
フラグはコマンドの作成モードで表示できます
|
フラグはコマンドの編集モードで表示できます
|
フラグはコマンドの照会モードで表示できます
|
フラグに複数の引数を指定し、タプルまたはリストとして渡すことができます。
|
import maya.cmds as cmds
cmds.addExtension( nodeType='planet', longName='martians', shortName='mr', attributeType='double' )
cmds.createNode( 'planet', name='jupiter' )
cmds.createNode( 'planet', name='mars' )
cmds.setAttr( 'mars.mr', 35 )
# Delete an extension attribute named mr/martians.
# Only returns 1 since the planet node 'jupiter'
# does not have a non-default value on the extension.
cmds.deleteExtension( nodeType='planet', forceDelete=True, attribute='martians' )
# Return: 1 //
# The attribute is gone since it was forced out
cmds.attributeQuery( type='planet', attribute='mr', query=True, exists=True )
# Return: 0 //
# Re-add and delete the extension again, forcing the
# attribute to remain if non-default values exist.
cmds.addExtension( nodeType='planet', longName='martians', shortName='mr', attributeType='double' )
cmds.setAttr( 'mars.mr', 35 )
cmds.deleteExtension( nodeType='planet', forceDelete=False, attribute='mr' )
# Return: 0 //
# The attribute still exists since it had some non-default values
cmds.attributeQuery( type='planet', attribute='mr', query=True, exists=True )
# Return: 1 //
cmds.attributeQuery( name='jupiter', attribute='mr', query=True, exists=True )
# Return: 1 //