ジャンプ先: 概要. 戻り値. 関連. フラグ. Python 例.
parent(
[dagObject...] [dagObject]
, [absolute=boolean], [addObject=boolean], [noConnections=boolean], [noInvScale=boolean], [relative=boolean], [removeObject=boolean], [shape=boolean], [world=boolean])
注: オブジェクトの名前と引数を表す文字列は、カンマで区切る必要があります。これはシノプシスに示されていません。
parent は、取り消し可能、照会不可能、および編集不可能です。
新しいグループのオブジェクトの移動、既存グループからのオブジェクトの除去、親の追加や除去が行われます。-w フラグを指定すると、選択か指定を行ったすべてのオブジェクトがワールドにペアレント化されます(まずペアレント化解除されます)。
-rm フラグを指定すると、選択か指定を行ったインスタンスがすべて除去されます。
複数のオブジェクトを指定すると、すべてのオブジェクトでは、最後に指定したオブジェクトにペアレント化されます。
-add フラグを指定すると、オブジェクトはペアレント化されず、最後に指定したオブジェクトの子になります。
1 つのオブジェクトのみを指定した場合は、選択したオブジェクトがそのオブジェクトにペアレント化されます。
オブジェクトが別のグループでペアレント化され、同じ名前のオブジェクトがそのグループに存在する場合は、このコマンドにより、親になったオブジェクトの名前が変更されます。
| string[] | ペアレント化されたオブジェクトの名前(名前変更の可能性もあります)。 |
| ロング ネーム(ショート ネーム) | 引数タイプ | プロパティ | ||
|---|---|---|---|---|
absolute(a)
|
boolean
|
|
||
|
||||
addObject(add)
|
boolean
|
|
||
|
||||
noConnections(nc)
|
boolean
|
|
||
|
||||
noInvScale(nis)
|
boolean
|
|
||
|
||||
relative(r)
|
boolean
|
|
||
|
||||
removeObject(rm)
|
boolean
|
|
||
|
||||
shape(s)
|
boolean
|
|
||
|
||||
world(w)
|
boolean
|
|
||
|
||||
import maya.cmds as cmds
# Create some objects
cmds.circle( name='circle1' )
cmds.move( 5, 0, 0 )
cmds.group( n='group1' )
cmds.move( -5, 0, 0 )
cmds.group( em=True, n='group2' )
# Move the circle under group2.
# Note that the circle remains where it is.
cmds.parent( 'circle1', 'group2' )
# Let's try that again with the -relative flag. This time
# the circle will move.
cmds.undo()
cmds.parent( 'circle1', 'group2', relative=True )
# Create an instance of the circle using the parent command.
# This makes circle1 a child of group1 and group2.
cmds.undo()
cmds.parent( 'circle1', 'group2', add=True )
# Remove group1 as a parent of the circle
cmds.parent( 'group1|circle1', removeObject=True )
# Move the circle to the top of the hierarchy
cmds.parent( 'group2|circle1', world=True )
# Remove an instance of a shape from a parent
cmds.parent('nurbsSphere3|nurbsSphereShape1',shape=True,rm=True)