Call expression from script

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
zcream
Posts: 2
Joined: October 22nd, 2021, 5:20 am

How can I obtain the value of an expression from within a script ?

For example

Code: Select all

length(this_comp.layer("A").position, this_comp.layer("B").position);

The scripting engine does not recognize length().

User avatar
zlovatt
Posts: 47
Joined: October 31st, 2016, 5:00 pm
Location: Portland
Contact:

You could apply the expression to a property:

Code: Select all

property.expression = "wiggle(0.5, 100)";

and then get the post-expression value of the property;

Code: Select all

var expressionResult = property.valueAtTime(comp.time, false);
Post Reply