ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Scripting: Add loopOut() Expression to a selectedLayer with a script?

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Brandon SmithScripting: Add loopOut() Expression to a selectedLayer with a script?
by on Feb 6, 2013 at 2:18:21 am

I am beginning to learn scripting, so I am starting off with some simple shortcut scripts. One that I am having a hard time trying to make is a script that will apply the loopOut() expression to the Position property of the layer that I have selected (or multiple selected layers). This layer already has the necessary keyframes to let the loopOut() expression work.

Any help is greatly appreciated.

Thanks,
Brandon


Return to posts index

Vishesh AroraRe: Scripting: Add loopOut() Expression to a selectedLayer with a script?
by on Feb 6, 2013 at 9:55:24 am

Brandon

You will get a better answer at Adobe After Effects Expressions.

Vishesh Arora
3D and Motion Graphics Artist
Films Rajendra

Blog:
http://digieffects.wordpress.com

2011 3D Demo Reel:








Return to posts index

Xavier GomezRe: Scripting: Add loopOut() Expression to a selectedLayer with a script?
by on Feb 6, 2013 at 1:36:03 pm

Assuming that :
1- your script has already identified the layer (let's call it theLayer),
2- your script has a string variable (called say expr) that contains the expression text,
you can go on like this:

var prop = theLayer.transform.position;
prop.expression = expr;
prop.expressionEnabled = true;

if you want need your script to read the property's values at a given time t, it is like this:

- for pre-expression value: prop.valueAtTime(t, true)
- for post-expression value : prop.valueAtTime(t, false)


Return to posts index


Brandon SmithRe: Scripting: Add loopOut() Expression to a selectedLayer with a script?
by on Feb 6, 2013 at 5:42:54 pm

Thanks for the response Xavier

Here is my code that I am currently working with, but it keeps crapping out when it gets to the actual expression. Any ideas?


var myComp = app.project.activeItem;
var myLayer = myComp.selectedLayers[0];
var prop = myLayer.transform.position;
prop.expression = "loopOut("cycle")";
prop.expressionEnabled = true;


Thanks!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]