Forum Replies Created

Page 40 of 1081
  • This might get you close. It doesn’t matter what the value of the slider is, the expression just looks at the timing of the keyframes. At the 2nd keyframe, it will ease into the second value of your array, and so on.

    easeTime = framesToTime(10); // ease for 10 frames
    //Define position values
    posOptions = [320, 360, 400, 440, 480];
    //Slider to select position from array
    rowSelect = thisLayer("Effects")("rowSelect")("Slider");
    newY = posOptions[0];
    if (rowSelect.numKeys > 0){
    n = rowSelect.nearestKey(time).index;
    if (time < rowSelect.key(n).time) n--;
    n = Math.min(n,posOptions.length);
    if (n == posOptions.length){
    newY = posOptions[n-1];
    }else if (n > 0){
    y1 = posOptions[n-1];
    y2 = posOptions[n];
    t2 = rowSelect.key(n+1).time;
    t1 = t2 - easeTime;
    newY = ease(time,t1,t2,y1,y2);
    }
    }
    //Final position
    [960,newY];
  • Dan Ebberts

    September 20, 2023 at 6:07 pm in reply to: Text style expressions just don’t work

    Most likely you have File > Project Settings > Expressions set to the Legacy ExtendScript engine. The other possibility is that you’re using an older version of AE.

  • Try it this way:

    var src = thisComp.layer("INPUT").text.sourceText;
    var key1 = src.split(" ")[0];
    var key2 = src.split(" ")[1]; // used in a different layer
    var key3 = src.split(" ")[2]; // used in a different layer
    var txt = key1
    var fSize = thisComp.layer("Controllers").effect("Font Size")(1); // Slider
    style.setText(txt).setFontSize(fSize)
  • Dan Ebberts

    September 16, 2023 at 11:24 pm in reply to: Translate 3D layers intersection to Linear Wipe

    A general solution to this would be pretty complex. To start, I think you’d have to calculate the line that represents the intersection of the two planes, which involves some serious math. It might be simpler if there are some know constraints about how the planes can intersect, but you didn’t mention anything like that.

  • Dan Ebberts

    September 15, 2023 at 12:10 am in reply to: get global rotation / orientation of a child object

    Here’s another way to do it:

    L = thisComp.layer("child");
    v = L.toCompVec([1,0,0]);
    radiansToDegrees(Math.atan2(v[1],v[0]));
  • It will look something like this (although this may not be exactly right depending on what should happen if there are no markers, or other markers besides IN and OUT):

    m = marker;
    v1 = 2000;
    v2 = 5000;
    val = v1;
    if (m.numKeys > 0){
    n = m.nearestKey(time).index;
    if (time < m.key(n).time) n--;
    if (n > 0){
    if (m.key(n).comment == "IN"){
    val = v1;
    if (n < m.numKeys && m.key(n+1).comment == "OUT"){
    val = ease(time,m.key(n).time,m.key(n+1).time,v1,v2);
    }
    }else if (m.key(n).comment == "OUT"){
    val = v2;
    if ( n < m.numKeys && m.key(n+1).comment == "IN"){
    val = ease(time,m.key(n).time,m.key(n+1).time,v2,v1);
    }
    }
    }
    }
    val
  • Dan Ebberts

    September 2, 2023 at 7:16 pm in reply to: Get 3D position given the 3D angle and distance

    I think I’d set it up with a slider for radius and angle controls for altitude and azimuth, like this:

    r = effect("Radius")("Slider");
    a = effect("Altitude")("Angle");
    az = effect("Azimuth")("Angle");
    center = [thisComp.width/2,thisComp.height/2,0];
    aRad = degreesToRadians(a);
    azRad = degreesToRadians(az);
    y = r*Math.sin(aRad);
    rXZ = r*Math.cos(aRad);
    x = rXZ*Math.cos(azRad);
    z = rXZ*Math.sin(azRad);
    center + [x,y,z]

  • Dan Ebberts

    August 25, 2023 at 1:18 pm in reply to: valueAtTime for multiple markers

    Try it this way:

    m = thisComp.layer("MARKER").marker;
    animation= thisComp.layer("LEAD ANIMATION").transform.opacity;
    tag = thisLayer.name;
    t = 0;
    if (m.numKeys > 0){
    nk = m.nearestKey(time).index;
    if (time < m.key(nk).time) nk--;
    while (nk > 0){
    if (m.key(nk).comment == tag) break;
    nk--;
    }
    t = nk > 0 ? time - m.key(nk).time : 0;
    }
    animation.valueAtTime(t)
  • It won’t work if you have multiple, per-character, styles defined in your master text layer (multiple fonts, for example). If not, something like this source text expression should work:

    txt = comp("Main").layer("Master Text").text.sourceText;
    txt.style.setText(txt)
  • Dan Ebberts

    August 19, 2023 at 12:30 am in reply to: Use markers to control camera position?

    That does kind of make it look like I’m just talking to myself. Would it be possible to leave the questions (without the author’s name) to give some context to my answers?

Page 40 of 1081

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