<p>Apologies if I've misunderstood, but you can just click on the Add triangle, and add a fill or a stroke to your shape:
<a href="https://i.sstatic.net/b41md.gif" rel="nofollow noreferrer"><img src="https://i.sstatic.net/b41md.gif" alt="screengrab" /></a></p>
<p>The modifiers in the &quot;Add&quot; menu are hierarchical - so you have to add them below the path's hierarchical level.</p>

CC BY-SA 4.0
2021-02-22T18:07:36.643Z
Can I add a variable that I can tween at the timeline as well? Acessible through the script.
Anders Lindén
CC BY-SA 4.0
2021-02-15T18:05:19.933Z
2021-02-15T18:12:46.293Z
2021-02-15T18:12:46.293Z
tomh
<p>I am trying to create a heart shape using an expression like this:</p>
<ul>
<li>Start AE</li>
<li>New Composition + Ok</li>
<li>Layer, new shape layer</li>
<li>Expand to get the contents node and click add Path</li>
<li>Path -&gt; Edit expression</li>
</ul>
<p>Then I paste this expression:</p>
<pre class="lang-js prettyprint-override"><code>var path = thisProperty;
var allPoints = new Array();
for (var a = 0; a &lt; 360; a++) {
  var theta = degreesToRadians(a);
  x0 = Math.cos(theta);
  x = 300 * x0;
  y = 0.75 * 300 * (Math.sin(theta) - Math.sqrt(Math.abs(x0)));
  allPoints.push([x,y]);
}
path.createPath(allPoints, [], [], true);
</code></pre>
<p>and I see this on the screen</p>
<p><a href="https://i.sstatic.net/4vBI4.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/4vBI4.png" alt="heart shape" /></a></p>
<p>But this will only be visible in the designer.
If the object is deselected, it will become invisible.</p>
<p>There is no way to control the stroke width, color or fill.</p>
<p>How can I control those properties?</p>
<p>I am trying to add a stroke alongside the path, but they will not &quot;connect&quot;.</p>

CC BY-SA 4.0
2021-02-15T17:00:18.007Z
I get an error when I apply that expression to a path: "property labelled cx in class Global is missing or does not exist"
tomh
CC BY-SA 4.0
2021-02-15T17:20:33.553Z
I am sorry, removing some left over variables. Correcting the code. @tomh
Anders Lindén
<after-effects>
Path created with an expression will not draw other than being selected
Anders Lindén
# Path created with an expression will not draw other than being selected

(Asked by: username_0 on 2021-02-14)

I am trying to create a heart shape using an expression like this:

Start AE
New Composition + Ok
Layer, new shape layer
Expand to get the contents node and click add Path
Path -> Edit expression

Then I paste this expression:
var path = thisProperty;
var allPoints = new Array();
for (var a = 0; a < 360; a++) {
  var theta = degreesToRadians(a);
  x0 = Math.cos(theta);
  x = 300 * x0;
  y = 0.75 * 300 * (Math.sin(theta) - Math.sqrt(Math.abs(x0)));
  allPoints.push([x,y]);
}
path.createPath(allPoints, [], [], true);

and I see this on the screen

But this will only be visible in the designer.
If the object is deselected, it will become invisible.
There is no way to control the stroke width, color or fill.
How can I control those properties?
I am trying to add a stroke alongside the path, but they will not "connect".

**Tags:** after-effects

> **Comments:**
> **username_1**: I get an error when I apply that expression to a path: "property labelled cx in class Global is missing or does not exist"  
> **username_0**: I am sorry, removing some left over variables. Correcting the code. @username_1  

---

## 1 answers

### Answer by username_1 on 2021-02-15. Score: 2 | Accepted answer

Apologies if I've misunderstood, but you can just click on the Add triangle, and add a fill or a stroke to your shape:
[![screengrab](https://i.sstatic.net/b41md.gif)](https://i.sstatic.net/b41md.gif)

The modifiers in the "Add" menu are hierarchical - so you have to add them below the path's hierarchical level.

> **Comments:**
> **username_0**: Can I add a variable that I can tween at the timeline as well? Acessible through the script.  

---

