// =========================================================================== // 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 int selectedChannels( ) // // Checks to see if any channels in the channel box // are selected, and returns an int 0/1 depending // on whether channels are selected or not { // Bug 223961: Must set the correct parent, in case the layer editor // has been opened in a separate window // if(`optionVar -query channelsLayersSeparate`) { global string $gChannelsForm; setParent $gChannelsForm; } else { global string $gChannelsLayersForm; setParent $gChannelsLayersForm; } string $objList[] = `channelBox -q -mainObjectList mainChannelBox`; string $attrList[] = `channelBox -q -selectedMainAttributes mainChannelBox`; if ( size($objList) > 0 && size($attrList) > 0 ){ return 1; } $objList= `channelBox -q -shapeObjectList mainChannelBox`; $attrList= `channelBox -q -selectedShapeAttributes mainChannelBox`; if ( size($objList) > 0 && size($attrList) > 0 ){ return 1; } $objList= `channelBox -q -historyObjectList mainChannelBox`; $attrList= `channelBox -q -selectedHistoryAttributes mainChannelBox`; if ( size($objList) > 0 && size($attrList) > 0 ){ return 1; } $objList= `channelBox -q -outputObjectList mainChannelBox`; $attrList= `channelBox -q -selectedOutputAttributes mainChannelBox`; if ( size($objList) > 0 && size($attrList) > 0 ){ return 1; } return 0; }