Forum Replies Created

Page 2 of 7
  • As always – “Dan, the man”! Thank you very much! This works as intended for me. I somehow have to be able to wrap my head around how to use modulo to its full extent.

  • Hey Hector, thank you very much for your response. Sadly I wasn’t able to follow the steps you described.

    2 In the expression editor, select the keyframe you want to modify (in this case, the middle keyframe).

    > How would I be able to select a keyframe “in” the editor? The editor is just for text entry afaik.

    3 Click the pick whip tool (the squiggly line icon) and select the “LoopOut” parameter from the Effects Controls panel.

    > How am I able to set a “Loop Out” in the Effects Controls Panel? Is there a “Loop” Effect I am missing?

    5 Save the changes to the expression and close the expression editor. The LoopOut expression should now be applied to the middle keyframe.

    <font face=”inherit”>> Saving changes in the editor itself? </font>

    <font face=”inherit”>Somehow </font><font face=”inherit” style=”font-family: inherit; font-size: inherit;”>I have the feeling we are talking about </font>different<font face=”inherit” style=”font-family: inherit; font-size: inherit;”> things here?! What am I missing. </font>Would love to know!

  • Thank you Ben, I will try that. Maybe it’s stretching out the cloned layer that will do the trick. Right now my cloned layer only has the blur which extends visibly to the left and right, but the layer itself has the same size as its parent. The blur works / shows up inside motion but doesn’t translate to fcpx.

  • 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)

  • 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;

  • 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.

  • // 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;
  • 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;
  • 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!

  • 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;
Page 2 of 7

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