Expressions/Scripts/Presets

Moderator: Paul Tuersley

 
i4n
Topic Author
Posts: 14
Joined: Fri Jul 08, 2011 3:52 pm

Convert expressions to keyframes++

Wed Oct 05, 2011 10:29 am

I can perform any and all iterative tasks (loops, etc..), these snippets are the only thing holding me back:

*code to add/remove expression
*code to convert expressions to keyframes
*code to toggle "separate dimensions" (when dealing with xposition & yposition)

Would anyone kindly lend me a hand?
 
Paul Tuersley
Posts: 704
Joined: Sat Jun 05, 2004 7:59 am
Location: London, UK

Re: Convert expressions to keyframes++

Wed Oct 05, 2011 4:43 pm

These things can only be done with scripts, not expressions. I'll move this to Scripts Discussions.

To add an expression to a property you would use:
property.expression = "my expression";

To remove an expression you would use:
property.expression = "";

To convert an expression to keyframes you would have to loop through the time of each frame in the comp, storing the times and the values in arrays, before removing the expression and setting property.valuesAtTimes(theTimes, theValues).

To separate dimensions, I would consult the CS4 scripting changes at:
http://blogs.adobe.com/toddkopriva/2008 ... ng-ch.html

And of course, feel free to ask more questions if you get stuck.
 
i4n
Topic Author
Posts: 14
Joined: Fri Jul 08, 2011 3:52 pm

Re: Convert expressions to keyframes++

Thu Oct 06, 2011 12:39 pm

Thanks, Paul. You are a constant help in these threads. As I learn more I'll contribute, as I can..

Who is online

Users browsing this forum: No registered users and 8 guests