AE Version: 17.6.0 (Build 46)
Reproduction Steps:
- Create a New Project
- Add a new layer
- Animate the position property with keyframes
- Apply the following expression to position:
posterizeTime(6); transform.position
Expected Behavior:
Position animation is posterized.
Actual Behavior:
Position animation is not posterized.
Additional Notes:
The failure to posterize only occurs in cases where the expression returns a property directly. For instance, the following expression...
posterizeTime(6); transform.position + [0, 0]
... does correctly posterize the position animation, despite the fact that it should be returning an identical result. This can be seen in my first example AEP file.
The property being returned does not have to be itself. For instance, if the expression returns the position value from another layer, or if it returns the value of a Point Expression Control, it'll again fail to posterize. This happens even if the layer is 3D and pointing to a 2D vector property. The second example AEP has the layers pointing to the position property of a Null layer, and still exhibits the issue.
This does not happen with just position properties, although is the quickest and easiest to demonstrate. This will also happen with things like Character Selectors in Text Animators, where this issue was first observed.
My suspicion is that the checker/part of the JavaScript compiler that determines if an expression needs to be run or can be side-stepped, sees that a property is being directly returned in all paths, chooses not to run the expression and uses the value of the property directly, despite the fact that the expression has side effects when ran.