// =========================================================================== // 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. // =========================================================================== global proc copyAbsoluteChannelsClipData(string $newClip, string $oldClip) { string $buffer[]; string $sched = getClipScheduler($oldClip); int $oldClipIndex = getClipIndex($oldClip, $sched); string $attrs[] = `clipSchedule -ci $oldClipIndex -q -listPairs $sched`; int $attrCount = size($attrs); int $count = 0; for ($ii = $attrCount-1; $ii >= 0; $ii--) { // The strings in $attrs are of the form "channelName animCurveName", // so tokenize out the space to get the channelName. tokenize($attrs[$ii]," ",$buffer); // Query the member index for this attr from the character to find out // the associated absoluteChannel plug index string $charPlug = `character -q -cp $buffer[0]`; if (size($charPlug) > 0) { int $memberIndex = `character -q -mi $charPlug`; string $oldClipAttr = ($oldClip+".absoluteChannel["+$memberIndex+"]"); string $newClipAttr = ($newClip+".absoluteChannel["+$memberIndex+"]"); int $ac = `getAttr $oldClipAttr`; setAttr $newClipAttr $ac; $count++; } } print((uiRes("m_copyAbsoluteChannelsClipData.kResult")) + $count + "\n"); }