// =========================================================================== // 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. // =========================================================================== proc int clipHasGhost( string $clip ) { // First determine if the clip has a ghost string $plugs[] = `listConnections -p 1 -s 1 -d 0 ( $clip + ".clipData" )`; if ( size( $plugs ) == 0 ) return 0; // If a ghost is found, determine if it is visible string $node = plugNode( $plugs[0] ); return `getAttr ( $node + ".visibility" )`; } // Determine if the named clips have ghost associated with them. // // Returns 0 - If none of the clips have ghosts // 1 - If all clips have ghosts // 2 - If some clips have ghosts and others don't // global proc int clipsAreGhosted( string $clips[] ) { int $sum = 0; for ( $clip in $clips ) $sum += clipHasGhost( $clip ); if ( $sum == 0 ) return 0; else if ( $sum == size( $clips ) ) return 1; return 2; }