GiarcNamwob
02-17-2007, 09:56 PM
I have been testing this script out for use and it seems pretty good...
For those of you that are not familiar it will play on the keys in your scene in realtime...
Like watching in stepped mode with out having to convert tangents and loose edits...
Several animators I know love the idea.
This script seemed to work in maya 7 but now seems to run in 8.5 but the view does not update... and help updating this scrit would be great...
thanks in advance++
// stepped playback
global proc abxPlayKeys () {
float $beginningTime = `playbackOptions -q -min`;
float $endTime = `playbackOptions -q -max`;
//$frameRate = `playbackOptions -q
// build list of keyframes
float $keyFrameArray[];
$keyFrameArray[0] = $beginningTime;
int $index=1;
float $lastKey = `findKeyframe -timeSlider -which last`;
if ($lastKey > $endTime)$lastKey = $endTime;
for ($i = $beginningTime+1;$i<$lastKey-1;$i++) {
$keyFrameArray[$index] = `findKeyframe -t $i -which next`;
$i = $keyFrameArray[$index];
//currentTime -e $keyFrameArray[$index] -update true;
$index++;
}
$keyFrameArray[$index] = $endTime;
print $keyFrameArray;
// play the animation once
global string $gMainProgressBar;
progressBar -edit -beginProgress -isInterruptable true -status "Working" -maxValue 100 $gMainProgressBar;
int $l =0;
for ($l=0;$l<1;$l++){
print $l;
float $t = `timerX`;
float $p = 0;
currentTime -edit $keyFrameArray[0];
for ($p in $keyFrameArray){
float $startTime = `timerX -startTime $t`;
if(`progressBar -query -isCancelled $gMainProgressBar`)break;
if ($startTime < ($p-100)/24 && $startTime < ($p-102)/24){ // if the elapsed time doesn't already exceed the next frame
while ($startTime<($p-102)/24) $startTime = `timerX -startTime $t`; // wait if necessary
currentTime -edit $p ;
print ($startTime+":"+(($p-102)/24)+"\n");
}
}
if(`progressBar -query -isCancelled $gMainProgressBar`)break;
}
progressBar -edit -endProgress $gMainProgressBar;
}
For those of you that are not familiar it will play on the keys in your scene in realtime...
Like watching in stepped mode with out having to convert tangents and loose edits...
Several animators I know love the idea.
This script seemed to work in maya 7 but now seems to run in 8.5 but the view does not update... and help updating this scrit would be great...
thanks in advance++
// stepped playback
global proc abxPlayKeys () {
float $beginningTime = `playbackOptions -q -min`;
float $endTime = `playbackOptions -q -max`;
//$frameRate = `playbackOptions -q
// build list of keyframes
float $keyFrameArray[];
$keyFrameArray[0] = $beginningTime;
int $index=1;
float $lastKey = `findKeyframe -timeSlider -which last`;
if ($lastKey > $endTime)$lastKey = $endTime;
for ($i = $beginningTime+1;$i<$lastKey-1;$i++) {
$keyFrameArray[$index] = `findKeyframe -t $i -which next`;
$i = $keyFrameArray[$index];
//currentTime -e $keyFrameArray[$index] -update true;
$index++;
}
$keyFrameArray[$index] = $endTime;
print $keyFrameArray;
// play the animation once
global string $gMainProgressBar;
progressBar -edit -beginProgress -isInterruptable true -status "Working" -maxValue 100 $gMainProgressBar;
int $l =0;
for ($l=0;$l<1;$l++){
print $l;
float $t = `timerX`;
float $p = 0;
currentTime -edit $keyFrameArray[0];
for ($p in $keyFrameArray){
float $startTime = `timerX -startTime $t`;
if(`progressBar -query -isCancelled $gMainProgressBar`)break;
if ($startTime < ($p-100)/24 && $startTime < ($p-102)/24){ // if the elapsed time doesn't already exceed the next frame
while ($startTime<($p-102)/24) $startTime = `timerX -startTime $t`; // wait if necessary
currentTime -edit $p ;
print ($startTime+":"+(($p-102)/24)+"\n");
}
}
if(`progressBar -query -isCancelled $gMainProgressBar`)break;
}
progressBar -edit -endProgress $gMainProgressBar;
}
