Scaling key time factor > track view curve editor weirdness

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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.
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):
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!