Forum Replies Created

Page 1 of 9
  • Stephen Dixon

    March 23, 2021 at 12:33 am in reply to: if/else Diagonal

    I get the feeling you don’t really understand how AE and expressions work.
    You can use sampleImage() to get the colour of the pixels at a point on the layer, and then check to see if they are green. To check if another layer is completely inside the green area you would find its bounding box and check each corner to see if it was inside.

    https://ae-expressions.docsforadobe.dev/layer-general.html#layer-sampleimage-point-radius-0-5-0-5-posteffect-true-t-time

  • Stephen Dixon

    December 2, 2020 at 6:07 am in reply to: Time Remapped preComp using parentComp time

    The time variable in the precomp is equal to the time that the playhead from the parent comp is at, relative to the precomp. So if the main comp contains the precomp starting at 2:00 the value of the time variable for the precomp at the beginning of the parent comp is -2.

    To access the parent comp’s time we need to add the precomp’s in-point offset, thus:

    time + comp("parent comp name").layer(thisComp.name).inPoint;
  • Stephen Dixon

    November 24, 2020 at 12:16 am in reply to: Move a layer according to its own location

    Since expressions aren’t able to store previous values, to achieve something like this you have to calculate the results for every frame up to the current one.

    e.g.

    calculatedPos = thisProperty.valueAtTime(0); //initial (blue) value
    for (let f = 0; f < time; f += thisComp.frameDuration){
    if (calculatedPos[0] % 2 > 0){ //x is odd
    calculatedPos[1]++ //add one to y
    }
    if (calculatedPos[1] % 3 === 0){ // y is multiple of 3
    calculatedPos[0]++ //add 1 to x
    } else {
    calculatedPos[0]-- //subtract 1 from x
    }
    }
    caculatedPos
  • You can’t change the current time of a comp with expressions, you can only set the value of the layer properties that they’re applied to.

    You can use scripts to change the time, but that won’t have any effect at render time, it would be as if you changed the time yourself with the UI.

  • Stephen Dixon

    November 8, 2020 at 1:05 pm in reply to: Scale expression

    When solid 1 is 100% scale, solid 2 is 50% and vice versa. So we can set the scale of the second solid thus:

    [150, 150]- thisComp.layer(“Shape Layer 1”).transform.scale

    To make its left edge line up with the right edge of solid 1, we can just put the anchor points of the solids at the bottom left and bottom right respectively. The easiest way to set this is to use the pan behind tool. Hit y and drag the anchor point to the lower left of the blue solid, holding ctrl to snap it to the corner point. Do the same for the red solid, but drag it to the lower right corner, holding ctrl to snap.

    Delete all the position keyframes, and apply the expression above to the scale property of solid 2.

    The values of anchor points of solid 1 in the file you shared were [0,540] and for solid 2 [960,540]. Then the position of solid 1 was [236,810] and solid 2 [1676,810].

  • Stephen Dixon

    November 5, 2020 at 6:40 am in reply to: Adobe after effects scripting

    ESTK is deprecated, Adobe recommends you use VSCode and the Extendscript Debugger add-on.

  • Not quite sure what you mean when you say

    The comps themselves don’t procedurally shift over time. I’ll still have
    to manually shift every layer to the modified transform properties

    Can you explain what you want them to do?

  • Stephen Dixon

    October 26, 2020 at 11:08 pm in reply to: Advanced After Effects Cursor Blinker

    You could do this with text animators to give yourself the flexibility of keyframes, but what you need to do with that expression is change the substr() on the last line.

    Substr takes a string (a collection of characters, like a word or a line of text) and chops it up according to its two parameters, which give you the first character (in this case 0, because we start counting at 0) and the length T, which is incremented to give you the typing effect. Then the flashing cursor is added at the end.

    We can modify that by making the substr expression only give 1 character, we do that by setting the second parameter (length) to 1, and use the incrementing T value for the start character. This will progressively give us each letter of the input string.

    We also want to precede that by as many asterisks as letters, minus one. There is a built-in javascript function repeat() that takes a character or string and, well, repeats it. So if we write “*”.repeat(T-1) that will give us an incrementing line of asterisks. The only problem is that at the start T-1 will be negative, which will cause an error, so we need to complicate it a bit. Using the Math.max() function, which returns the maximum of two values, we can make sure it never goes below 0, thus: “*”.repeat(Math.max(T-1, 0)) when T < 0 the Math.max expression will return 0.

    Putting it all together

    Speed = 10; // typing speed
    Blink = 2; // Speed of blinking cursor
    CursorType = “|” // cursor type. Usually it is a vertical line “|” or Underscore symbol ‘_’
    F = Math.round(time*Blink % 1);
    L = text.sourceText.length;
    T = (time – thisLayer.inPoint)*Speed;
    if(F ==1 | (T<L & T>0) ){Fl=CursorType;}else{Fl=””;}
    "*".repeat(Math.max(T-1,0)) + substr(T,1) + Fl
  • Try making a text layer and setting the source text using the expression to test what value landkreis is returning. E.g., put this on the source text property:

    markerNr = thisComp.layer(“Werte_Speicher”).effect(“Auswahl-MarkerNr”)(1); 
    landkreis = footage(“Landkreisauswahl.csv”).dataValue([1,markerNr]);
    landkreis

    That will tell you if the data is coming from the csv properly

  • Stephen Dixon

    October 19, 2020 at 11:02 pm in reply to: Check if comp exists before running rest of script

    If you use CEP panels you can use the setInterval() method to run a loop, but I feel like learning how to use CEP panels may be more overhead than you need.

Page 1 of 9

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