Animate variable inside expression In After Effects, I created a shape layer, added a path to that, edited the expression of it to contain
var path = thisProperty;
var cx = 100;
var cy = 200;
var r1 = 300;
var ratio =  20;
var quality = 30;
var closedPath = true;
var allPoints = new Array();

for (var a = 0; a &lt; 360; a++) {
    var theta = degreesToRadians(a);
    x0 = Math.cos(theta);
    x = cx + r1 * x0;
    y = cy + 0.75 * r1 * (Math.sin(theta) - Math.sqrt(Math.abs(x0)));
    allPoints.push([x,y]);
}
path.createPath(allPoints, [], [], closedPath);

and added a stroke and a fill to the shape layer and set the width of the stroke to 10 and the color of the fill to light red. I got this shape as a result.

Now, I want to animate the end point of that stroke, you may see that I am looping the variable a from 0 to 360. That 360 value represents the end angle of the shape and I would like to have it animated to make an animation that &quot;draws&quot; the heart.
How do I animate the end value?
Is there a way to add a &quot;dummy effect&quot; so I can use it like
var a_max = effect(&quot;dummy&quot;)(&quot;endpoint&quot;)
Press the triangle marked &quot;Add&quot; next to the Contents of your shape layer.
Add a &quot;trim path&quot;
Add a keyframe to the &quot;End&quot; parameter of 0%.
Move along your timeline.
Add another keyframe of 100%.

Your path will draw on.
You probably don't want to fill it until it is drawn.