-
Adding an expression to a path
I can’t work out the right object name for a path I’ve created, which I need to add an expression to. Here’s the code I’ve got:
</p><p> function createShape(targetComp) {</p><p> return targetComp.layers.addShape();</p><p> }</p><p> function createShapeGroup(shape) {</p><p> return shape.property("Contents").addProperty("ADBE Vector Group");</p><p> }</p><p></p><p></p><p> function createPath(group) {</p><p> return group.property("Contents").addProperty("ADBE Vector Shape - Group");</p><p> }</p><p>[...]</p><p> var comp = getActiveComp();</p><p> var shp = createShape(comp);</p><p> shp.name = ("Curve");</p><p> var curvgrp = createShapeGroup(shp);</p><p> curvgrp.name = ("CurveGrp");</p><p> var curv = createPath(curvgrp);</p><p></p><p></p><p>
This works, and adds a path in a group called CurveGrp, on a shape layer called Curve.
But how do I add an expression to this path? I’ve tried these options, and none of them work:
</p><p>curv.content("Path 1").expression = "[...]";</p><p>curv.content("Path").expression = "[...]";</p><p>curv.path.expression = "[...]";</p><p> curv.content("ADBE Vector Shape").expression = "[...]";<br></p><p></p><p></p><p>