ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Move keyframes in timeline using expressions

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Paul Connors
Move keyframes in timeline using expressions
on Mar 30, 2020 at 7:46:45 pm

I’m looking to use a .CSV file that has tracking data for an object over time. The data has the different XY position coordinates and at what time the object was at those coordinates. I want to use all this information to power a dot moving from position to position. I’d like to do it all with expressions so I can update the data and the animation will update. Anyone got any tips / strategies to attack this? I’ve got a good idea on transferring the XY positional data to AE (still open to suggestions on this one if anyone has a favorite method), but I don’t have a strategy for manipulating the times/timing. Any tips would be great. Thank you.


Return to posts index

Andrei Popa
Re: Move keyframes in timeline using expressions
on Mar 30, 2020 at 9:44:42 pm

I hope you have some knowledge about expressions because this will be a little bit hard to explain.

I have some values, you will have to modify the expression to satisfty your needs.

My csv has 2 columns: Times and Positions. First has some numbers, second has some 2 dimension arrays.
I put my csv inside the timeline and pick-whip from the expression to "positions.csv>Data>Times 0"(layer, property, property) to see how the expression to link the first time would look like. Mine is thisComp.layer("positions.csv")("Data")("Outline")("TImes")("TImes 0").
same for Positions, i get thisComp.layer("positions.csv")("Data")("Outline")("Positions")("Positions 0");. Considering these 2 paths, my expression looks like this:

myData = thisComp.layer("positions.csv")("Data")("Outline");
i=1;
while(myData("Times")("Times "+i).value < time && i < myData("Times").numProperties-1) i++

initTime = myData("Times")("Times " + (i-1)).value;
endTime = myData("Times")("Times " + i).value;
initPosition = eval(myData("Positions")("Positions "+(i-1)).value);
endPosition = eval(myData("Positions")("Positions "+(i)).value);

linear(time,initTime,endTime,initPosition,endPosition)


I think that what you need to do is replace what comes after myData with what you have. Or make a 2 column table with the columns named Times and Positions as your csv.

Andrei
My Envato portfolio.


Return to posts index

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