-
-
Save haithan58/343b00f016395fd9e9924dc54e863bff to your computer and use it in GitHub Desktop.
toggle anim curve isolation state for Autodesk #maya Graph Editor
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
// mel | |
proc doToggleAnimCurveIsolation(string $outliner, string $ed) | |
// C:/Program Files/Autodesk/Maya2016.5/scripts/others/isolateAnimCurve.mel 参照 | |
{ | |
global int $gUnisolateJobNum; | |
if ($gUnisolateJobNum > 0) { | |
// 選択状態を復元するための一次記憶 | |
string $shown[] = `animCurveEditor -q -curvesShown $ed`; | |
// isolate から 全部表示に戻す | |
isolateAnimCurve false $outliner $ed; | |
// ↑で選択はずれてむかつくので戻す | |
selectKey -add -k $shown; | |
} else { | |
// 全部表示 から 選択中のもののみへと表示を 絞り込む | |
isolateAnimCurve true $outliner $ed; | |
// ↑で選択はずれて同上 | |
string $version = `about -version`; | |
if( `match "2016" $version` != "2016" ){ | |
string $shown[] = `animCurveEditor -q -curvesShown $ed`; | |
selectKey -k $shown; | |
} | |
} | |
} | |
proc string[] gatherGraphEditor() | |
// graphEditor を含むウィンドを集める | |
{ | |
string $results[]; | |
string $wins[] = `getPanel -type "scriptedPanel"`; | |
for( $win in $wins ) { | |
if( `match "graphEditor*" $win` != "" ){ | |
$results[size($results)] = $win; | |
} | |
} | |
return $results; | |
} | |
global | |
proc toggleAnimCurveIsolation() | |
// Graph Editor のイゾレート状態 | |
// (menu > Curves > Isolate Curves)のトグル | |
{ | |
string $editors[] = gatherGraphEditor(); | |
for( $editor in $editors ){ | |
string $ed = $editor + "GraphEd"; | |
string $outline = $editor + "FromOutliner"; | |
doToggleAnimCurveIsolation($outline, $ed); | |
} | |
} | |
toggleAnimCurveIsolation; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment