Forum Replies Created

Page 155 of 1081
  • Just change it to this:

    textIndex <= Math.floor(time) ? 100 : 0

    Dan

  • This simple example should select each character in sequence, starting at one second:

    textIndex == Math.floor(time) ? 100 : 0

    and apply the max amount of the Animator property to the selected character.

    Dan

  • Dan Ebberts

    February 21, 2020 at 4:31 pm in reply to: set background color of multiple comps?

    I’m not sure exactly what you mean, but you can save the script as a .jsx file wherever you want, and then run it with File > Scripts > Run Script File…

    Dan

  • You can do math on the layer’s index to get to the layer above, like this:

    thisComp.layer(index-1)

    Or you can use relative indexing, like this:

    thisComp.layer(thisLayer,-1)

    but, you can’t change the actual stacking order with an expression. It wasn’t clear to me if you understood this. Sorry if you did. You could shuffle them in Z space if they are 3D layers though.

    Dan

  • Dan Ebberts

    February 20, 2020 at 12:46 am in reply to: Setting the TimeRemap value of 2 Keyframes

    I’m not exactly sure what you’re up to here, but setValueAtTime() is used in scripting, not expressions. And in scripting, you would use it to create keyframes, not to manipulate existing keyframes. With a time remapping expression, all you can do is manipulate the resulting remapped time.

    Dan

  • This should work:


    var myComp = app.project.activeItem;
    for (var i = 1; i <= myComp.numLayers; i++){
    myComp.layer(i).selected = (myComp.layer(i).threeDLayer || myComp.layer(i).guideLayer || myComp.layer(i).label == 1);
    }

    Dan

  • Dan Ebberts

    February 14, 2020 at 11:51 pm in reply to: Movement started by multiple Marker

    This is better if you have any Move markers that have zero duration:


    moveAmt = 500;
    m = marker;
    val = value;
    if (m.numKeys > 0) {
    n = m.nearestKey(time).index;
    if (time < m.key(n).time) n--;
    accum = 0;
    y = 0;
    if (n > 0){
    if ( n > 1){
    for (i = 1; i < n; i++){
    if (m.key(i).comment == "Move") accum += moveAmt
    }
    }
    if (m.key(n).comment == "Move"){
    t = time - m.key(n).time;
    y = (m.key(n).duration > 0) ? linear(t,0,m.key(n).duration,0,moveAmt) : moveAmt;
    }
    val = value + y + accum;
    }
    }
    val

    Dan

  • Dan Ebberts

    February 14, 2020 at 11:44 pm in reply to: Movement started by multiple Marker

    I’m not 100% sure from your description, but I think it will look something like this:


    moveAmt = 500;
    m = marker;
    val = value;
    if (m.numKeys > 0) {
    n = m.nearestKey(time).index;
    if (time < m.key(n).time) n--;
    accum = 0;
    y = 0;
    if (n > 0){
    if ( n > 1){
    for (i = 1; i < n; i++){
    if (m.key(i).comment == "Move") accum += moveAmt
    }
    }
    if (m.key(n).comment == "Move"){
    t = time - m.key(n).time;
    y = linear(t,0,m.key(n).duration,0,moveAmt);
    }
    val = value + y + accum;
    }
    }
    val

    Dan

  • Dan Ebberts

    February 12, 2020 at 2:22 pm in reply to: Time Remap Expression for Versioning

    In your screenshot, it appears that the first line of your expression is:

    n = thisComp.name.split(“-“)[1];

    not

    n = thisComp.name.split(” – “)[1];

    which means that the value of n would be ” CA” not “CA” (without the quotes of course). In any case I think the problem is in the first line not matching up with the way the comp name is formatted.

    Dan

  • Dan Ebberts

    February 11, 2020 at 8:16 pm in reply to: If else expression with references

    try changing the section that defines t to this:

    t = (q <= g) ? 1 : 0;

    Dan

Page 155 of 1081

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