Forum Replies Created

Page 58 of 1081
  • Dan Ebberts

    January 24, 2023 at 5:02 am in reply to: Any way to replace a layer's solid source ?

    It depends on how you want to do it exactly. Here’s an example that replaces layer Solid 2’s source with layer Solid 1’s source:

    var myComp = app.project.activeItem;
    var source = myComp.layer("Solid 1").source;
    myComp.layer("Solid 2").replaceSource(source,false);
  • Dan Ebberts

    January 24, 2023 at 1:30 am in reply to: Any way to replace a layer's solid source ?

    Maybe just Alt+drag from the Solids folder in the Project panel onto the layer?

  • I wish I could help, but I don’t get it. Maybe somebody else will…

  • I’m not sure exactly what you’re after, but if you wanted to delay the effect of an animated stagger slider based on textIndex, you would stick something like this in there (not tested):

    delay = .1;
    myDelay = delay*(textIndex-1);
    stggr = effect("Stagger")("Slider").valueAtTime(time-myDelay);
  • Dan Ebberts

    January 21, 2023 at 5:29 pm in reply to: Increase a value every time an event occurs

    Probably because I didn’t read your previous question correctly. 🙂

    Try this one:

    p = thisComp.layer("Target").position;
    animateFrames = 15;
    lim = 60;
    d = p.valueAtTime(0) - position;
    triggered = Math.abs(d[0]) <= 60 && Math.abs(d[1]) <= 60;
    fCur = timeToFrames(time);
    f = 1;
    fSave = 0;
    n = 0;
    while (f <= fCur){
    d = p.valueAtTime(framesToTime(f)) - position;
    if (triggered){
    if (Math.abs(d[0]) > 60 || Math.abs(d[1]) > 60){
    triggered = false;
    }
    }else{
    if (Math.abs(d[0]) <= 60 && Math.abs(d[1]) <= 60){
    n++;
    triggered = true;
    fSave = f;
    }
    }
    f++
    }
    r = 0;
    if (n > 0){
    r = (n-1)*90 + ease(fCur-fSave,0,animateFrames,0,90);
    }
    value + r
  • Dan Ebberts

    January 21, 2023 at 7:27 am in reply to: Increase a value every time an event occurs

    I think you’d have to double up on everything, like this maybe:

    p = thisComp.layer("Target").position;
    animateFrames = 15;
    triggeredH = p.valueAtTime(0)[0] >= position[0];
    triggeredV= p.valueAtTime(0)[1] >= position[1];
    fCur = timeToFrames(time);
    f = 1;
    fSaveH = 0;
    fSaveV = 0;
    nH = 0;
    nV = 0;
    while (f <= fCur){
    if (triggeredH){
    if (p.valueAtTime(framesToTime(f))[0] < position[0]){
    triggeredH = false;
    }
    }else{
    if (p.valueAtTime(framesToTime(f))[0] >= position[0]){
    nH++;
    triggeredH = true;
    fSaveH = f;
    }
    }
    if (triggeredV){
    if (p.valueAtTime(framesToTime(f))[1] < position[1]){
    triggeredV = false;
    }
    }else{
    if (p.valueAtTime(framesToTime(f))[1] >= position[1]){
    nV++;
    triggeredV = true;
    fSaveV = f;
    }
    }
    f++
    }
    rV = 0;
    rH = 0;
    if (nH > 0){
    rH = (nH-1)*90 + ease(fCur-fSaveH,0,animateFrames,0,90);
    }
    if (nV > 0){
    rV = (nV-1)*90 + ease(fCur-fSaveV,0,animateFrames,0,90);
    }
    value + rV + rH
  • Dan Ebberts

    January 21, 2023 at 4:47 am in reply to: ExtendScript: Add Keyframe to Range Selector?

    Like this, I think:

    var kfTime = 1;
    var kfValue = 0;
    var myLayer = app.project.activeItem.layer("My text");
    myLayer.property("Text").property("Animators").property("Animator 1").property("Selectors").property("Range Selector 1").property("Start").setValueAtTime(kfTime,kfValue);
  • Dan Ebberts

    January 20, 2023 at 1:45 am in reply to: Start counting frames from inPoint

    This should work:

    timeToFrames(time-inPoint)
  • In theory you could probably do that. You’d have to document all the steps you used to create the animation and covert that to script code. The script would also need a UI where your team could enter new values to modify the animation. Depending on how much work went into setting it up in the first place, this could turn out to be a significant effort.

  • Dan Ebberts

    January 19, 2023 at 7:00 pm in reply to: Increase a value every time an event occurs

    Something like this maybe:

    p = thisComp.layer("Target").position;
    animateFrames = 15;
    triggered = p.valueAtTime(0)[1] >= position[1];
    fCur = timeToFrames(time);
    f = 1;
    fSave = 0;
    n = 0;
    while (f <= fCur){
    if (triggered){
    if (p.valueAtTime(framesToTime(f))[1] < position[1]){
    triggered = false;
    }
    }else{
    if (p.valueAtTime(framesToTime(f))[1] >= position[1]){
    n++;
    triggered = true;
    fSave = f;
    }
    }
    f++
    }
    r = 0;
    if (n > 0){
    r = (n-1)*90 + ease(fCur-fSave,0,animateFrames,0,90);
    }
    value + r
Page 58 of 1081

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