Forum Replies Created

Page 64 of 1081
  • I guess there would be a couple of approaches. One would be to sample the value at a small amount of time on both sides of the target time and use those to calculate the velocity. Or, temporarily apply an expression, harvest the value, and delete the expression.

  • Dan Ebberts

    December 13, 2022 at 7:40 am in reply to: .Mogrt templates – two different fonts on same line

    Assuming your FIRST NAME layer is named “First Name”, a position expression for you last name like this should work:

    gap = 20;
    L = thisComp.layer("First Name");
    r1 = L.sourceRectAtTime(time,false);
    r2 = sourceRectAtTime(time,false);
    hisRight = L.toComp([r1.left+r1.width,r1.top+r1.height])[0];
    myLeft = toComp([r2.left,r2.height])[0];
    value + [hisRight - myLeft + gap,0]
  • Dan Ebberts

    December 11, 2022 at 12:52 am in reply to: Why does my script makes After Effects crash?

    You could capture the error using try/catch, like this example:

    var myLayer = app.project.activeItem.layer(1);
    var myEffect = "xxxx";
    try{
    myLayer.property("Effects").addProperty(myEffect);
    }catch(err){
    alert('"' + myEffect + '" is not a valid effect name.');
    }
  • Dan Ebberts

    December 9, 2022 at 5:30 pm in reply to: Markers call animations

    For fill color, you should be able to just change the last line to this:

    action.effect("Fill")("Color").valueAtTime(curT)
  • It might be that you just need something like this:

    src = slider;
    if (src <= 8){
    x = linear(src,4,8,10,20);
    }else if (src < 21){
    x = 25;
    }else{
    x = linear(src,21,28,110,120);
    }

    but the fact that you’re using the word “trigger” makes me nervous…

  • Dan Ebberts

    December 8, 2022 at 5:45 pm in reply to: Logical Operator "Or" and Drop Down Menus

    This should work:

    m = comp("blind_resume_template").layer("blind_resume_control").effect("Sport")("Menu");
    (m == 3 || m == 4) ? 100 : 0
  • Dan Ebberts

    December 7, 2022 at 5:11 pm in reply to: Getting active layer count at current time

    This should count all layers with BlueBox in the layer name:

    n = 0;
    keyword = "BlueBox";
    for (i = 1; i <= thisComp.numLayers; i++){
    if (thisComp.layer(i).name.indexOf(keyword) > -1) n++;
    }
    n
  • Maybe something like this:

    E = thisComp.layer("Effector");
    radius = 500;
    stepSize = [10,0];
    minHold = .1;
    maxHold = .5;
    offset = [10,0];
    curOffset = [0,0];
    t = inPoint;
    while (t <= time){
    d = length(E.position,position+curOffset);
    t += linear(d,0,radius,maxHold,minHold);
    curOffset += offset;
    }
    value + curOffset - offset;
  • Dan Ebberts

    December 6, 2022 at 10:28 pm in reply to: Simple X and Y offset

    What do you mean by “1st layer”, “2nd layer”, etc.?

    If you mean that you have a chain of parented layers and you want each one farther down the chain to have more offset, you could do something like this:

    L = thisLayer;
    offset = 100;
    while(L.hasParent){
    offset += 10;
    L = L.parent;
    }
    value + offset
  • Dan Ebberts

    December 5, 2022 at 7:52 pm in reply to: Markers call animations

    Ah yes. So if you just wanted to map the scale property actions of your button markers to the scale property marker animations on your null, you’d to need to modify it to something like this:

    action = thisComp.layer("ANIM BUTTON");
    n = 0;
    if (marker.numKeys > 0){
    n = marker.nearestKey(time).index;
    if (marker.key(n).time > time){
    n--;
    }
    }
    if (n == 0){
    curT = 0;
    }else{
    m = marker.key(n);
    myComment = m.comment;
    t = time - m.time;
    try{
    actMarker = action.marker.key(myComment);
    if (action.marker.numKeys > actMarker.index){
    tMax = action.marker.key(actMarker.index + 1).time - actMarker.time - thisComp.frameDuration;
    }else{
    tMax = action.outPoint - actMarker.time;
    }
    t = Math.min(t, tMax);
    curT = actMarker.time + t;
    }catch (err){
    curT = 0;
    }
    }
    action.scale.valueAtTime(curT)
Page 64 of 1081

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