With the help of an AE project file allowing me to apply different expressions to 240 layers easily (for a 10s comp), I have some conclusions about the VELOCITY expressions mentioned previously and their influence in render time :
(note : the conclusions are for information only, with more complex projects, I’m sure there are other things to take into account but it’s a start!)
For expressions giving the position velocity at present time (time), I tried 3 different methods giving the almost same results (more or less 1 pixel) :
METHOD 1 – FASTEST
speed = thisLayer.transform.position.velocityAtTime(time);
METHOD 2
L =thisLayer;
p1 = L.transform.position.valueAtTime(time+.01);
p0 = L.transform.position.valueAtTime(time-.01);
speed = (p1 – p0)*50;
METHOD 3 – SLOWEST
L =thisLayer;
p1 = L.toWorld (L.position,time+.01);
p0 = L.toWorld (L.position,time-.01);
speed = (p1 – p0)*100;
Well, no big surprise I’d say, Darby called it previously.
BUT there is an interesting change if you’re looking to calculate the velocity at time-.01 :
METHOD 2 – FASTEST
L =thisLayer;
p1 = L.transform.position.valueAtTime(time);
p0 = L.transform.position.valueAtTime(time-0.01);
speed = (p1 – p0)*100;
METHOD 1
speed = thisLayer.transform.position.velocityAtTime(time-.01);
METHOD 3 – SLOWEST
L =thisLayer;
p1 = L.toWorld (L.position,time);
p0 = L.toWorld (L.position,time-.01);
speed = (p1 – p0)*100;
In both cases, between the “velocityAtTime” and “valueAtTime” based expressiosn there is not a huge difference in render time but on my machine it was still a few seconds for just a 10s comp!
Not sure if anyone will be interested in these observations. I’m still interested in other tips on expression!