Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Scaling key time factor > track view curve editor weirdness

Scaling key time factor > track view curve editor weirdness

Anonymous
Not applicable
496 Views
2 Replies
Message 1 of 3

Scaling key time factor > track view curve editor weirdness

Anonymous
Not applicable

Hello,

 

Part of one of my maxscripts' functionality is the ability to scale the time values in an array keys. For technical reasons, I have to scale the keys.time values "manually" in my code rather than use max's built-in scaleTime funtion. 

 

I'm running into some strange curve editor results after multiplying my keys.time by a factor. 

 

Below is an example of what I'm doing. The entire script itself is pretty long so I am just pasting the relevant snippets here.

 

The original keyArray time values are intigers. The timeScaleDelta is a float:

 

keyArray[i].time = keyArray[i].time * timeScaleDelta

 

I do this for an array of keys. Then I snap the keys to solid integer frames:

 

if (ceil t - t) < 0.5 then ceil t else floor t

 

Then I adjust the keys.time value to it's final desired value. timeDiff is an integer:

 

keyArray[i].time += timeDiff

 

Below, figure 1, is the strange-looking result. You can see the curve representation is jaggy.

 

 

strange_curves.png

 

If I use the Track View Move Keys Tool to nudge the keys forward 1 frame in time, the curve representation suddenly appears the way it's supposed to. (See below image):

 

normal_curve.png

 

Has anyone experienced something like this? How do I remedy this? It seems like scaling the key time values by mulitplying them by a factor seems to cause this problem. It perpetuates even if I close and reopen the track view curve editor. 

 

Thanks!

0 Likes
497 Views
2 Replies
Replies (2)
Message 3 of 3

Anonymous
Not applicable

Thanks for the suggestion!

 

I haven't tried sortKeys yet. What I did to fix it was, instead of explicitly assigning values to the key.time, I used the moveKeys command.

 

movKeys <controller> timeDiff #selection

 

This made max's curves straighten up, comb their hair, and start behaving correctly. 

 

I still don't know what was causing the problem though. 

0 Likes