[Bug Report] Adding sourceRectAtTime() Expression Crashes AE
When attempting to add a sourceRectAtTime() expression to a Mask Path property that references a text layer, After Effects will immediately crash upon evaluation.
1. Create a new project
2. Create a new composition (tested with HDTV 1080 29.97 preset for repro purposes)
3. Add a text layer
4. Create a comp-size solid
5. Add a comp-size mask to the solid by double clicking the mask button
6. On the "Mask Path" property of the mask created in step 5, add the expression: `thisComp.layer(<nameoftext_layer>).sourceRectAtTime()
After clicking out of the expression editor and allowing AE to evaluate, After Effects crashes.
OS: Windows 10 Pro
OS Build: 19041.572
AE Version: 18.0.1 (Build 1)
Thank you for reporting this issue! We are able to reproduce this crash as well. Our team is now tracking it internally and we will investigate the root cause for a fix in a future version of AE.
- John, After Effects Engineering Team
Ethan Seagren commented
And to clarify my original post for the devs, I expect this expression as written to return an error - not that it should work - instead of crashing.
Bruno Quintin commented
Indeed it crashes if you put a "sourceRecAtTime()" expression to a Mask Path property.
It should return an error.
Here is an expression to create a rectangular mask on a solid based on the size of another layer :
var targetedLayer = thisComp.layer(<nameoftext_layer>);
var W = targetedLayer.sourceRectAtTime().width;
var H = targetedLayer.sourceRectAtTime().height;
var X = targetedLayer.sourceRectAtTime().left;
var Y = targetedLayer.sourceRectAtTime().top;
var point1 = targetedLayer.toComp([X,Y]);
var point2 = targetedLayer.toComp([X+W,Y]);
var point3 = targetedLayer.toComp([X+W,Y+H]);
var point4 = targetedLayer.toComp([X,Y+H]);
createPath(points = [point1,point2,point3,point4], inTangents = , outTangents = , is_closed = true)