How add expressions in after effects to layer or composition using Extendscript and javascript?

1.6k views Asked by At

Can anybody help me? I am trying to write a script for after effects CC using Extendscript. I want add expression to layer in the javascript. I wrote this code here

var MyTime = app.project.item(1).layer(1); var Mytime2 = MyTime.timeRemapEnabled = true;

and i want add exspression to layer(1), loopOut('Cycle')

How can i do it? Is it possible? Thanks.

1

There are 1 answers

3
fabianmoronzirfas On

To add an expression to a layers attribute you do something like this:

layer.transform.position.expression = 'loopOut("Cycle")';