// =========================================================================== // 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: This procedure will return true if the specified render // layer is connected to the render layer manager. This // will be used as a filter script in the render globals // editor. // global proc int layerOnRenderManager(string $findRenderLayer) { int $isFound = false; string $managerLayers[] = `listConnections renderLayerManager.renderLayerId`; for ($layer in $managerLayers) { if ($layer == $findRenderLayer && `nodeType $layer` == "renderLayer" ) { $isFound = true; break; } } return $isFound; } // Description: This procedure is used to update the controls in // frame Render Layer/Pass. // global proc createRenderLayerFilters() { // Create render layers filters if they have not been created already. // Item filters are no longer deleted on file new/open, so they only // need to be created once per session of Maya. if( !`itemFilter -exists defaultRenderLayerFilter` ) { itemFilter -bn defaultRenderLayer -classification "builtIn" defaultRenderLayerFilter; } if( !`itemFilter -exists renderLayerFilter` ) { itemFilter -byScript layerOnRenderManager -classification "builtIn" renderLayerFilter; } }