ジャンプ先: 概要. 戻り値. フラグ. Python 例.

概要

manipMoveContext( [object] , [activeHandle=int], [activeHandleNormal=int], [alignAlong=[float, float, float]], [autoOrientSecondaryAxis=boolean], [bakePivotOri=boolean], [constrainAlongNormal=boolean], [currentActiveHandle=int], [editPivotMode=boolean], [editPivotPosition=boolean], [exists=boolean], [image1=string], [image2=string], [image3=string], [interactiveUpdate=boolean], [lastMode=int], [manipVisible=boolean], [mode=int], [orientAxes=[float, float, float]], [orientJoint=string], [orientJointEnabled=boolean], [orientObject=string], [orientTowards=[float, float, float]], [pinPivot=boolean], [pivotOriHandle=boolean], [position=boolean], [postCommand=script], [postDragCommand=[script, string]], [preCommand=script], [preDragCommand=[script, string]], [preserveChildPosition=boolean], [preserveUV=boolean], [reflection=boolean], [reflectionAbout=int], [reflectionAxis=int], [reflectionTolerance=float], [resetPivotMode=int], [secondaryAxisOrient=string], [snap=boolean], [snapComponentsRelative=boolean], [snapLiveFaceCenter=boolean], [snapLivePoint=boolean], [snapPivotOri=boolean], [snapPivotPos=boolean], [snapRelative=boolean], [snapValue=float], [translate=[float, float, float]], [tweakMode=boolean], [xformConstraint=string])

注: オブジェクトの名前と引数を表す文字列は、カンマで区切る必要があります。これはシノプシスに示されていません。

manipMoveContext は、取り消し可能、照会可能、および編集可能です。

移動マニピュレータ コンテキストの作成、編集、照会を実行するときに使用します。フラグ -s、-sv、-sr、-scr、-slp、-sl で、すべての移動マニピュレータ コンテキストのグローバルな動作を制御します。コンテキストを独自に変更することはできません。上記のフラグを使ってコンテキストの動作を変更すると、既存の移動マニピュレータ コンテキストがすべて変更されます。

戻り値

string新しいコンテキストの名前

照会モードでは、戻り値のタイプは照会されたフラグに基づきます。

フラグ

activeHandle, activeHandleNormal, alignAlong, autoOrientSecondaryAxis, bakePivotOri, constrainAlongNormal, currentActiveHandle, editPivotMode, editPivotPosition, exists, image1, image2, image3, interactiveUpdate, lastMode, manipVisible, mode, orientAxes, orientJoint, orientJointEnabled, orientObject, orientTowards, pinPivot, pivotOriHandle, position, postCommand, postDragCommand, preCommand, preDragCommand, preserveChildPosition, preserveUV, reflection, reflectionAbout, reflectionAxis, reflectionTolerance, resetPivotMode, secondaryAxisOrient, snap, snapComponentsRelative, snapLiveFaceCenter, snapLivePoint, snapPivotOri, snapPivotPos, snapRelative, snapValue, translate, tweakMode, xformConstraint
ロング ネーム(ショート ネーム) 引数タイプ プロパティ
activeHandle(ah) int queryedit
マニピュレータの既定のアクティブ ハンドルを設定します。つまり、ツールを有効にしたとき最初にアクティブにするハンドルです。次の値を指定することができます。
  • 0 - X 軸ハンドルがアクティブ
  • 1 - Y 軸ハンドルがアクティブ
  • 2 - Z 軸ハンドルがアクティブ
  • 3 - 中央ハンドル(3 つすべての軸)がアクティブ(既定)
activeHandleNormal(ahn) int queryedit
  • 0 - U 軸ハンドルがアクティブ
  • 1 - V 軸ハンドルがアクティブ
  • 2 - N 軸ハンドルがアクティブ(既定)
  • 3 - 中央ハンドル(3 つすべての軸)がアクティブ
マニピュレータ モードが 3 の場合に限って適用されます。
alignAlong(aa) [float, float, float] createedit
アクティブ ハンドルをベクトルに沿って揃えます。
autoOrientSecondaryAxis(aos) boolean queryedit
このフラグは -sao/secondaryAxisOrient フラグと一緒に使用します。このフラグが有効な場合、補助軸は、隣接するジョイントによって定義され、補助軸と同じ方向を指すプレーンを使用して方向が設定されます。そのようなプレーンが存在しない場合、ジョイントは補助軸のみを使用して方向が設定されます。
bakePivotOri(bpo) boolean queryedit
ピボット方向をベイク処理します。ピボット方向の変更をトランスフォーム階層/ジオメトリに自動的にベイク処理します。
constrainAlongNormal(xn) boolean queryedit
true の場合は、最初に頂点法線方向にトランスフォーム コンストレイントが適用されます。法線方向に交差が検出されなかった場合は、最近接ポイントのみが使用されます。
currentActiveHandle(cah) int queryedit
マニピュレータのアクティブ ハンドルを設定します。次の値を指定することができます。
  • 0 - X 軸ハンドルがアクティブ
  • 1 - Y 軸ハンドルがアクティブ
  • 2 - Z 軸ハンドルがアクティブ
  • 3 - 中央ハンドル(3 つすべての軸)がアクティブ
  • 4 - XY 平面ハンドルがアクティブ
  • 5 - YZ 平面ハンドルがアクティブ
  • 6 - XZ 平面ハンドルがアクティブ
editPivotMode(epm) boolean query
マニピュレータが編集ピボット モードにある場合は true を返します。
editPivotPosition(epp) boolean query
編集ピボット マニピュレータの現在位置を返します。
exists(ex) boolean create
指定したオブジェクトが存在するかどうかによって、true または false を返します。他のフラグは無視されます。
image1(i1) string createqueryedit
コンテキストに関連付けられているツールを表す 3 つの可能なアイコンの中の最初のアイコンです。
image2(i2) string createqueryedit
コンテキストに関連付けられているツールを表す 3 つの可能なアイコンの中の 2 番目のアイコンです。
image3(i3) string createqueryedit
コンテキストに関連付けられているツールを表す 3 つの可能なアイコンの中の 3 番目のアイコンです。
interactiveUpdate(iu) boolean queryedit
指定できる値は true または false です。このフラグ値は、モードが 3 (頂点法線移動)の場合に限って有効です。
lastMode(lm) int query
前の移動モードを返します。
manipVisible(vis) boolean query
メインの移動マニピュレータが表示されている場合は true を返します。
mode(m) int queryedit
移動モード:
  • 0 - オブジェクト空間
  • 1 - ローカル空間
  • 2 - ワールド空間(既定)
  • 3 - 頂点法線に沿って移動
  • 4 - 回転軸に沿って移動
  • 5 - ライブ オブジェクト軸に沿って移動
  • 6 - カスタム軸方向
  • 10 - コンポーネント空間
orientAxes(oa) [float, float, float] queryedit
軸を中心に回転するマニピュレータの向きを指定した角度だけ変えます。
orientJoint(oj) string queryedit
ジョイントの方向のタイプを指定します。有効なオプションは、none、xyz、xzy、yxz、yzx、zxy、zyxです。
orientJointEnabled(oje) boolean queryedit
移動時にジョイントの方向を再設定するかどうかを指定します。
orientObject(oo) string createedit
マニピュレータを、渡されたオブジェクト/コンポーネントの方向に位置合わせします。
orientTowards(ot) [float, float, float] createedit
アクティブ ハンドルをワールド ポイント方向へ向けます。
pinPivot(pin) boolean queryedit
コンポーネント ピボットを固定します。コンポーネント ピボットが設定され、固定されると、選択項目の変更によってピボットの位置と方向がリセットされなくなります。
pivotOriHandle(poh) boolean queryedit
true の場合は、編集中にピボット マニピュレータは方向ハンドルを表示します。既定は true です。
position(p) boolean query
マニピュレータの現在位置を返します。
postCommand(psc) script createedit
ツールを終了したときに実行されるコマンドを指定します。
postDragCommand(pod) [script, string] createedit
コマンドおよびノード タイプを指定します。このコマンドは、指定されたタイプのノードが選択範囲内に入っているときに、ドラッグを終了すると実行されます。
preCommand(prc) script createedit
ツールを開始したときに実行されるコマンドを指定します。
preDragCommand(prd) [script, string] createedit
コマンドおよびノード タイプを指定します。このコマンドは、指定されたタイプのノードが選択範囲内に入っているときに、ドラッグを開始すると実行されます。
preserveChildPosition(pcp) boolean queryedit
false の場合は、親が移動したときに子オブジェクトも移動します。true の場合は、親が移動しても子のワールド空間位置は維持されます。既定は false です。
preserveUV(puv) boolean queryedit
false の場合、uv は頂点の編集に合わせて変更されません。true の場合、頂点の移動につれてテクスチャがずれるのを止めるため、新しい値を投影するように uv が編集されます。
reflection(rfl) boolean
このフラグは現在サポートしていません。対称(Reflection)は、symmetricModeling コマンドを使用した選択自体の一部として管理されます。
reflectionAbout(rab) int
このフラグは現在サポートしていません。対称(Reflection)は、symmetricModeling コマンドを使用した選択自体の一部として管理されます。
reflectionAxis(rfa) int
このフラグは現在サポートしていません。対称(Reflection)は、symmetricModeling コマンドを使用した選択自体の一部として管理されます。
reflectionTolerance(rft) float
このフラグは現在サポートしていません。対称(Reflection)は、symmetricModeling コマンドを使用した選択自体の一部として管理されます。
resetPivotMode(rpm) int queryedit
ピボット位置をリセットしたときに使用するモードを指定します。次のモードを使用できます。
  • 0: 中央のピボット(バウンディング ボックス上)
  • 1: ゼロ ピボット(オブジェクト空間の原点)
secondaryAxisOrient(sao) string queryedit
orientJointType の 3 つのうち 2 番目の軸の位置合わせに使用するグローバル軸(ワールド座標)を指定します。有効なオプションは xup、yup、zup、xdown、ydown、zdown、none です。
snap(s) boolean queryedit
指定できる値は true または false です。個々の移動の可否を指定します。true に設定すると、すべての移動コンテキストの移動マニピュレータは、マウスをドラッグしたとき、アクティブ ハンドルと一緒に個々のポイントにスナップされます。ポイントの間隔は、snapValue フラグを使用して制御できます。
snapComponentsRelative(scr) boolean queryedit
指定できる値は true または false です。true に設定すると、CV/頂点のグループをスナップする間、その相対的な間隔が保持されます。false に設定すると、すべての CV や頂点がターゲット ポイントにスナップされます(グリッド スナップ(ホットキー「x」)およびポイント スナップ(ホットキー「v」)で使用)。「x」キーを押した後マニピュレータ ハンドルをクリック&ドラッグし、このフラグの ON、OFF を切り替えて、一連の CV の移動の動作を確認します。
snapLiveFaceCenter(slf) boolean queryedit
指定できる値は true または false です。true に設定すると、有効なポリゴン オブジェクト上で移動する間、移動マニピュレータはオブジェクトのフェースの中心にスナップされます。
snapLivePoint(slp) boolean queryedit
指定できる値は true または false です。true に設定すると、有効なポリゴン オブジェクト上で移動する間、移動マニピュレータはオブジェクトの頂点にスナップされます。
snapPivotOri(spo) boolean queryedit
ピボットのスナップ方向です。ピボットをコンポーネントにスナップする場合のピボット方向を変更します。
snapPivotPos(spp) boolean queryedit
ピボットのスナップ位置です。ピボットをコンポーネントにスナップする場合のピボット位置を変更します。
snapRelative(sr) boolean queryedit
指定できる値は true または false です。スナップが有効な場合にのみ適用されます。true に設定すると、snapValue は移動前の元の位置に相対的に扱われます。false に設定すると、snapValue はワールド空間の原点に相対的に扱われます。注: ローカル空間モードおよびオブジェクト空間モードでは、snapRelative を ON に設定する必要があります。絶対的な個別移動は、ローカル モードおよびオブジェクト モードではサポートされていません。
snapValue(sv) float queryedit
スナップが有効な場合にのみ適用されます。すべての移動コンテキストのマニピュレータが、「snapValue」のステップに移動します。
translate(tr) [float, float, float] queryedit
マニピュレータの現在の方向/モードの移動を返します。
tweakMode(twk) boolean queryedit
True にすると、マニピュレータが非表示になり、ハイライト表示されたコンポーネントを選択できるようになります。これをクリック & ドラッグ操作による 1 回のステップで移動することができます。
xformConstraint(xc) string queryedit
  • none - トランスフォーム コンストレイントなし
  • edge - エッジ トランスフォーム コンストレイント
  • surface - サーフェス トランスフォーム コンストレイント

フラグはコマンドの作成モードで表示できます フラグはコマンドの編集モードで表示できます
フラグはコマンドの照会モードで表示できます フラグに複数の引数を指定し、タプルまたはリストとして渡すことができます。

Python 例

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