ジャンプ先: 概要. 戻り値. キーワード. 関連. フラグ. Python 例.
attributeQuery([affectsAppearance=boolean], [affectsWorldspace=boolean], [attributeType=boolean], [cachedInternally=boolean], [categories=boolean], [channelBox=boolean], [connectable=boolean], [enum=boolean], [exists=boolean], [hidden=boolean], [indeterminant=boolean], [indexMatters=boolean], [internal=boolean], [internalGet=boolean], [internalSet=boolean], [keyable=boolean], [listChildren=boolean], [listDefault=boolean], [listEnum=boolean], [listParent=boolean], [listSiblings=boolean], [longName=boolean], [maxExists=boolean], [maximum=boolean], [message=boolean], [minExists=boolean], [minimum=boolean], [multi=boolean], [niceName=boolean], [node=name], [numberOfChildren=boolean], [range=boolean], [rangeExists=boolean], [readable=boolean], [renderSource=boolean], [shortName=boolean], [softMax=boolean], [softMaxExists=boolean], [softMin=boolean], [softMinExists=boolean], [softRange=boolean], [softRangeExists=boolean], [storable=boolean], [type=string], [typeExact=string], [usedAsColor=boolean], [usedAsFilename=boolean], [usesMultiBuilder=boolean], [worldspace=boolean], [writable=boolean])
注: オブジェクトの名前と引数を表す文字列は、カンマで区切る必要があります。これはシノプシスに示されていません。
attributeQuery は、取り消し不可能、照会不可能、および編集不可能です。
attributeQuery は、アトリビュートの構成に関する情報を返します。両方のブーリアン フラグを処理し、他の戻り値と同様に true または false を返します。複数のブーリアン フラグを指定すると、指定したすべてのブーリアン フラグの論理和を返します。両方がブーリアン タイプの戻り値を返すのでなければ、2 つのフラグを指定することはできません。(たとえば、「-internal -hidden」は指定できますが、「-range -hidden」や「-range -softRange」は指定できません)。float[] | 範囲または既定値を照会する場合 |
boolean | アトリビュート フラグを照会する場合 |
ロング ネーム(ショート ネーム) | 引数タイプ | プロパティ | ||
---|---|---|---|---|
affectsAppearance(aa)
|
boolean
|
![]() |
||
|
||||
affectsWorldspace(aws)
|
boolean
|
![]() |
||
|
||||
attributeType(at)
|
boolean
|
![]() |
||
|
||||
cachedInternally(ci)
|
boolean
|
![]() |
||
|
||||
categories(ct)
|
boolean
|
![]() |
||
|
||||
channelBox(ch)
|
boolean
|
![]() |
||
|
||||
connectable(c)
|
boolean
|
![]() |
||
|
||||
enum(e)
|
boolean
|
![]() |
||
|
||||
exists(ex)
|
boolean
|
![]() |
||
|
||||
hidden(h)
|
boolean
|
![]() |
||
|
||||
indeterminant(idt)
|
boolean
|
![]() |
||
|
||||
indexMatters(im)
|
boolean
|
![]() |
||
|
||||
internal(i)
|
boolean
|
![]() |
||
|
||||
internalGet(ig)
|
boolean
|
![]() |
||
|
||||
internalSet(internalSet)
|
boolean
|
![]() |
||
|
||||
keyable(k)
|
boolean
|
![]() |
||
|
||||
listChildren(lc)
|
boolean
|
![]() |
||
|
||||
listDefault(ld)
|
boolean
|
![]() |
||
|
||||
listEnum(le)
|
boolean
|
![]() |
||
|
||||
listParent(lp)
|
boolean
|
![]() |
||
|
||||
listSiblings(ls)
|
boolean
|
![]() |
||
|
||||
longName(ln)
|
boolean
|
![]() |
||
|
||||
maxExists(mxe)
|
boolean
|
![]() |
||
|
||||
maximum(max)
|
boolean
|
![]() |
||
|
||||
message(msg)
|
boolean
|
![]() |
||
|
||||
minExists(mne)
|
boolean
|
![]() |
||
|
||||
minimum(min)
|
boolean
|
![]() |
||
|
||||
multi(m)
|
boolean
|
![]() |
||
|
||||
niceName(nn)
|
boolean
|
![]() |
||
|
||||
node(n)
|
name
|
![]() |
||
|
||||
numberOfChildren(nc)
|
boolean
|
![]() |
||
|
||||
range(r)
|
boolean
|
![]() |
||
|
||||
rangeExists(re)
|
boolean
|
![]() |
||
|
||||
readable(rd)
|
boolean
|
![]() |
||
|
||||
renderSource(rs)
|
boolean
|
![]() |
||
|
||||
shortName(sn)
|
boolean
|
![]() |
||
|
||||
softMax(smx)
|
boolean
|
![]() |
||
|
||||
softMaxExists(sxe)
|
boolean
|
![]() |
||
|
||||
softMin(smn)
|
boolean
|
![]() |
||
|
||||
softMinExists(sme)
|
boolean
|
![]() |
||
|
||||
softRange(s)
|
boolean
|
![]() |
||
|
||||
softRangeExists(se)
|
boolean
|
![]() |
||
|
||||
storable(st)
|
boolean
|
![]() |
||
|
||||
type(typ)
|
string
|
![]() |
||
|
||||
typeExact(tex)
|
string
|
![]() |
||
|
||||
usedAsColor(uac)
|
boolean
|
![]() |
||
|
||||
usedAsFilename(uaf)
|
boolean
|
![]() |
||
|
||||
usesMultiBuilder(umb)
|
boolean
|
![]() |
||
|
||||
worldspace(ws)
|
boolean
|
![]() |
||
|
||||
writable(w)
|
boolean
|
![]() |
||
|
![]() |
![]() |
![]() |
![]() |
import maya.cmds as cmds # Determine the hidden status of the "selector" attribute on choice nodes. # cmds.attributeQuery( 'selector', typ='choice', h=True ) # Result: 0 # Determine the hidden status of the "selector" attribute on this choice node. # (Usually the same but you can do this for dynamic attributes too.) # cmds.createNode( 'choice', n='whoIsIt' ) # Result: choice1 cmds.attributeQuery( 'selector', n='whoIsIt', h=True ) # Result: 0 # Determine the range of the selector value on choice nodes. # In this case there is no range. # Note, if there is only a minimum or only a maximum range will not set. # cmds.attributeQuery( 'selector', typ='choice', range=True ) # For the next several examples create a poly cube and add extra attributes. cmds.polyCube( cuv=4, ch=1, w=1, h=1, d=1, sx=1, sy=1, sz=1, ax=(0, 1, 0) ) cmds.addAttr( '|pCube1', ln='egRange', at='long', min=0, max=5, dv=2 ) cmds.setAttr( '|pCube1.egRange', e=True, keyable=False ) # Determine if an attribute is keyable # cmds.attributeQuery( 'egRange', node='pCube1', k=True ) # Result: 0 # Determine the minimum and maximum values of the added attribute egRange # cmds.attributeQuery( 'egRange', node='pCube1', range=True ) # Result: [0.0, 5.0] # Determine if there is a minimum for the attribute. # Note, having a minimum or maximum value does not imply the attribute has a range. cmds.addAttr( '|pCube1', ln='egMin', at='long', min=2 ) cmds.attributeQuery( 'egMin', node='pCube1', minExists=True ) # Result: 1 cmds.attributeQuery( 'egMin', node='pCube1', maxExists=True ) # Result: 0 cmds.attributeQuery( 'egMin', node='pCube1', min=True ) # Result: [2.0] # Determine if an attribute is an enum # List the enum strings. This will use ':' as a separator like the attr is written in # an .ma file. cmds.addAttr( '|pCube1', ln='myEnum', at='enum', en='chicken:turkey:duck:', ct='fowl' ) cmds.attributeQuery( 'myEnum', node='pCube1', listEnum=True ) # Result: [u'chicken:turkey:duck'] # # Secondary way to find an attribute's type directly cmds.attributeQuery( 'myEnum', node='pCube1', attributeType=True ) # Result: ['enum'] # # See to which categories and attribute belongs cmds.attributeQuery( 'myEnum', node='pCube1', categories=True ) # Result: ['fowl'] #