Skip to content

Instantly share code, notes, and snippets.

@yamahigashi
Created March 17, 2016 10:24
Show Gist options
  • Save yamahigashi/85d9743553cd41c4cb40 to your computer and use it in GitHub Desktop.
Save yamahigashi/85d9743553cd41c4cb40 to your computer and use it in GitHub Desktop.
change (or toggle view space) current active handle for Autodesk Maya
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