Forum Replies Created

  • Saulo Dal pozzo

    March 20, 2025 at 8:20 am in reply to: RANDOMLY DISTRIBUTE INSIDE CIRCLE

    Thanks Dan! I still have trouble with all the Math functions, so generally I avoid them. I’ll try to make sense of what you did 😉

  • Saulo Dal pozzo

    March 19, 2025 at 9:57 am in reply to: RANDOMLY DISTRIBUTE INSIDE CIRCLE

    Found another thread that helped me get the distribution in the image (I also needed to avoid the area of the screen)

    The expression ended up like this:

    seedRandom(index,true);

    var center = [width/2,height/2];

    var r = center[0]+thisComp.layer(“NULL “).effect(“RADIUS”)(“Slider”);

    var pX = random(center[0]-r,center[0]+r);

    if (pX > 0 && pX < width){

    pY = center[1];

    while (pY > 0 && pY < height) pY = random(center[1]-r,center[1]+r);

    }else{

    pY = random(center[1]-r,center[1]+r);

    }

    var pos = [pX, pY];

    if (length(center,pos)>r){

    pos = center + r*(pos-center)/length(center,pos);

    }

    pos

    Now I’ll try to find a way to avoid the layers from peeking in at the screen based on their size. I also feel that it’s not that evenly distributed, but it’s fine for now

  • Saulo Dal pozzo

    March 20, 2024 at 5:33 pm in reply to: Layer width as it moves on Z axis

    I knew you would be the one to solve this! I had to adapt it a bit to fit my original plan, which was to have a line snap to the corner of an ellipse as if it was touching it. I’ll upload the results, this is the finished line of expression:

    // LAYERS

    posP = thisComp.layer(“LINHA: Path 1 [1.1.2]”).transform.position;

    bola = thisComp.layer(“BOLA-AZUL”);

    diametro = thisComp.layer(“BOLA-AZUL”).content(“Ellipse 1”).content(“Ellipse Path 1”).size;

    posB = bola.toComp(bola.anchorPoint);

    pontaB = bola.toComp(bola.anchorPoint + [diametro[0]/2,0]);

    posB3D = [posB[0],posB[1]];

    // SPECULATIVE

    raio = sub(pontaB,posB)[0];

    c = sub(posB, posP);

    modc = length(posP,posB3D);

    alfa = -Math.acos(c[0]/modc);

    theta = Math.asin(raio/modc);

    beta = alfa-theta;

    modv = Math.sqrt(Math.pow(modc,2)+Math.pow(raio,2));

    v = [Math.cos(beta)*modv, Math.sin(beta)*modv];

    add(posP, v)

  • Hey, have you checked if your client’s After Effects is using the legacy version of the expression language?

    Another possibility is different languages on the program itself, if you’re using it as en_US and he’s using another language, it could cause issues.

  • Saulo Dal pozzo

    January 31, 2023 at 6:45 pm in reply to: Random intervals between LoopOut (‘pingpong’)

    Worked like a charm! Thanks a lot

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