// =========================================================================== // 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: // Apply/Save hypergraph panel settings // // // Procedure Name: // applyHypergraphSettings // // Description: // Apply saved hypergraph panel settings to a panel if saved. // // Input Arguments: // The panel to be affected // // Return Value: // None. // global proc applyHypergraphSettings( string $thePanel ) { global string $gSavedHypergraphPanelNames[]; global string $gSavedHypergraphPanelStates[]; global int $gDoRestoreHypergraphSettings[]; // don't do anything if saveHypergraphSettings has not been sourced if (`exists findSavedHypergraphPanelName`) { int $i = `findSavedHypergraphPanelName $thePanel`; // check that this panel has saved settings if ( $i > -1 ) { // check that we are supposed to apply them if ( $gDoRestoreHypergraphSettings[$i] == 1 ) { string $stateString = $gSavedHypergraphPanelStates[$i]; $stateString = `substitute "$panelName" $stateString ("\"" + $thePanel + "\"")`; catch (`eval $stateString`); // clear the flag $gDoRestoreHypergraphSettings[$i] = 0; } } } }