Auto-stacking chat animation - Expression issue or bug?
Copy link to clipboard
Copied
I am facing an issue with After Effects Expression – maybe possible bug?
Goal:
I am creating a chat animation with bubble texts for each message. I try to write an expression so that each bubble text layer auto-positions itself vertically below the previous layer. So if a message is adapted, all subsequent messages auto-reposition.
Expression:
Initially I thought the expression for this should be fairly straight forward. For simplicity I call them “Source Layer” and “Target Layer”. The source layer has its vertical position “y”. I use a “property for expression - slider” effect in the source layer to calculate its height using an expression with “SourceRectAtTime” (and some other stuff).
I see (!!!) the correct values in the source layer.
In the target layer the “y” position is calculated with an expression referring to the previous layer with “index+1” adding “source-y”+”source-hight”.
(Each subsequent Target layer hast the same functionality)
Again I SEE (!!!) the correct value(s) displayed in the layer(s). The value is there – correctly calculated.
However, the composite does not position itself according to the result of the calculation. It strangely takes its height value from its own “Hight Slider” calculation – NOT the “index+1” – (See video)
Again I must emphasize that I see the correct value in the layer y position. And if I delete the expression that referrers to “index+1” and I manually type the exact same value, the layer magically jumps to the correct position.
See this video for the exact behavior: https://vimeo.com/1067718701/629e8f1f1e
Trivial Questions:
The layers are not linked in any other way than with this expression.
Again, the value is there, the number as it should be, is correctly calculated. It is the visuals that are not positioned as calculated.
I have tried all combinations on where I calculate the target y value – all in the source layer… all in the target layer. The result never changes: the value is correct, the visual position is not.
The visual position always refers to it own height, NOT the index+1 hight. (See video)
Non trivial Questions:
- is there any reason or know case a layer is not positioned in the y coordinate value (other than linked layers)
- is there any other why vertically stack layers automatically and dynamically.
Copy link to clipboard
Copied
Additional Info: in the meantime I saw that my expression has some minor syntax errors. (forgot ";", "[]") Somtimes After Effects seems to be very forgiving with these. I have corrected this. The result is still exactly the same!

