Created
March 17, 2016 10:24
-
-
Save yamahigashi/85d9743553cd41c4cb40 to your computer and use it in GitHub Desktop.
change (or toggle view space) current active handle for Autodesk Maya
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
proc change_current_active_handle( int $axis ){ | |
string $cmd = ""; | |
string $tool = ""; | |
string $current_ctxt = `currentCtx`; | |
switch( $current_ctxt ){ | |
case "moveSuperContext": | |
case "manipMoveContext": | |
$cmd = "manipMoveContext"; | |
$tool = "Move"; | |
break; | |
case "RotateSuperContext": | |
case "manipRotateContext": | |
$cmd = "manipRotateContext"; | |
$tool = "Rotate"; | |
break; | |
case "scaleSuperContext": | |
case "manipScaleContext": | |
$cmd = "manipScaleContext"; | |
$tool = "Scale"; | |
break; | |
} | |
if ( $axis == `eval($cmd + " -q -currentActiveHandle " + $tool)` ){ | |
$axis = 3; | |
} | |
eval( $cmd + " -e -currentActiveHandle " + $axis + " " + $tool + ";" ); | |
dR_updateToolSettings; | |
} | |
// change(toggle) x | |
change_current_active_handle( 0 ); | |
// change(toggle) y | |
change_current_active_handle( 1 ); | |
// change(toggle) z | |
change_current_active_handle( 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment