// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== // Description: // Bring up the graph editor with the selected cache clip's weight curve. // // Input Arguments: // $editor - trax editor window // // Return Value: // None // global proc cacheClipWeightGraph(string $clipN[]) { if (size($clipN) == 0) { error((uiRes("m_cacheClipWeightGraph.kSelectACacheClip"))); } //get related cacheBlend node string $cacheBlendNodeList[] = getSelectedCacheBlends($clipN[0]); if (size($cacheBlendNodeList) > 0) { //get weight curve of cache file node int $multiIndex = `cacheFileCombine -cc $clipN[0] -q -cacheIndex $cacheBlendNodeList[0]`; if ( $multiIndex != -1 ) { string $srcPlug = $cacheBlendNodeList[0] + ".cacheData[" + $multiIndex + "].weight"; string $checkIfWeightExists[] = `ls $srcPlug`; if (size($checkIfWeightExists) > 0) { string $weightC[] = `listConnections -source true -destination false $srcPlug`; if(size($weightC) > 0) { select -r (plugNode($weightC[0])); tearOffRestorePanel (localizedPanelLabel( "Graph Editor" )) "graphEditor" true; selectKey $weightC[0]; refresh; FrameSelected; } else { error((uiRes("m_cacheClipWeightGraph.kThereIsNoWeight"))); } } } } else { error((uiRes("m_cacheClipWeightGraph.kThereIsNoCacheBlend"))); } }