Forum Replies Created

Page 15 of 1081
  • I don’t know of a direct way, but you might be able to come up with a hack where you make sure just that layer is selected, add add a bad expression to the path, then do something like this:

    app.executeCommand(app.findMenuCommandId("Reveal Expression Errors"));

    then delete the expression.

  • Dan Ebberts

    October 28, 2024 at 9:08 pm in reply to: Move layer by random amount over time interval

    Ah, that would be like this:

    moveFrames = 5;
    holdFrames = 15;
    range = 200;
    moveDur = framesToTime(moveFrames);
    totalDur = framesToTime(moveFrames+holdFrames);
    seed = Math.floor(time/totalDur);
    t = time%totalDur;
    seedRandom(seed,true);
    offset1 = seed > 0 ? random([-range,-range],[range,range]) : [0,0];
    p1 = value + offset1;
    seedRandom(seed+1,true);
    offset2 = random([-range,-range],[range,range]);
    p2 = value + offset2;
    linear(t,0,moveDur,p1,p2)
  • Dan Ebberts

    October 28, 2024 at 8:07 pm in reply to: Move layer by random amount over time interval

    OK, here’s an example that will wander around in the vicinity of the layer’s original position:

    moveFrames = 15;
    range = 200;
    moveDur = framesToTime(moveFrames);
    seed = Math.floor(time/moveDur);
    t = time%moveDur;
    seedRandom(seed,true);
    offset1 = seed > 0 ? random([-range,-range],[range,range]) : [0,0];
    p1 = value + offset1;
    seedRandom(seed+1,true);
    offset2 = random([-range,-range],[range,range]);
    p2 = value + offset2;
    linear(t,0,moveDur,p1,p2) // could use ease() instead
  • Dan Ebberts

    October 28, 2024 at 7:16 pm in reply to: Move layer by random amount over time interval

    Do you want the movement constrained to a particular area, or each movement constrained to a maximum amount from the previous location?

  • Dan Ebberts

    October 24, 2024 at 12:03 am in reply to: Reading an expression from sourse text

    Yes, something like this should work:

    txt = thisComp.layer("control").text.sourceText;
    eval(txt)
  • Dan Ebberts

    October 17, 2024 at 12:59 am in reply to: Sequencing Brush Strokes!?

    Also, would love to know what error message you’re running into with the script.

  • Dan Ebberts

    October 17, 2024 at 12:57 am in reply to: Sequencing Brush Strokes!?

    Yes, so probably like this:

    tStart = inPoint;
    dur = .75;
    delay = .25;
    t1 = tStart + delay*(thisProperty.propertyGroup(3).numProperties - thisProperty.propertyGroup(2).propertyIndex);
    t2 = t1 + dur;
    linear(time,t1,t2,0,100)
  • Dan Ebberts

    October 15, 2024 at 11:40 pm in reply to: Sequencing Brush Strokes!?

    This is just pretty rough, and likely won’t meet your exact needs, but should give you an idea of possible automation. If you apply an expression like this to the End property of each brush’s Stroke Options:

    tStart = inPoint;
    dur = .75;
    delay = .25;
    t1 = tStart + delay*(thisProperty.propertyGroup(2).propertyIndex - 1);
    t2 = t1 + dur;
    linear(time,t1,t2,0,100)

    It will sequence the brush strokes. Then, instead of adding the expressions by hand, you could use a simple script like this to apply the expression to each brush:

    function addExpression(){
    var myComp = app.project.activeItem;
    if (! (myComp && myComp instanceof CompItem)){
    alert("No comp active.");
    return;
    }
    if (myComp.selectedLayers.length == 0){
    alert ("No Layer Selected.");
    return;
    }
    var myLayer = myComp.selectedLayers[0];
    var myEffects = myLayer.property("ADBE Effect Parade");
    var myPaint;
    var myStrokes;
    var myBrush;
    var expr = 'tStart = inPoint;\r' +
    'dur = .75;\r' +
    'delay = .25;\r' +
    't1 = tStart + delay*(thisProperty.propertyGroup(2).propertyIndex - 1);\r' +
    't2 = t1 + dur;\r' +
    'linear(time,t1,t2,0,100)\r';
    for (var i = 1; i <= myEffects.numProperties; i++){
    if (myEffects.property(i).matchName == "ADBE Paint"){
    myPaint = myEffects.property("ADBE Paint");
    myStrokes = myPaint.property("ADBE Paint Group");
    for (var i = 1; i <= myStrokes.numProperties; i ++){
    if (myStrokes.property(i).matchName == "ADBE Paint Atom"){
    myStrokes.property(i).property("ADBE Paint Properties").property("ADBE Paint End").expression = expr;
    }
    }
    }
    }
    }
    addExpression();

    I hope that’s helpful.

  • Dan Ebberts

    October 11, 2024 at 3:54 pm in reply to: Change rate of movement between two points

    If it needs to loop, I think I’d approach it a little differently:

    p1 = [100,100];
    p2 = [500,500];
    spd = 100; // pixels per second
    tTot = length(p1,p2)/spd;
    tStart = inPoint;
    t = Math.max((time-tStart)%tTot,0);
    linear(t,0,tTot,p1,p2)
  • Dan Ebberts

    October 10, 2024 at 7:50 pm in reply to: Change rate of movement between two points

    This is a pretty general solution that should work OK. You can tie variable spd to a slider (as long as you don’t animate the slider):

    p1 = [100,100];
    p2 = [500,500];
    spd = 100; // pixels per second
    tStart = inPoint;
    v = normalize(p2 - p1);
    t = Math.max(time-tStart,0);
    d = Math.min(spd*t, length(p1,p2));
    p1 + v*d;
Page 15 of 1081

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