// =========================================================================== // 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: // doCreateShotArgList // // Description: // Create a new shot // // Input Arguments: // $version: The version of this option box. Used to know how to // interpret the $args array. // "1" : first verison of shot creation command // // $args // Version 1 // [0] $name : name to give the new shot // [1] $newShotStart : Start frame in Maya time // [2] $newShotEnd : End frame in Maya time // [3] $newSeqStart : Start frame in Sequencer time // [4] $newSeqEnd : End frame in Sequencer time // [5] $camera : Shot's camera // [6] $clip : Rendered clip to link to shot // [7] $opacity : Opacity for clip // [8] $wres : Image resolution (width) // [9] $hres : Image resolution (height) // // Return Value: // none // global proc doCreateShotArgList( string $version, string $args[] ) { if( $version == 1 && size($args) != 10 ) { print (uiRes("m_doCreateShotArgList.kArgListWrongLength")); return; } string $name = $args[0]; int $newShotStart = $args[1]; int $newShotEnd = $args[2]; int $newSeqStart = $args[3]; int $newSeqEnd = $args[4]; string $camera = $args[5]; string $clip = $args[6]; float $opacity = $args[7]; float $wres = $args[8]; float $hres = $args[9]; string $cmd = "shot "; $cmd += (" -startTime " + $newShotStart); $cmd += (" -endTime " + $newShotEnd); $cmd += (" -sequenceStartTime " + $newSeqStart); $cmd += (" -sequenceEndTime " + $newSeqEnd); $cmd += (" -currentCamera " + $camera); $cmd += (" -clip \"" + $clip + "\""); $cmd += (" " + $name); string $shot = `evalEcho $cmd`; // set the image defaulting resolution setAttr ($shot+".wResolution") $wres; setAttr ($shot+".hResolution") $hres; if ($clip != "" && $opacity != 1.0) { string $ip[] = `listConnections -shapes 1 -type imagePlane $shot`; if (size($ip) > 0) { setAttr ($ip[0]+".alphaGain") $opacity; } } }