Forum Replies Created

Page 53 of 277
  • This seems to work:

    seedRandom(index,true);
    moveDistance = 100;
    moveEvery = framesToTime(25);
    startPos = [960,540];
    moves=[startPos];
    possibleMoves = [[1,0],[-1,0],[0,1],[0,-1]];
    st = thisLayer.startTime;
    // create all moves up front
    for (i=0; i < (thisComp.duration - st); i+=moveEvery) {
    move = possibleMoves[ Math.floor(random(4)) ];
    lastPos = moves[moves.length-1];
    newPos = lastPos + move*moveDistance;
    moves.push(newPos);
    }
    t=(time-st)%moveEvery;
    step = Math.floor((time-st)/moveEvery);
    easeOut( t, 0, moveEvery, moves[step], moves[step+1]);
  • Something along these lines:

    nk = marker.nearestKey(time);
    nki = Math.max(1, nk.time<=time ? nk.index : nk.index-1 );
    nkt = marker.key(nki).time;
    transition = 0.3;
    s=linear(time, nkt, nkt+transition, 50+(nki*50), 100+(nki*50));
    [s,s];
  • Filip Vandueren

    May 19, 2021 at 11:50 am in reply to: Hitbox + generate a random value

    The expression has no memory of previous hits, when you ask it to create a random value.

    You have to count the number of times the hit has occured up to the current frame (using a loop and valueAtTime()) , and then you can use that total as a seed for the random value.

  • t=effect("time")("Slider").value;

    frameRateOrderOfMagnitude = Math.pow(10,-Math.floor(Math.log10(thisComp.frameDuration)));

    secs = Math.trunc(t);

    frames = timeToFrames(t-secs);

    output = secs+(frames/frameRateOrderOfMagnitude);

  • Filip Vandueren

    May 18, 2021 at 1:22 pm in reply to: figuring out why AE is slow?

    Can you post the project ?

  • Filip Vandueren

    May 18, 2021 at 10:10 am in reply to: Script request, reveal in timeline

    Here it is rewritten for specifically revealing only all paths of the selected layers. There may be a more efficient way to first find all Paths in the selected layers, my extendscripting is a bit rusty.

    app.beginUndoGroup("reveal Paths");

    selLayers = app.project.activeItem.selectedLayers;

    props=[];

    function findPaths(prop) {

    if (prop.matchName == "ADBE Vector Shape") {

    props.push(prop);

    }

    if (prop.numProperties) {

    for (var i=1; i<=prop.numProperties; i++) {

    findPaths(prop(i));

    }

    }

    }

    for (l in selLayers) {

    selLayer=selLayers[l];

    if (selLayer.matchName == "ADBE Vector Layer") {

    numGroups = selLayer("ADBE Root Vectors Group").numProperties;

    findPaths(selLayer("ADBE Root Vectors Group"),props);

    }

    }

    // prop we want to reveal:

    originalExpression=[];

    for (p=0; p < props.length; p++) {

    prop = props[p]

    originalExpression[p] = prop.expression;

    prop.expression= "1/0"; // create an expression error

    //reveal expression errors:

    }

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

    $.sleep(1); // wait 1 ms

    // reset expression to previous value

    for (p=0; p < props.length; p++) {

    props[p].expression = originalExpression[p];

    }

    app.endUndoGroup();

  • Filip Vandueren

    May 17, 2021 at 12:52 pm in reply to: Ye Olde LoopOut Problem

    Perhaps the tutorial used an expression like time*1000, and it’s applied to a property that reaches its limit of the highest number it can hold at the 1 minute mark ?

  • Filip Vandueren

    May 15, 2021 at 1:36 pm in reply to: recreating a keyboard

    It depends;

    if you precomp the keyboard as a composition where every key is lit up at a specific time, you can get the “current” character, and with a timeremap-expression, jump to the appropriate time (you would do a lookup in an array of known times “a=1, b=2;…)

    But things get more complicated with shift-buttons, switching to a different keyboard layout to type in numbers or other special characters that are on screen 2 or 3 of the keyboard interface widget, etc.

  • Filip Vandueren

    May 15, 2021 at 1:28 pm in reply to: Script request, reveal in timeline
  • Hi Nick,

    maybe something like this:

    wps=3; // wiggles per second
    seedRandom(index,true);
    for (i=0; i<=time*wps; i++) {
    prevRandom=gaussRandom(-20,20);
    }
    nextRandom = gaussRandom(-20,20);
    ease(time%(1/wps), 0, 1/wps, prevRandom, nextRandom);
Page 53 of 277

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