// =========================================================================== // 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: // sceneIsEmpty // // Description: // Procedure to check if the scene is "empty" according to this specific definition // of empty: Scene contains no transform, besides cameras. // // Input Arguments: // // Return Value: // After a file new or opening Maya, this procedure returns true. // False as soon as a non-camera transform exists in the scene. // global proc int sceneIsEmpty() { int $retVal = 1; string $cameras[] = `listCameras`; string $transf[] = `ls -transforms`; int $nbCam = size($cameras); int $nbTrs = size($transf); return $nbCam == $nbTrs; };