- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey everyone,
An user asked about rotation order change and animation preservation. Obviously the
xform -p true -roo zxy ;
is a way to go, and it executes beautifully for a single frame. However, when I push it through the timeline and execute for every frame, it doesn't influence keyframes.
$sel = `ls -sl` ;
$cur_t = `currentTime -q` ;
// save current rot order for every object in selection
string $roos[] ;
$i = 0 ;
for ( $s in $sel ) {
$roos[$i] = `xform -q -roo $s` ;
$i++ ;
}
// resample keyframes within the playback range
$start = `playbackOptions -q -min` ;
$end = `playbackOptions -q -max` ;
print("Resampling range: "+ $start +" - "+ $end +"\n") ;
for ( $i = $start; $i <= $end; $i++ ) {
xform -roo xyz ;
currentTime -e $i ;
xform -p true -roo zxy ;
}
/*
for ( $i = $start; $i <= $end; $i++ ) {
currentTime -e $i ;
for ( $j = 0; $j < size($sel); $j++ ) {
xform -roo $roos[$j] $sel[$j];
xform -p true -roo zxy $sel[$j];
$x = `getAttr ($sel[$j]+".rotateX")` ;
$y = `getAttr ($sel[$j]+".rotateY")` ;
$z = `getAttr ($sel[$j]+".rotateZ")` ;
setKeyframe -at ($sel[$j]+".rotateX") -v $x -itt "linear" -ott "linear" ;
setKeyframe -at ($sel[$j]+".rotateY") -v $y -itt "linear" -ott "linear" ;
setKeyframe -at ($sel[$j]+".rotateZ") -v $z -itt "linear" -ott "linear" ;
}
}
*/
Without the getAttr-setKeyframe it just spits out autoKeyframe message after every frame, with it the changes maybe are there, but the animation is altered, which doesn't happen, when xform is executed for a single frame.
How to make it update keyframes as per single frame?
,,,_°(O__O)°_,,,
Maya2019.1 @ Windows10 & GeForce GTX1080Ti
If the post was helpful, click the ACCEPT SOLUTION button, so others might find it much more easily.
Solved! Go to Solution.