// =========================================================================== // 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: Dec, 2000 // // Procedure Name: // updateMotionTrail // // Description: // Force update of selected motion trails. // proc int updateSnapshotInList(string $historyNodes[]) { int $count = 0; string $node; for ($node in $historyNodes) { if (nodeType($node) == "snapshot" || nodeType($node) == "motionTrail" ) { string $printMsg = (uiRes("m_updateMotionTrail.kUpdating")); $printMsg = `format -s $node $printMsg`; print($printMsg); int $currVal = `getAttr ($node+".nodeState")`; if ($currVal == 2) { setAttr ($node+".nodeState") 0; } else { setAttr ($node+".nodeState") 2; } refresh; setAttr ($node+".nodeState") $currVal; $count++; } } return $count; } global proc updateMotionTrail() { string $sel[] = `ls -sl`; if (0 == size($sel)) { error( (uiRes("m_updateMotionTrail.kSelectMotionTrailsErr")) ); return; } int $count = 0; string $futureNodes[] = `listHistory -f 1 -lf 0 -pdo 1`; $count += updateSnapshotInList($futureNodes); string $historyNodes[] = `listHistory -f 0 -lf 1 -pdo 1`; $count += updateSnapshotInList($historyNodes); string $futureNodes2[] = `listHistory -f 1 -lf 1 -pdo 1`; $count += updateSnapshotInList($futureNodes2); if (0 == $count) { error( (uiRes("m_updateMotionTrail.kNoMotionTrailsErr")) ); } }