移動先: 概要 戻り値 フラグ. Python 例.
manipMoveContext(
[object]
, [activeHandle=int], [activeHandleNormal=int], [alignAlong=[float, float, float]], [editPivotMode=boolean], [editPivotPosition=boolean], [interactiveUpdate=boolean], [mode=int], [orientAxes=[float, float, float]], [orientTowards=[float, float, float]], [position=boolean], [postCommand=script], [postDragCommand=[script, string]], [preCommand=script], [preDragCommand=[script, string]], [preserveChildPosition=boolean], [preserveUV=boolean], [reflection=boolean], [reflectionAbout=int], [reflectionAxis=int], [reflectionTolerance=float], [snap=boolean], [snapComponentsRelative=boolean], [snapLiveFaceCenter=boolean], [snapLivePoint=boolean], [snapRelative=boolean], [snapValue=float])
注意: オブジェクト名や引数を表す文字列はカンマで区切ります。これは概要には示されていません。
manipMoveContext は 「元に戻す」が可能、「照会」が可能、「編集」が可能 です。
移動マニピュレータ コンテキストの作成、編集、照会を実行するときに使用します。フラグ -s、-sv、-sr、-scr、-slp、-sl で、すべての移動マニピュレータ コンテキストのグローバルな動作を制御します。コンテキストを独自に変更することはできません。上記のフラグを使ってコンテキストの動作を変更すると、既存の移動マニピュレータ コンテキストがすべて変更されます。
戻り値の型は照会モードでは照会フラグが基になります。
activeHandle, activeHandleNormal, alignAlong, editPivotMode, editPivotPosition, interactiveUpdate, mode, orientAxes, orientTowards, position, postCommand, postDragCommand, preCommand, preDragCommand, preserveChildPosition, preserveUV, reflection, reflectionAbout, reflectionAxis, reflectionTolerance, snap, snapComponentsRelative, snapLiveFaceCenter, snapLivePoint, snapRelative, snapValue
| ロング ネーム(ショート ネーム) |
引数型 |
プロパティ |
mode(m)
|
int
|

|
|
移動モード:
- 0 - オブジェクト空間
- 1 - ローカル空間
- 2 - ワールド空間(デフォルト)
- 3 - 頂点法線に沿って移動
- 4 - 回転軸に沿って移動
- 5 - ライブ オブジェクト軸に沿って移動
- 6 - カスタム軸方向
|
|
activeHandle(ah)
|
int
|

|
|
次の値を指定することができます。
- 0(X 軸ハンドルがアクティブ)、
- 1(Y 軸ハンドルがアクティブ)、
- 2(Z 軸ハンドルがアクティブ)、
- 3(中央ハンドル(3 つすべての軸)がアクティブ(デフォルト))です。
|
|
position(p)
|
boolean
|
|
|
|
editPivotPosition(epp)
|
boolean
|
|
|
ピボットの編集マニピュレータの現在位置を返します。
|
|
orientAxes(oa)
|
[float, float, float]
|

|
|
軸を中心に回転するマニピュレータの向きを指定した角度だけ変えます。
|
|
orientTowards(ot)
|
[float, float, float]
|

|
|
アクティブ ハンドルをワールド ポイント方向へ向けます。
|
|
alignAlong(aa)
|
[float, float, float]
|

|
|
|
interactiveUpdate(iu)
|
boolean
|

|
|
次の値を指定することができます。true または false です。
このフラグ値は、モードが 3(頂点法線移動)の場合に限って有効です。
|
|
activeHandleNormal(ahn)
|
int
|

|
|
- 0(U 軸ハンドルがアクティブ)、
- 1(V 軸ハンドルがアクティブ)、
- 2(N 軸ハンドルがアクティブ(デフォルト))、
- 3(中央ハンドル(3
つすべての軸)がアクティブ)。マニピュレータ モードが 3 の場合に限って適用されます。
|
|
snap(s)
|
boolean
|

|
|
次の値を指定することができます。true または false です。
個々の移動の可否を指定します。
true に設定すると、すべての移動コンテキストの移動マニピュレータは、マウスをドラッグしたとき、アクティブ ハンドルと一緒に個々のポイントにスナップされます。ポイントの間隔は、snapValue フラグを使用して制御できます。
|
|
preserveChildPosition(pcp)
|
boolean
|

|
|
false の場合は、親が移動したときに子オブジェクトも移動します。true の場合は、親が移動しても子のワールド空間位置は維持されます。デフォルトは false です。
|
|
preserveUV(puv)
|
boolean
|

|
|
false の場合、uv は頂点の編集に合わせて変更されません
true の場合、頂点の移動につれてテクスチャがずれるのを止めるため、新しい値を投影するように uv が編集されます。
|
|
snapValue(sv)
|
float
|

|
|
スナップが有効な場合にのみ適用されます。
すべての移動コンテキストのマニピュレータが、「snapValue」のステップに移動します。
|
|
snapRelative(sr)
|
boolean
|

|
|
次の値を指定することができます。true または false です。
スナップが有効な場合にのみ適用されます。
true に設定すると、snapValue は移動前の元の位置に相対的に扱われます。
false に設定すると、snapValue はワールド空間の原点に相対的に扱われます。
注:
ローカル空間モードおよびオブジェクト空間モードでは、snapRelative を ON に設定する必要があります。
絶対的な個別移動は、ローカル モードおよびオブジェクト モードではサポートされていません。
|
|
snapComponentsRelative(scr)
|
boolean
|

|
|
次の値を指定することができます。true または false です。
true に設定すると、制御点や頂点のグループをスナップする間、その相対的な間隔が保持されます。
false に設定すると、すべての CV や頂点がターゲット ポイントにスナップされます(グリッド スナップ(ホットキー「x」)およびポイント スナップ(ホットキー「v」)で使用)。「x」キーを押した後マニピュレータ ハンドルをクリック&ドラッグし、このフラグの ON、OFF を切り替えて、一連の CV の移動の動作を確認します。
|
|
snapLivePoint(slp)
|
boolean
|

|
|
次の値を指定することができます。true または false です。
true に設定すると、有効なポリゴン オブジェクト上で移動する間、移動マニピュレータはオブジェクトの頂点にスナップされます。
|
|
snapLiveFaceCenter(slf)
|
boolean
|

|
|
次の値を指定することができます。true または false です。
true に設定すると、有効なポリゴン オブジェクト上で移動する間、移動マニピュレータはオブジェクトのフェースの中心にスナップされます。
|
|
reflection(rfl)
|
boolean
|
|
|
このフラグは現在サポートしていません。対称(Reflection)は、symmetricModeling コマンドを使用した選択自体の一部として管理されます。
|
|
reflectionAbout(rab)
|
int
|
|
|
このフラグは現在サポートしていません。対称(Reflection)は、symmetricModeling コマンドを使用した選択自体の一部として管理されます。
|
|
reflectionAxis(rfa)
|
int
|
|
|
このフラグは現在サポートしていません。対称(Reflection)は、symmetricModeling コマンドを使用した選択自体の一部として管理されます。
|
|
reflectionTolerance(rft)
|
float
|
|
|
このフラグは現在サポートしていません。対称(Reflection)は、symmetricModeling コマンドを使用した選択自体の一部として管理されます。
|
|
preCommand(prc)
|
script
|
|
|
ツールを開始したときに実行されるコマンドを指定します。
|
|
postCommand(psc)
|
script
|
|
|
ツールを終了したときに実行されるコマンドを指定します。
|
|
preDragCommand(prd)
|
[script, string]
|

|
|
コマンドおよびノード タイプを指定します。このコマンドは、指定されたタイプのノードが選択範囲内に入っているときに、ドラッグを開始すると実行されます。
|
|
postDragCommand(pod)
|
[script, string]
|

|
|
コマンドおよびノード タイプを指定します。このコマンドは、指定されたタイプのノードが選択範囲内に入っているときに、ドラッグを終了すると実行されます。
|
|
editPivotMode(epm)
|
boolean
|
|
|
マニピュレータが編集ピボット モードにある場合は true を返します。
|
|
: コマンドの作成モードで使用可能なフラグ
|
: コマンドの編集モードで使用可能なフラグ
|
: コマンドの照会モードで使用可能なフラグ
|
: タプルまたはリストとして渡された複数の引数を持てるフラグ
|
import maya.cmds as cmds
# To create a new move context:
cmds.manipMoveContext()
# To query the mode of an existing context:
cmds.manipMoveContext( 'manipMoveContext1', q=True, mode=True )
# To edit an existing context to come up with the X axis handle
# active by default:
cmds.manipMoveContext( 'manipMoveContext1', e=True, ah=0 )
cmds.spaceLocator( p=(0, 0, 0), name='locatorA' )
cmds.manipMoveContext( 'manipMoveContext1', e=True, m=2 ) # WorldSpace
cmds.manipMoveContext( 'manipMoveContext1', e=True, snap=True )
cmds.manipMoveContext( 'manipMoveContext1', e=True, snapValue=0.4 )
# Now, dragging any of the move handles will
# move the object in steps of 0.4 units.
cmds.move( 0.8, 0, 0, 'locatorA', a=True )
cmds.manipMoveContext( 'manipMoveContext1', e=True, snap=True )
cmds.manipMoveContext( 'manipMoveContext1', e=True, snapValue=2 )
cmds.manipMoveContext( 'manipMoveContext1', e=True, snapRelative=False )
# Now, dragging X-axis handle will
# move the object in steps of 2 units, and will
# place the object anywhere in (0,0,0) (2,0,0) (4,0,0) ...etc
# NOTE: If in objectSpace Mode, the snapRelative should be ON.
# Absolute discrete move is not supported in objectSpace mode.
cmds.move( 0.8, 0, 0, 'locatorA', a=True )
cmds.manipMoveContext( 'manipMoveContext1', e=True, snap=True )
cmds.manipMoveContext( 'manipMoveContext1', e=True, snapValue=2 )
cmds.manipMoveContext( 'manipMoveContext1', e=True, snapRelative=True )
# Now, dragging X-axis handle will
# move the object in steps of 2 units, and will
# place the object anywhere in (2.8,0,0) (4.8,0,0) (6.8,0,0) ...etc