// =========================================================================== // 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. // =========================================================================== // // // Creation Date: 17 Oct 1997 // // Procedure Name: // resetUnitsToDefault // // Description: // Reset the units (angle, linear, and time) to those stored // in the preferences. // // Return Value: // None. // global proc resetUnitsToDefault() { string $unitL, $unitA, $unitT; if( `optionVar -exists workingUnitLinearDefault` ) { $unitL = `optionVar -q workingUnitLinearDefault`; } else { if( `optionVar -exists workingUnitLinear` ) { $unitL = `optionVar -q workingUnitLinear`; } else { $unitL = "cm"; } optionVar -sv workingUnitLinearDefault $unitL; } if( `optionVar -exists workingUnitAngularDefault` ) { $unitA = `optionVar -q workingUnitAngularDefault`; } else { if( `optionVar -exists workingUnitAngular` ) { $unitA = `optionVar -q workingUnitAngular`; } else { $unitA = "deg"; } optionVar -sv workingUnitAngularDefault $unitA; } if( `optionVar -exists workingUnitTimeDefault` ) { $unitT = `optionVar -q workingUnitTimeDefault`; } else { if( `optionVar -exists workingUnitTime` ) { $unitT = `optionVar -q workingUnitTime`; } else { $unitT = "film"; } optionVar -sv workingUnitTimeDefault $unitT; } // set option vars for current scene optionVar -sv workingUnitLinear $unitL -sv workingUnitAngular $unitA -sv workingUnitTime $unitT; catch( `currentUnit -linear $unitL` ); catch( `currentUnit -angle $unitA` ); catch( `currentUnit -time $unitT` ); }