Forum Replies Created

Page 34 of 277
  • Filip Vandueren

    June 2, 2022 at 8:27 am in reply to: sampleImage() and subtraction

    I’m pretty sure the problem is that you are adding alpha values – which are floats -together and then using that total as an index to an array – which expects an integer.

    Javascript doesn’t really differentiate between Integers and Floats, they are both of class Number but javascript might display something like 1.999999999999 as 2, but that would fail as an array index.

    try this:

    x=parseInt(total-1);

    or this:

    x=Math.round(total-1);

    and it will work.

  • That would need a (possibly simple), but bespoke script.
    It depends on how easily you can programmatically determine the keyframe to change.

    For example is it always the 2nd keyframe ?, Does the Null always have the same name, or does it always use the same ‘Solid’ as a source (which would happen if you ahve always copy pasted or duplicated it)

    If it’s more a case of a human can see at a glance which keyframe it would be in the project, but a stupid computer can’t using simple rules, then it’s not possible with scripting.

  • Filip Vandueren

    May 30, 2022 at 4:01 pm in reply to: Help with Variable Color expression

    You would either.use the linear() method on the intermediate lines to calculate intermediate colors.

    so line 1’s stroke color is something like;

    thisComp.layer("control").effect("color A")("Color")

    line 10’s stroke color is:

    thisComp.layer("control").effect("color B")("Color")

    the 9 lines in between have:

    percentage=50;
    linear(percentage,0,100,
    thisComp.layer("control").effect("color A")("Color"),
    thisComp.layer("control").effect("color B")("Color")
    );

    With percentages 10,20,30,40,…90

    OR,

    you make your artwork in grayscales from dark to light and use CC Toner to map those grayscales to up to 5 tones. For an even distribution of 4 colors I would use colors between 0 and 80% gray and disregard the 5th swatch of Toner Pentone mode

  • I think you would better use Trapcode Form, which creates the Particles once at the start of the layer and keeps them alive infinitely, instead of keeping spawning 80 flowers a second, at least that’s not what the example looks like.

  • Filip Vandueren

    May 29, 2022 at 11:46 am in reply to: After Effects – Variable Text Alignment

    Correct I used the longets line,

    currently there is no (convenient) way to retrieve the actual dimensions of a text-box using expressions.

    but you could hard-code it like

    maxWidth = 3900;

    One approach of finding out the (approximate) actual width of a textbox I can think of, is to set the value of the sourceText (at a certain time) to:

    if (time==-0.01) {
    txt="|".repeat(10000);
    style.setTracking(-250).setFontSize(10).setText(txt);
    } else { value }

    then

    thisComp.layer("txt").sourceRectAtTime(-0.01).width;

    would be a pretty accurate width.

    but that’s just purely academical and not very practical (as 90% of my solutions 😉 )

  • Filip Vandueren

    May 29, 2022 at 10:15 am in reply to: After Effects – Variable Text Alignment

    Hi Lance,

    You can find an example project of mine here:

    https://imgur.com/gallery/uh1GbDu

    https://we.tl/t-3X3wBdYWIJ

  • Hi John,

    maybe this project of mine from a while ago (I can’t find the original question here on the cow) can help, I don’t have the time right now to go deeper into it:

    https://we.tl/t-t2joKsjd4q

    The original question was about squeezing a ball into a cavern, and I remember I made some mehtod that “felt” the distance to the walls by trial and error / refining over a few iterating guesses untill the radius comformed.

  • Filip Vandueren

    May 22, 2022 at 3:00 pm in reply to: Keyframes as a Var

    Motion developper has this library:

    https://motiondeveloper.com/tools/ekeys

    which allows you to do “keyframe”-like including easing animation via expressions instead of doing multiple linears/eases…

  • Filip Vandueren

    May 20, 2022 at 8:18 am in reply to: New seed for every copy of template

    Once a project is saved it has a thisProject.fullPath


    So maybe something like this:

    fp = thisProject.fullPath.toString();
    hashCode = function(str) {
    var hash = 0, i, chr;
    if (str.length === 0) return hash;
    for (i = 0; i < str.length; i++) {
    chr = str.charCodeAt(i);
    hash = ((hash << 5) - hash) + chr;
    hash |= 0; // Convert to 32bit integer
    }
    return hash;
    };
    hashCode(fp)

    That would change if you move the project to a different folder too though, so you might want to extract just the filename first ?

    Hashing function I found here: https://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript

  • Filip Vandueren

    May 19, 2022 at 11:07 am in reply to: Best de-flicker solutions in vanilla AE?

    Color stabilizer, in combination with what you mentioned (echo set to lighten) but also with a time difference matte so it is less pronounced in the places where there is a lot of local movement, this should even out the lumininance difference of say a wall, while not smudging the actual motion that’s happening

Page 34 of 277

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