移動先: 概要 戻り値 フラグ. Python 例.

概要

inheritTransform( [objects...] , [preserve=boolean], [toggle=boolean])

注意: オブジェクト名や引数を表す文字列はカンマで区切ります。これは概要には示されていません。

inheritTransform は 「元に戻す」が可能、「照会」が可能、「編集」が不可能 です。

これは、オブジェクトの継承状態を切り替えるためのコマンドです。このフラグがオフの場合、オブジェクトは親から変換を継承しません。すなわち、オブジェクトは、親ノードに適用された変換による影響を受けず、ワールドの下にあるような動作をします。

-p フラグが指定されている場合、オブジェクトのワールド空間の位置が変更されないように継承フラグを変更したときに、オブジェクトの変換が修正、補正されます。

戻り値

なし

戻り値の型は照会モードでは照会フラグが基になります。

フラグ

preserve, toggle
ロング ネーム(ショート ネーム) 引数型 プロパティ
toggle(tgl) boolean createquery
指定したオブジェクトの継承状態を切り替えます。これはフラグが何も指定されていない場合のデフォルトです。 -on 指定したオブジェクトの継承状態をオンにします。 -off 指定したオブジェクトの継承状態をオフにします。
preserve(p) boolean createquery
オブジェクトの変換待ち行列を修正して、このオブジェクトのワールド空間位置を保持します。

: コマンドの作成モードで使用可能なフラグ : コマンドの編集モードで使用可能なフラグ
: コマンドの照会モードで使用可能なフラグ : タプルまたはリストとして渡された複数の引数を持てるフラグ

Python 例

import maya.cmds as cmds

# create an circle, move it off center, group it
# and move the group so that the circle is back in center
cmds.circle( nr=(0, 1, 0), n='circle1' )
cmds.move( 2, 0, 0 )
cmds.group()
cmds.move( -2, 0, 0 )

# turn off inherits transform flag of circle1.
# The circle will now appear at (2, 0, 0)
cmds.inheritTransform( 'circle1', off=True )

# turn off inherits transform flag of circle1 but preserve the
# position of the circle. The circle will stay centered at (0, 0, 0)
cmds.inheritTransform( 'circle1', on=True )
cmds.inheritTransform( 'circle1', off=True, preserve=True )

# query state of inherits transform flag
cmds.inheritTransform( 'circle1', q=True )