Forum Replies Created

Page 39 of 277
  • Hi Elliot, I think the easiest solution that comes to mind now is take maximum/minimum of the cos of all four corners.

    so, if the radius of the circle those 4 corners fall on is say 200 pixels:

    a = thisComp.layer("square").transform.rotation.value;
    r = 200;
    rightBoundaryX = r * Math.max(
    Math.cos(degreesToRadians(a-45))),
    Math.cos(degreesToRadians(a+45)),
    Math.cos(degreesToRadians(a+135)),
    Math.cos(degreesToRadians(a-135))
    );
    leftBoundaryX = r * Math.min(
    Math.cos(degreesToRadians(a-45)),
    Math.cos(degreesToRadians(a+45)),
    Math.cos(degreesToRadians(a+135)),
    Math.cos(degreesToRadians(a-135))
    )

    I haven’t tested this code, but I hope it sets you in the right direction

  • Filip Vandueren

    March 23, 2022 at 5:07 pm in reply to: Connect Mask Point to keyframed Null

    The script works for both masks and shapes.

  • Filip Vandueren

    March 23, 2022 at 4:43 pm in reply to: Connect Mask Point to keyframed Null

    There’s a built-in tool in after effects to do this:

    Window -> Create Nulls from Path

  • Filip Vandueren

    March 23, 2022 at 4:40 pm in reply to: Table from a CSV

    https://aescripts.com/express-table/

    seems like your ticket.

  • Hmm, no this code should work on the sourceText property of a textlayer if you have the Javascript engine enabled.

  • Filip Vandueren

    March 23, 2022 at 8:24 am in reply to: Puppet tool – Unpin / move / pin again

    Hi Stephane, you simply can’t move a puppet pin after it has been placed. Moving it is always distortion, never “relocating”, that’s just how the effect was coded.

    What I meant was, you create a new puppet pin effect, and click/create the puppet pins on your new layer in the same order. Your reference image could be dots on the face with a number besides it so you know it what order to create them.

    Then each new puppet can get an expression something like:

    var refPuppetMesh = thisComp.layer("reference animation").effect("Puppet").arap.mesh("Mesh 1");
    var thisPuppetMesh = thisProperty.propertyGroup(3);
    var myPinNr = thisProperty.propertyGroup(1).propertyIndex;
    var scaling =
    length(thisPuppetMesh.deform(1).position, thisPuppetMesh.deform(2).position)
    /
    length(refPuppetMesh.deform(1).position, refPuppetMesh.deform(2).position);
    var pos = refPuppetMesh.deform(myPinNr).position;
    value + (pos.value-pos.valueAtTime(0))*scaling;

    Note that I added some scaling, if puppet point 1 and 2 are for example two pupils, then it will give a good indication of the scale of the face in each particular portrait, because just copying the relative position would exaggerate the effect more on smaller meshes of photos with smaller faces.

    Something similar could be done for when the photos are not all exactly level, but that’s more complicated, essentially converting all pin positions to polar coordinates. Depends on how “normalized” your input photos are.

  • Filip Vandueren

    March 22, 2022 at 5:32 pm in reply to: Change layer source via expression?

    Right, it should be 1+random(…

  • Filip Vandueren

    March 22, 2022 at 3:47 pm in reply to: Change layer source via expression?

    For the basic thing (start at a random inPoint of precomp and loop):

    seedRandom(index,true);
    (time + source.layer(random(source.numLayers)).inPoint)%source.duration;

    as expression for timeremapping of a precomp.

  • Filip Vandueren

    March 22, 2022 at 2:09 pm in reply to: Freeze framing between keyframes

    Not sure what you mean by a stepping function. Did the expression i provided work ?

    Or are there mulitple repeated keyframes that you want to be able to not count ?

  • Hi Julien,

    with the new Javascript engine you can leverage Javascript’s Number internationalization, so it can automatically format a number for your desired locale.

    For example, in Germany (de) they use comma’s and put the currency symbol at the end.

    beginCount = -1999;
    endCount = 1999;
    dur = 4;
    t = time - inPoint;
    s = linear (t, 0, dur, beginCount, endCount);
    new Intl.NumberFormat('de', { style: 'currency', currency: 'USD'}).format(s);
Page 39 of 277

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