Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-22T18:07:36.643Z
Answers.Text: Can I add a variable that I can tween at the timeline as well? Acessible through the script.
Answers.UserDisplayName: Anders Lindén
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-15T18:05:19.933Z
Answers.LastActivityDate: 2021-02-15T18:12:46.293Z
Answers.LastEditDate: 2021-02-15T18:12:46.293Z
Answers.UserDisplayName: tomh
Body: <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>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-02-15T17:00:18.007Z
Comments.Text: I get an error when I apply that expression to a path: "property labelled cx in class Global is missing or does not exist"
Comments.UserDisplayName: tomh
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-02-15T17:20:33.553Z
Comments.Text: I am sorry, removing some left over variables. Correcting the code. @tomh
Comments.UserDisplayName: Anders Lindén
Tags: <after-effects>
Title: Path created with an expression will not draw other than being selected
UserDisplayName: Anders Lindén
ThreadText: # 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:
  
  ```js
  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
  
  [![heart shape](https://i.sstatic.net/4vBI4.png)](https://i.sstatic.net/4vBI4.png)
  
  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.  
  
  ---
  
  