Forum Replies Created

Page 19 of 1081
  • Dan Ebberts

    August 6, 2024 at 11:39 pm in reply to: Script execute error

    Did you try filing a trouble ticket on aescripts.com? That seems like the best way to get it resolved.

  • Actually, that last one isn’t quite right. This should be better:

    var mySelection = app.project.selection;
    var myComp, delta;
    for (var i = 0; i < mySelection.length; i++){
    myComp = mySelection[i];
    if (! (myComp instanceof CompItem)) continue;
    for (var j = myComp.numLayers; j >1; j--){
    if (myComp.layer(j).locked) continue;
    for (var k = j -1; k > 0; k--){
    if (myComp.layer(k).locked) continue;
    delta = myComp.layer(j).outPoint - myComp.layer(k).inPoint;
    myComp.layer(k).startTime +=delta;
    break;
    }
    }
    }
  • Try this:

    var mySelection = app.project.selection;
    var myComp, delta;
    for (var i = 0; i < mySelection.length; i++){
    myComp = mySelection[i];
    if (! (myComp instanceof CompItem)) continue;
    for (var j = myComp.numLayers; j >1; j--){
    if (myComp.layer(j).locked) continue;
    for (var k = j -1; k > 0; k--){
    if (myComp.layer(k).locked) continue;
    delta = myComp.layer(j).outPoint - myComp.layer(k).inPoint;
    myComp.layer(k).startTime +=delta;
    }
    }
    }
  • What should it do when it encounters a locked layer?

  • It seems like it should be pretty straightforward. Something like this maybe:

    var mySelection = app.project.selection;
    var myComp, delta;
    for (var i = 0; i < mySelection.length; i++){
    myComp = mySelection[i];
    if (! (myComp instanceof CompItem)) continue;
    for (var j = myComp.numLayers; j >1; j--){
    delta = myComp.layer(j).outPoint - myComp.layer(j-1).inPoint;
    myComp.layer(j-1).startTime +=delta;
    }
    }
  • Dan Ebberts

    July 29, 2024 at 9:11 pm in reply to: looping but with a pause feature?

    Other than a few basic JavaScript manipulations, I think you’ll find everything I used there in the Expressions Language Reference section of AE’s help, specifically in the Properties Attributes and Methods and the Key Attributes and Methods sections.

  • If these are all instances of the same precomp (i.e. it only shows up as one entity in the project panel), I don’t think there’s a way. They would need to be separate precomps, with unique names.

  • Dan Ebberts

    July 26, 2024 at 10:35 pm in reply to: looping but with a pause feature?

    Try this:

    p = thisComp.layer("N FX").effect("Checkbox Control")("Checkbox");
    t = 0;
    if (p.numKeys > 0){
    n = p.nearestKey(time).index;
    if (p.key(n).time > time) n--;
    if (n > 0){
    for (i = 1; i <= n; i++){
    if (p.key(i).value == true){
    if (i < n){
    t += p.key(i+1).time - p.key(i).time;
    }else{
    t += time - p.key(i).time;
    }
    }
    }
    }
    }
    if (numKeys > 1){
    if (t > key(numKeys).time){
    t = key(1).time + (t - key(numKeys).time)%(key(numKeys).time - key(1).time);
    }
    }
    valueAtTime(t)
  • Dan Ebberts

    July 26, 2024 at 9:54 pm in reply to: looping but with a pause feature?

    How were you thinking of controlling the hold time?

  • Dan Ebberts

    July 22, 2024 at 6:15 am in reply to: Error else/if expression

    There are some issues, just from a syntax standpoint. This gets rid of the errors, but I don’t if it does what you were hoping for. If not, let us know what it is that you want it to do.

    fps = 1/ thisComp.frameDuration;
    lt = thisComp.layer("Speed Control").effect("Animation 1")("Menu").value;
    if (lt==1) {
    li=1*fps;
    lo=1*fps;
    }else if (lt==2) {
    li=2*fps;
    lo=2*fps;
    }else {
    li=3*fps;
    lo=3*fps;
    }
    m1 = 0;
    m2 = framesToTime(li);
    m3 = framesToTime(lt-lo);
    m4 = framesToTime(lt);
    k1 = 0;
    k2 = framesToTime(30);
    k3 = framesToTime(30);
    k4 = framesToTime(0);
    if(time < m2) {
    linear(time, m1, m2, k1, k2);
    } else if(time < m3) {
    linear(time, m2, m3, k2, k2);
    } else {
    linear(time, m3, m4, k2, k2);
    }
Page 19 of 1081

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