Forum Replies Created

Page 6 of 277
  • Filip Vandueren

    July 18, 2023 at 9:47 am in reply to: Circle shape and repeater

    Yes,

    put an expression on “Copies”:

    startPos = thisComp.layer("start").transform.position.value;
    endPos = thisComp.layer("end").transform.position.value;
    spacing = 100;
    Math.ceil(length(startPos,endPos)/spacing);

    It’s not going to be smooth, as extra circles pop into existance and they are distributed form start to end. So maybe that’s not exactly the look you are going for.

  • Filip Vandueren

    July 18, 2023 at 9:33 am in reply to: Circle shape and repeater

    BTW, because of how the repeater works, the scaling is applied mulitple times, so the final scale is depending on the number of copies. If you want to control this (for example the end should always be 300% larger than the start, you can use this expression for repeater:scale:

    endScale = 3; //300%
    numCopies = Math.max(2,content("Repeater 1").copies); // minimum is 2 copies
    Math.pow(endScale,1/(numCopies-1)) * [100,100];
  • Filip Vandueren

    July 18, 2023 at 9:25 am in reply to: Circle shape and repeater

    If you want to change the scaling with the repeater, wet the repeater’s anchorPoint to be at the center of the original circle. Either by giving it the same expression:

    startPos = thisComp.layer("start").transform.position.value;
    fromComp(startPos);

    or by simply pickwhipping to the circle’s position:

    content("Ellipse Path 1").position;
  • Filip Vandueren

    July 18, 2023 at 8:47 am in reply to: Circle shape and repeater

    Hi Hamood,

    suppose there are two Nulls called “start” and “end” (they are not parented to anything.)

    Make a shape layer, add a circle (and a stroke or fill)

    Circle’s position gets this expression:

    startPos = thisComp.layer("start").transform.position.value;
    fromComp(startPos);

    Add a repeater.

    the Transform:Position parameter of the repeater gets this expression:

    startPos = thisComp.layer("start").transform.position.value;
    endPos = thisComp.layer("end").transform.position.value;
    numCopies = Math.max(2,content("Repeater 1").copies); // minimum is 2 copies for start and end
    (endPos - startPos) / (numCopies-1);

    You can now change the “Copies” property of the repeater to get more inbetween steps.

    (Or hook that up to a slider control)

  • Filip Vandueren

    July 18, 2023 at 8:14 am in reply to: Countdown timer dont show decimals

    Hello René,

    since you may be dealing with negative numbers, I would use Math.trunc()for the minutes instead of the more common floor().

    nums = ((-time+thisComp.layer("Settings").effect("Seconds")("Slider"))/60)+thisComp.layer("controls").effect("pocet-minut")("Slider");
    mins = Math.abs(Math.trunc(nums));
    secs = Math.abs(Math.floor(60*nums%60));
    (Math.sign(nums)==-1 ? "-":"") + mins.toString().padStart(2,"0") +":" + secs.toString().padStart(2,"0");

    if you get an error that .trunc() and .sign() aren’t defined, you have to set the Expressions engine of the project-settings to”Javascript”.

    (Edit: I changed a few things to get less floating point rounding errors, so the seconds change more consistently on the same frame)

  • Filip Vandueren

    July 16, 2023 at 11:22 am in reply to: Subdivide a path

    It depends on why you want to subdivide the path.

    If you’re only after a visual representation of the segments, you can use trim Paths which works with percentages so only that part of the path receives a stroke/fill.

    If you need an actual copy of a section of the Path, it’s a bit trickier: an expression can copy the points and tangents of another path, or get a location at a certain percentage along the path (pointOnPath), but AFAIK there’s no built-in way to combine the two: you don’t know how far along the length of a path a certain point lies, so that needs some code/logic

  • It looks like you are testing for the case that a letter with an ascender will change the sourceRect.

    A good alternative is to change all characters to a character that has full height for your font (using a text animator) and check the sourceRect.

    You can do that on a second hidden text-layer, or there are tricks to do it on the same layer: in negative time, inbetween frames so you would do sourceRectAtTime(-1) and have a text animator with change character that’s only active if time<0

  • I would leverage Javascript’s own method for formatting numbers like this:

    numSlider= effect("Slider Control")("Slider").value;
    new Intl.NumberFormat('en-US', {notation: 'compact', maximumFractionDigits: 2}).format(numSlider);

    A possible downside is that it uses rounding and not floor, so 1599 is 1.6K and 1609 is 1.61K

    The positive thing is that it automatically does K, M, B, T and if you select a different language/region, it will use the correct for that region.

    For example use ‘ms’ instead of ‘en-US’ and it will be K, J, B, T for Malaysian ‘juta’

    use ‘fr-FR’ and you’ll get k M Md Bn (the French convention) but use ‘fr-CA’ and you get k M G T (the Canadian convention)

  • Filip Vandueren

    July 10, 2023 at 10:27 am in reply to: Revit files to After Effects

    I’ve never worked with revit, but the lateste versions of After Effects offer some limited support for importing 3D models directly without the use of 3rd party plugins like Element3D:

    Start here:

    https://helpx.adobe.com/be_en/after-effects/using/faq-3d-model-import-in-after-effects.html

  • Filip Vandueren

    July 7, 2023 at 9:23 pm in reply to: Texts in two line

    Hi Arun,

    That is correct, the only way I know to calculate the best fontsize for a wrapping textbox is to try all of them and then choose the first one that fits less than 3 lines.

    So the first layer (shrinking) is necessary, but it should be hidden.

    The 2nd layer is based on a slider, because if you set it up correctly, the 1st slider contains an expression that looks up the correct font size, and the second slider is what you asked: manual control of the leading.

    The first (hidden, shrinking) textlayer’s sourceText should be added to your mogrt, it will give a warning that you are adding a property with an expression, but that is ok.

    The second visible textlayer will copy the text and style of the 1st with the correct fontsize and leading.

Page 6 of 277

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