Forum Replies Created

Viewing 1 - 10 of 50 posts
  • Patrick Grossien

    July 2, 2022 at 5:14 pm

    Hi Dan, it seems to do the trick to paste the code, then mark all, then set the Textstile to code. Doing it the other way round creates the double returns for me, too. (see above)

  • Patrick Grossien

    July 2, 2022 at 5:13 pm

    seedRandom(index, true);

    colSwtCTRL_Layer = comp("Col Swatches SELECTOR").layer("GLOBAL COL CTRL Outlines");

    colSwt_Layer = colSwtCTRL_Layer.effect("Layer Control")("Layer");

    cFROM = colSwtCTRL_Layer.effect("Color Swatches ā€“ Select FROM")("Slider");

    cTO = colSwtCTRL_Layer.effect("Color Swatches ā€“ Select TO")("Slider");

    maxSWATCHES = colSwtCTRL_Layer.effect("max SWATCHES")("Slider");

    if(cTO > maxSWATCHES) {cTO = maxSWATCHES};

    cNUDGE = Math.floor(effect("nudge selected color")("Slider"));

    c = clamp(1, maxSWATCHES, Math.floor(random(cFROM, cTO))+cNUDGE);

    colSwt_Layer.content(c).content("Fill 1").color;

  • Patrick Grossien

    July 1, 2022 at 7:58 pm

    Sorry – Iā€™m not sure – for me it just works like that.

    Iā€™m on a mac, copying / pasting straight from AE and then marking the text and styling it after having it pasted

    It could differ depending on the source / origin app of the copied text maybe? Or if you start the style first and then paste/ type into the code style and not the other way round?

    Just guess work though šŸ™ˆšŸ™ˆšŸ™ˆ sorry.

  • Patrick Grossien

    July 1, 2022 at 5:16 pm
    // Color Swatch Picker
    // shuffle array function
    function shuffle(a) {
    seedRandom(index,true);
    for (i = a.length - 1; i > 0; i--) {
    j = Math.floor(random() * (i + 1));
    temp = a[i];
    a[i] = a[j];
    a[j] = temp;
    }
    }
    // define variables
    colSwtCTRL_Layer = comp("Col Swatches SELECTOR").layer("GLOBAL COL CTRL Outlines");
    colSwt_Layer = colSwtCTRL_Layer.effect("Layer Control")("Layer");
    cFROM = colSwtCTRL_Layer.effect("Color Swatches ā€“ Select FROM")("Slider");
    cTO = colSwtCTRL_Layer.effect("Color Swatches ā€“ Select TO")("Slider");
    maxSWATCHES = colSwtCTRL_Layer.effect("max SWATCHES")("Slider");
    if(cTO > maxSWATCHES) {cTO = maxSWATCHES}; // only needed if there's a sub definition smaller than the swatches
    // put swatches into array
    array = [];
    for (i = cFROM; i <= cTO; i++){ // build the array
    array.push(i);
    }
    shuffle(array);
    // define new color swatch every second - repeated if time > array length
    t = Math.floor(time-inPoint);
    c = array[t%array.length] // using odulo to repeat array
    colSwt_Layer.content(c).content("Fill 1").color;
  • Patrick Grossien

    July 1, 2022 at 5:11 pm

    Oh wow… it can be so simple a script, if you know what you’re doing šŸ˜… I was fighting with while / if / for loops but this … oh my. Thank you!!!!

    ended up doing the following and it works perfectly!

    t = Math.floor(time-inPoint);
    c = array[t%array.length]
    colSwt_Layer.content(c).content("Fill 1").color;
  • Patrick Grossien

    July 1, 2022 at 4:25 pm

    Dan, thanks a million!

    I am almost getting it to work. I now stumbled across a situation where the swatches are less than the cycles it goes through, thus needing to start the count through the array again.

    Will need to fiddle with this. But this is the perfect direction for it! Thank you!

  • Patrick Grossien

    July 1, 2022 at 9:46 am

    Ok I partially figured it out with help of a different post. But now : is there a way to make sure a number is not used twice or at least not twice right behind each other?

    // Color Swatch Picker
    var holdTime = 1;
    seedRandom(Math.floor(time/holdTime), timeless = true);
    // seedRandom(index, true);
    colSwtCTRL_Layer = comp("Col Swatches SELECTOR").layer("GLOBAL COL CTRL Outlines");
    colSwt_Layer = colSwtCTRL_Layer.effect("Layer Control")("Layer");
    cFROM = colSwtCTRL_Layer.effect("Color Swatches ā€“ Select FROM")("Slider");
    cTO = colSwtCTRL_Layer.effect("Color Swatches ā€“ Select TO")("Slider");
    maxSWATCHES = colSwtCTRL_Layer.effect("max SWATCHES")("Slider");
    t = Math.floor(time-inPoint);
    //sec = Math.floor(t%60);
    if(cTO > maxSWATCHES) {cTO = maxSWATCHES};
    //c = linear(t, 0, 60, cFROM, cTO);
    c = Math.floor(random(cTO,cFROM) + cFROM);
    colSwt_Layer.content(c).content("Fill 1").color;
  • Patrick Grossien

    June 24, 2022 at 2:08 pm

    aaaah! I tried the “numProperties” reference before, but it didn’t work (gave me a number that wasn’t correct). Maybe I had it linked wrong or some other reference before or between layer and content.

    Thanks Dan, you’re a life saver! This totally did it!

  • Patrick Grossien

    June 1, 2021 at 12:32 pm

    Hi Andre, tbh, I don’t see the pixelation. Maybe you can mark it in the screenshot!?

    Only thing I noticed is that you’re comparing a 200% with a 66% view, so for us, it’s hard to tell what it should look like.. but maybe that’s already the solution? Set both to 100% and compare again.

  • Patrick Grossien

    March 25, 2021 at 2:59 pm

    Try not using the offset, but the start/ end values for fade in/out stuff. The offset is if you set a range and want to move text parts … something like that: ooooooOOOOoo — oOOOOooooooo

Viewing 1 - 10 of 50 posts

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