Forum Replies Created

Page 30 of 1081
  • Dan Ebberts

    March 9, 2024 at 5:25 pm in reply to: 3D Position to Angle

    Really hard to say without seeing it, but I suspect it will end up looking something like this:

    L = thisComp.layer(“Light_POS”);

    p1 = L.toWorld(L.anchorPoint);

    p2 = toWorld(anchorPoint);

    v = p1 – p2;

    v2 = fromWorldVec(v);

    -radiansToDegrees(Math.atan2(v2[1],v2[0]))

  • Dan Ebberts

    March 9, 2024 at 1:15 am in reply to: 3D Position to Angle

    What 2D effect are you using? It might help to post a diagram of exactly what you’re trying to do.

  • Dan Ebberts

    March 5, 2024 at 8:01 pm in reply to: Dynamically Distribute Text Layers Horizontally

    If I understand what you’re asking, this should work:

    xPos = thisComp.layer("controls").effect("Left X")("Slider");
    gap = thisComp.layer("controls").effect("Gap")("Slider");
    firstLayer = 1;
    curEdge = 0;
    for(i = firstLayer; i <= index; i++){
    L = thisComp.layer(i);
    r = L.sourceRectAtTime(time,false);
    w = r.width;
    if (i == index) myOffset = r.left;
    if (i < index) curEdge += w + gap;
    }
    x = xPos + curEdge - myOffset;
    [x,value[1]]
  • Dan Ebberts

    March 1, 2024 at 10:06 pm in reply to: stardust angle random keyframe wont work

    Have you tried submitting a trouble ticket on the aescripts site? Sounds like a question for the developer.

  • Dan Ebberts

    March 1, 2024 at 12:32 am in reply to: Script for Precomping Text

    The plain vanilla version (no position keyframes, no scaling) would look something like this (replaces your copyToComp line):

    comp.layer(selectedLayer.name).copyToComp(newComp);
    var newLayer = newComp.layer(1);
    var rect = newLayer.sourceRectAtTime(0,false);
    newLayer.property("Position").setValue([-rect.left, -rect.top]);
  • Dan Ebberts

    February 28, 2024 at 6:24 pm in reply to: seedrandom vs random

    See if this helps:

    https://ae-expressions.docsforadobe.dev/random-numbers.html

  • >I can’t seem to figure out how to store the variable for reference in the next frame

    You can’t. Expressions have no memory. There’s no way for a variable to survive from frame to frame. What an expression can do, is examine previous pre-expression values, using .valueAtTime() to re-create previous calculations. This is a an expression I have in the archive that implements a vu meter with a 300 ms decay, which you may find useful:

    decay = .3; // 300 ms
    a = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");
    maxVal = a.value;
    t = thisComp.frameDuration;
    while (t < decay){
    temp = a.valueAtTime(time - t);
    maxVal = Math.max(maxVal, easeOut(t,0,decay,temp,0));
    t += thisComp.frameDuration;
    }
    maxVal

  • Dan Ebberts

    February 21, 2024 at 5:38 pm in reply to: Generate an array for a drop-down list using n values

    That’s not the kind of thing you can do with an expression. An expression can only modify the value of the property it’s applied to, so if it’s not something you can keyframe you won’t be able to do it with an expression.

    You could do it with a script, but it wouldn’t be automatic–you’d have to run the script each time you wanted to update the drop-down.

  • Dan Ebberts

    February 21, 2024 at 5:28 pm in reply to: Get text from a layer in another comp

    This is not an area I’m very familiar with, but I think you can do what you want with Master Properties. You’d add the text from your nested precomp to the Essential Graphics panel, then, in each comp that has the nested precomp you will have an Essential Properties section where you can modify the text with an expression (I think).

  • This is a keyframe overshoot expression from my site, which I’ve modified to skip the overshoot unless the checkbox is on at that keyframe. It may not exactly fit whatever you’re using for overshoot, but hopefully it will give you an idea on how to incorporate the checkbox.

    cb = effect("Checkbox Control")("Checkbox");
    freq = 3;
    decay = 5;
    n = 0;
    if (numKeys > 0){
    n = nearestKey(time).index;
    if (key(n).time > time) n--;
    }
    if (n > 0 && cb.valueAtTime(key(n).time)){
    t = time - key(n).time;
    amp = velocityAtTime(key(n).time - .001);
    w = freq*Math.PI*2;
    value + amp*(Math.sin(t*w)/Math.exp(decay*t)/w);
    }else
    value
Page 30 of 1081

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