// =========================================================================== // 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. // =========================================================================== global proc updateAEshowAllButton() // // Description: // Enable the AEshowAllButton if at least one filter is toggled off, else // disable it. // { string $filterTypes[]; if( `optionVar -exists activeAEShowFilterTypes` ){ $filterTypes = `optionVar -query activeAEShowFilterTypes`; } int $numFilterTypes = size($filterTypes); int $filterStates[]; if( `optionVar -exists activeAEShowFilterStates` ){ $filterStates = `optionVar -query activeAEShowFilterStates`; } int $numFilterStates = size($filterStates); if( $numFilterStates > $numFilterTypes ){ // Somehow, we have more states than types. Ignore the extra states. // $numFilterStates = $numFilterTypes; } int $someOff = false; int $filterIndex = 0; while( $filterIndex < $numFilterStates ){ if( !($filterStates[$filterIndex]) ){ $someOff = true; } $filterIndex++; } if( `button -exists "AEshowAllButton"` ){ button -e -enable $someOff "AEshowAllButton"; } }