// =========================================================================== // 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: // Find a renderable camera for use with paint effects to poly. // global proc string getCameraForPfx() { string $perspCameras[] = `listCameras -p`; // find first renderable persp camera int $i; int $numPersp = size( $perspCameras ); for($i = 0; $i < $numPersp; $i++) { if( getAttr($perspCameras[$i] + ".renderable") ){ return( $perspCameras[$i] ); } } // if no perp rendererable then check ortho string $orthoCameras[] = `listCameras -o`; for($i = 0; $i < size($orthoCameras); $i++) { if( getAttr($orthoCameras[$i] + ".renderable") ){ return( $orthoCameras[$i] ); } } // If non are renderable, return first persp camera if( $numPersp > 0 ){ return( $perspCameras[0] ); } return( "" ); }