14 March 2011

Mel scripting - toggle move tool axis

Just made a little script to go through the most useful (to me) move tool axis settings aka World, Object and Normal. I've also added a fancy little message box to tell you what you've selected, not really necessary but cool nonetheless!


int $MoveAxis = `manipMoveContext -q -mode Move`;

if ($MoveAxis == 0)
{
manipMoveContext -e -mode 2 Move;

$response = `confirmDialog -title "Axis"
-message "World move axis has been set!"
-button "OK"`;
}
else if ($MoveAxis == 2)
{
manipMoveContext -e -mode 3 Move;

$response = `confirmDialog -title "Axis"
-message "Normal move axis has been set - remember to select vertices!"
-button "OK"`;

}
else if ($MoveAxis == 3)
{
manipMoveContext -e -mode 0 Move;

$response = `confirmDialog -title "Axis"
-message "Object move axis has been set!"
-button "OK"`;

}