I'm not great at working out expressions, so there might be a really simple solution to this.
A little context. I need to output keyframe data from After Effects to a piece of bespoke web software. Basically, I create a simple animation on a layer. I then copy all of the transform values and paste them into a spreadsheet. The bespoke web software is able to read this spreadsheet and apply the animation to its own visual elements.
The web software requires that every single frame has a keyframe value in the spreadsheet. I do this by simply using 'Add Expression' on every transform property (Position, Rotation, etc) and then use 'Convert Expression to Keyframes' in the Animation Assistant. However, there is a problem. The web software is unable to deal with anything less than a whole number. This means that when it renders its visual element it can jitter back and forth as it rounds all the values up or down.
So I'm looking for an expression or script that will round the transform values up or down for each keyframe (It's probably best if it always round in one direction e.g down). This will still likely cause a jitter, but at least I will be able to see it in After Effects and correct it before I output the data for the web software.
Ultimately, I'd like to create a script that automatically converts all transform values to whole number keyframes on every frame. This would mean I no longer need to add expressions and convert to keyframes.
4 posts • Page 1 of 1
Before you "Convert Expression to Keyframes" in 2 array transform properties like position, anchor, or scale you can use this
For transform properties with no arrays like rotation and opacity
Code: Select all
var x = Math.floor(value); // Math.floor will round down the decimals to a whole number var y = Math.floor(value); [x, y]
I hope this solves your problem.
Code: Select all
For Expression Tutorials: