UI Fails to Display Correct Values for Expressions Combining posterizeTime(0) and sampleImage()
I think I found a bug; here's an AI assisted report:
Bug Report: UI Fails to Display Correct Values for Expressions Combining posterizeTime(0) and sampleImage()
Product: Adobe After Effects Version: 25.3.1 Operating System: Windows 10
Summary
When an expression utilizes posterizeTime(0) in a chain that includes the sampleImage() function, the After Effects user interface (UI) fails to display the correct calculated value for the affected property. Instead, it shows a "default" value (e.g., black for a color swatch, or 0 for a scalar property like Opacity).
Critically, the underlying render engine correctly calculates and uses the accurate value, ensuring that the final render is correct. This bug is exclusively a UI display issue. This can be verified by displaying the property's real-time value on a text layer, which consistently shows the correct data despite the erroneous UI display.
Steps to Reproduce
Base Setup:
Create a new composition.
Create a solid layer (e.g., a red solid named "Source"). This layer will be sampled.
Create a Shape Layer.
Add an Effects > Expression Controls > Color Control to the Shape Layer.
Apply the following expression to the Opacity property of the Shape Layer's Transform group, referencing the Color Control:
effect("Color Control")("Color")[0] * 100;
Test Case 1: posterizeTime(0) on sampleImage() property ONLY
On the Color Control effect, apply this expression:
posterizeTime(0); targetLayer = thisComp.layer("Source"); value = targetLayer.sampleImage(targetLayer.transform.position, [1, 1]);
Result: The Color Control swatch incorrectly displays black. The Opacity property incorrectly displays 0%.
Test Case 2: posterizeTime(0) on downstream property ONLY
On the Color Control effect, apply this expression (NO posterizeTime):
targetLayer = thisComp.layer("Source"); value = targetLayer.sampleImage(targetLayer.transform.position, [1, 1]);
On the Opacity property, apply this expression:
posterizeTime(0); effect("Color Control")("Color")[0] * 100;
Result: The Color Control swatch correctly displays red. The Opacity property incorrectly displays 0%.
Verification of Underlying Values
To confirm that the bug is limited to the UI display, the true underlying values can be displayed on a text layer:
Create a new Text Layer.
Apply the following expression to its Source Text property:
// Get the values from the Shape Layer's properties colorVal = thisComp.layer("Shape Layer 1").effect("Color Control")("Color"); opacityVal = thisComp.layer("Shape Layer 1").transform.opacity; // Display the values "Color Value: " + colorVal + "\n" + "Opacity Value: " + opacityVal;
Observation: In both Test Case 1 and Test Case 2, the text layer will consistently display:
Color Value: 1,0,0,1 Opacity Value: 100
This confirms that the expression engine is calculating the correct values, and the bug is a failure of the UI to accurately display them.
Analysis:
This demonstrates that the UI display bug is triggered whenever posterizeTime(0) is involved in an expression chain that includes sampleImage(). The UI fails to retrieve the correct value, even if the posterizeTime(0) call is in a downstream expression that is merely referencing the result of sampleImage(). The verification step definitively proves this is a UI-to-engine communication issue rather than a calculation error.
