Forum Replies Created

Page 1 of 3
  • Remi Monedi

    December 4, 2022 at 12:26 pm in reply to: ExtendScript : Help with file selection

    Hey Tomas! Thank you! Great explanation too!

  • Remi Monedi

    September 13, 2020 at 1:40 pm in reply to: [SOLVED] Color value doesn't work with if else statement

    Ok. After looking some more at some code found on this forum, I found I just had to add [0] after the color value. Then to work properly, the expression should be :

    if (effect(“Color Control”)(“Color”)[0] == [1,1,1,1][0]) 999

    else 0

    Sorry for the double post…

  • 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!

  • Remi Monedi

    April 10, 2020 at 8:57 am in reply to: Use Source Text as expression

    It works! Thank you Dan!

  • Remi Monedi

    April 10, 2020 at 8:56 am in reply to: Use Source Text as expression

    If the results are conclusive I will share the project file Tomas, I’ll let you know! For now I’m working on AE CC2017 to maximize its compatibility.

  • Remi Monedi

    April 9, 2020 at 1:17 pm in reply to: Use Source Text as expression

    Thank you for the workaround Tomas but I am trying to create a project to test expression calculation speed and your solution won’t work :
    I wanted to have a text layer where I can write the expression I want to test and then have the properties of 50 layers linked to this Source text. This way I could easily change/improve the expression on just a single text layer and see how it affects the preview time on a lot of layers.
    This is the easiest setup I came up with but maybe it’s not possible to convert text values into property.

  • We know AE updates the result of an expression at each frame of the composition and sometimes we don’t need this constant updating, it can affect the preview/render time.
    I found 2 ways of limiting an expression’s execution to exactly once :

    METHOD 1
    By adding the comment : // cacheCompareSamplesPerSecond 0
    It works since AE CC2014, but it seems it’s a bit tricky to use : “Anything complex or potenially dynamic, and the line would disable itself it seemed.”
    https://forums.creativecow.net/readpost/227/39686

    METHOD 2
    Add this expression : posterizeTime(0);
    Works since AE 2020, a different use for the classic posterizeTime function.

    I was not able to make the 1st method work with my project and for the 2nd, I just made a quick test and it’s working.
    Did you ever used one of these methods? Do you have any thoughts on this?

    // METHOD 1
    // cacheCompareSamplesPerSecond 0

    // METHOD 2
    posterizeTime(0);

  • Remi Monedi

    April 9, 2020 at 7:16 am in reply to: Use Source Text as expression

    Hi Dan,

    On AE CC2017 it is not working, same error message.

  • Remi Monedi

    April 8, 2020 at 12:43 pm in reply to: valueAtTime is not a function

    Thank you for your answer Andrei, it is making much more sense now!
    But I’m not sure to understand your solution to let a variable with a property + an integer (like “+ 1”) taken into account by valueAtTime? Could you write it?

  • Thank you Andrei and Darby for the clarifications! About the Math functions I don’t recall when I read it but it was on this forum for sure. A way to calculate the speed of expressions would be great for sure since the time difference between two methods is often noticeable only with biiig amount of expressions.

    For instance, to get the speed of a layer (based on its position), these 3 methods gave the same results (almost) but which one is the fastest do you think?

    // METHOD 1
    speed = thisLayer.transform.position.velocityAtTime(time);

    // METHOD2
    L =thisLayer;
    p1 = L.transform.position.valueAtTime(time);
    p0 = L.transform.position.valueAtTime(time-0.01);
    speed = (p1 - p0)*100;

    // METHOD 3
    L =thisLayer;
    p1 = L.toWorld (L.anchorPoint,time+thisComp.frameDuration/2);
    p0 = L.toWorld (L.anchorPoint,time-thisComp.frameDuration/2);
    speed = (p1 - p0)/thisComp.frameDuration;

Page 1 of 3

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy