// =========================================================================== // 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. // =========================================================================== // // Procedure Name: // applyOnCameras // // Description: // This procedure do a setAttr on all cameras. // global proc applyOnCameras(string $attr, string $val) { // // First count how many renderable cameras exist // string $allCameras[] = `ls -cameras`; for ($i = 0; $i < size($allCameras); $i++) { string $cmd = "removeRenderLayerAdjustmentAndUnlock " + $allCameras[$i] + "." + $attr ; $cmd += "; catch(`setAttr " + $allCameras[$i] + "." + $attr + " " + $val + "`)"; eval $cmd; } }