// =========================================================================== // 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. // =========================================================================== // // // Creation Date: Nov, 1999 // // Procedure Name: // doCopyClipArgList // // Description: // Copy a clip // // Input Arguments: // $version: The version of this option box. Used to know how to // interpret the $args array. // // $args // Version 1 // [0] $name : name of the clip window // Version 2 // [1] $clip : specific clip to cut // global proc doCopyClipArgList( string $version, string $args[] ) { int $versionNo = $version; string $clipWnd = $args[0]; string $selClips[]; if (($versionNo >= 2) && ($args[1] != "")) { $selClips[0] = $args[1]; } else { $selClips = getSelectedClips("noOptions"); } string $copiedClips[]; int $copyCount = 0; int $nclips = size($selClips); if ($nclips == 0) { error( (uiRes("m_doCopyClipArgList.kSelectTheClipsErr")) ); } else { string $selChar = ""; string $clip; for ($clip in $selClips) { string $sch = getClipScheduler($clip); int $clipIndex = getClipIndex($clip, $sch); string $clipName = `clipSchedule -ci $clipIndex -q -n $sch`; string $clipSourceName = `clipSchedule -ci $clipIndex -q -scn $sch`; string $character[] = `listConnections -type character $sch`; if (($selChar != "") && ($selChar != $character[0])) { error( (uiRes("m_doCopyClipArgList.kAllClipsErr")) ); } else { $selChar = $character[0]; } if (size($clipName) && size($character)) { int $copyIt = 1; for ($cclip in $copiedClips) { if ($cclip == $clipSourceName || $cclip == $clipName) { $copyIt = 0; } } if ($copyIt) { $copiedClips[size($copiedClips)] = $clipName; } } } if ("" != $selChar) { string $cmdString = "clip -copy"; for ($cclip in $copiedClips) { $cmdString += (" -name "+$cclip); } $cmdString += (" "+$selChar); evalEcho($cmdString); string $selBlends[] = getSelectedBlends(); int $nblends = size($selBlends); if ($nblends != 0) { warning( (uiRes("m_doCopyClipArgList.kSelectedBlends")) ); } } } }