// =========================================================================== // 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. // =========================================================================== // // Returns an array of the selected instance clips in the trax editor // proc string [] removeSourceClips(string $clipList[]) // Strips source clips out of the supplied clip list leaving // only the instance clips { string $instanceList[]; string $clip; int $numInstances = 0; for ($clip in $clipList) { int $instancedClip = `getAttr ($clip+".clipInstance")`; if ($instancedClip) { $instanceList[$numInstances] = $clip; $numInstances++; } } return $instanceList; } global proc string [] getSelectedClips(string $options) { string $selClips[] = `ls -sl -type animClip`; $selClips = removeSourceClips($selClips); string $selAudio[]; string $selCache[]; if (size($selClips) == 0 && (match ("includeCache", $options) != "includeCache")) { if (match ("allowAudioCache", $options) != "allowAudioCache") { if (match ("allowAudio", $options) != "allowAudio") $selAudio = `ls -sl -type audio`; if (match ("allowCache", $options) != "allowCache") $selCache = `ls -sl -type cacheFile`; // error message if (size($selAudio) > 0 && size($selCache) > 0) error( (uiRes("m_getSelectedClips.kOperationNotValid")) ); else if (size($selAudio) > 0) error( (uiRes("m_getSelectedClips.kOperationNotValidAudio")) ); else if (size($selCache) > 0) error( (uiRes("m_getSelectedClips.kOperationNotValidCache")) ); } } else{ $selCache = `ls -sl -type cacheFile`; for ($clip in $selCache) $selClips[size($selClips)] = $clip; } return $selClips; }