ジャンプ先: 概要. 戻り値. フラグ. Python 例.
listRelatives(
[objects]
, [allDescendents=boolean], [allParents=boolean], [children=boolean], [fullPath=boolean], [noIntermediate=boolean], [parent=boolean], [path=boolean], [shapes=boolean], [type=string])
注: オブジェクトの名前と引数を表す文字列は、カンマで区切る必要があります。これはシノプシスに示されていません。
listRelatives は、取り消し可能、照会不可能、および編集不可能です。
DAG オブジェクトの親と子がリストされます。-c/children フラグ、-ad/allDescendents フラグ、-s/shapes フラグ、-p/parent フラグ、-ap/allParents フラグを同時に指定することはできません。1 つのコマンドでは、このうち 1 つのみを使用できます。
ls とは異なり、このコマンドは一意のパスを返しません。既定で、オブジェクトの名前を返すだけです。一意のパスを取得するには、-path フラグを使用する必要があります。
ワールドのすぐ下でオブジェクトの親をリストすると、このコマンドは空の親リストを返します。シェイプのすぐ下でオブジェクト(アンダーワールド オブジェクト)の親をリストすると、親のリストに含まれるシェイプ ノードが返されます。オブジェクトのコンポーネントの親をリストすると、そのオブジェクトが返されます。
子をリストする場合、シェイプ ノードでは、子のリストでアンダーワールド オブジェクトが返されます。オブジェクトのコンポーネントの子をリストしても、何も返されません。
-ni/noIntermediate フラグは -s/shapes フラグとともに動作します。このフラグを使用すると、派生するものの中間シェイプが無視されます。
string[] | コマンドの結果 |
ロング ネーム(ショート ネーム) | 引数タイプ | プロパティ | ||
---|---|---|---|---|
allDescendents(ad)
|
boolean
|
![]() |
||
|
||||
allParents(ap)
|
boolean
|
![]() |
||
|
||||
children(c)
|
boolean
|
![]() |
||
|
||||
fullPath(f)
|
boolean
|
![]() |
||
|
||||
noIntermediate(ni)
|
boolean
|
![]() |
||
|
||||
parent(p)
|
boolean
|
![]() |
||
|
||||
path(pa)
|
boolean
|
![]() |
||
|
||||
shapes(s)
|
boolean
|
![]() |
||
|
||||
type(typ)
|
string
|
![]() ![]() |
||
|
![]() |
![]() |
![]() |
![]() |
import maya.cmds as cmds # create an object and an instance for queries cmds.sphere( n='nexus' ) cmds.instance( n='ball' ) # List the name of the shape below the transform node. shapes = cmds.listRelatives('nexus') # list all parents of shape # (The result of the command is shown) cmds.listRelatives( shapes[0], allParents=True ) # Result:[u'nexus', u'ball'] #