MEL:移動、回転、スケールツールのモード(ツール設定の軸)を変更する(例えば、ワールドからオブジェクトに変更)ウインドウ

//任意のボタンをクリックするとツール設定の軸が変更されます。

//VERTEX_NORMAL は法線、FACE_LOCALは法線の平均です。

//このMELスクリプトはExtension 2 for Autodesk Maya 2013で作成、確認しています。

window -width 600 -height 20 -title "manip Move Rotate Scale Context" -rtf 1;

columnLayout -adjustableColumn true;

gridLayout -numberOfColumns 6 -cellWidth 100 -cellHeight 20;

button -label "OBJECT" -command "manipMoveContext -e -mode 0 Move;manipScaleContext -e -mode 0 Scale;";

button -label "LOCAL" -command "manipMoveContext -e -mode 1 Move;manipRotateContext -e -mode 0 Rotate;manipScaleContext -e -mode 1 Scale;";

button -label "WORLD" -command "manipMoveContext -e -mode 2 Move;manipRotateContext -e -mode 1 Rotate;manipScaleContext -e -mode 2 Scale;";

button -label "VERTEX_NORMAL" -command "manipMoveContext -e -mode 3 Move;manipScaleContext -e -mode 3 Scale;";

button -label "FACE_LOCAL" -command "manipMoveContext -e -mode 9 Move;manipScaleContext -e -mode 9 Scale;";

button -label "GIMBAL" -command "manipRotateContext -e -mode 2 Rotate;";

setParent..;

showWindow;


//MAYA2018対応版です。

//任意のボタンをクリックするとツール設定の軸が変更されます。

//VERTEX_NORMAL は法線、FACE_LOCALはコンポーネントです。

//このMELスクリプトはMAYA2018で確認しています。

window -width 660 -height 20 -title "manip Move Rotate Scale Context" -rtf 1;

columnLayout -adjustableColumn true;

gridLayout -numberOfColumns 6 -cellWidth 110 -cellHeight 20;

button -label "OBJECT" -command "manipMoveContext -e -mode 0 Move;manipScaleContext -e -mode 0 Scale;";

button -label "LOCAL" -command "manipMoveContext -e -mode 1 Move;manipRotateContext -e -mode 0 Rotate;manipScaleContext -e -mode 1 Scale;";

button -label "WORLD" -command "manipMoveContext -e -mode 2 Move;manipRotateContext -e -mode 1 Rotate;manipScaleContext -e -mode 2 Scale;";

button -label "VERTEX_NORMAL" -command "manipMoveContext -e -mode 3 Move;manipScaleContext -e -mode 3 Scale;";

button -label "FACE_LOCAL" -command "manipMoveContext -e -mode 10 $currManipMovePropertiesCtx;manipRotateContext -e -mode 10 $currManipRotatePropertiesCtx;manipScaleContext -e -mode 10 $currManipScalePropertiesCtx;";

button -label "GIMBAL" -command "manipRotateContext -e -mode 2 Rotate;";

setParent..;

showWindow;

//移動モード、チェックボックス追加版です。

window -width 200 -height 20 -title "ツール設定" -rtf 1;

columnLayout -adjustableColumn true;

gridLayout -numberOfColumns 6 -cellWidth 100 -cellHeight 20;

button -label "オブジェクト" -command "SelectToggleMode;changeSelectMode -object;";

button -label "頂点" -command "SelectVertexMask;";

button -label "エッジ" -command "SelectEdgeMask;";

button -label "フェース" -command "SelectFacetMask;";

button -label "UV" -command "SelectUVMask;";

button -label "マルチ" -command "SelectMultiComponentMask;";

//checkBox -label "名前" -onCommand "チェックオン時のコマンド・スクリプト" -offCommand "チェックオフ時のコマンド・スクリプト"

checkBox -label "微調整モード" -onCommand "strsTweakMode true" -offCommand "strsTweakMode false";

checkBox -label "UVを保持" -onCommand "setTRSPreserveUVs true" -offCommand "setTRSPreserveUVs false";

checkBox -label "シンメトリ X " -onCommand "reflectionSetMode objectx;" -offCommand "reflectionSetMode none;";

checkBox -label "ソフト選択" -onCommand "softSelect -e -softSelectEnabled true;" -offCommand "softSelect -e -softSelectEnabled false;";

checkBox -label "フェースセンター選択" -onCommand "polySelectConstraint -wholeSensitive off;" -offCommand "polySelectConstraint -wholeSensitive on;";

checkBox -label "頂点選択" -onCommand "SelectVertexMask;" -offCommand "SelectToggleMode;";

setParent..;

gridLayout -numberOfColumns 6 -cellWidth 100 -cellHeight 20;

button -label "OBJECT" -command "manipMoveContext -e -mode 0 Move;manipRotateContext -e -mode 0 Rotate;manipScaleContext -e -mode 0 Scale;";

button -label "PARENT" -command "manipMoveContext -e -mode 1 Move;manipScaleContext -e -mode 1 Scale;";

button -label "WORLD" -command "manipMoveContext -e -mode 2 Move;manipRotateContext -e -mode 1 Rotate;manipScaleContext -e -mode 2 Scale;";

button -label "NORMAL" -command "manipMoveContext -e -mode 3 Move;manipScaleContext -e -mode 3 Scale;";

button -label "コンポーネント" -command "manipMoveContext -e -mode 10 $currManipMovePropertiesCtx;manipRotateContext -e -mode 10 $currManipRotatePropertiesCtx;";

button -label "ジンバル" -command "manipRotateContext -e -mode 2 Rotate;";

setParent..;

showWindow;