Forum Replies Created

Page 135 of 1081
  • Dan Ebberts

    August 26, 2020 at 4:27 pm in reply to: Random value every X frames offset?

    Try it this way:

    period = 13.7; // frames
    seed = Math.floor(time/(period*thisComp.frameDuration));
    seedRandom(seed,true);
    random(-50,50);

    Dan

  • Dan Ebberts

    August 24, 2020 at 5:23 pm in reply to: 2d position to sphere

    I think something like this will give you the z:

    x = position[0];
    y = position[1];
    r = 250;

    d = Math.min(Math.sqrt(x*x + y*y),r);
    a = Math.acos(d/r);
    z = -r*Math.sin(a);

    Dan

  • Dan Ebberts

    August 23, 2020 at 2:52 pm in reply to: 2d position to sphere

    >compute the 3D coordinates on a sphere from a 2D (x/y) point.

    What do you mean by that, exactly?

    Dan

  • Dan Ebberts

    August 21, 2020 at 12:03 am in reply to: Linking 4 Layers scale together

    This is kind of hard to explain, but in general, you want to avoid situations where expressions form a feedback loop. For example, expression A uses the output of expression B and expression B uses the output of expression A. That can create an unpredictable situation, where you likely won’t get the outcome you expect. Most of the time it happens when people try to make checkboxes work like radio buttons, but I think what your doing here qualifies as well.

    A safer approach, I(MO, would be to go back to the source for your scale calculations, which I assume might be sourceRectAtTime() expressions for each of your headlines to calculate each scale. Use all four of those in each of your scale calculations and pick the smallest result. Then there’s no feedback loop and the expressions won’t be fighting each other.

    Dan

  • Dan Ebberts

    August 17, 2020 at 5:33 pm in reply to: Random change to specific color

    The expression needs to go on a color property (Fill color maybe?) and each property will need its own expression. Depending on how you have things set up, you might be able to save a lot of time by applying the expression to one property, selecting that property, Edit > Copy Expression Only, select all the other layers, Edit > Paste.

    It looks like you left out the opening square bracket:

    colors = [[60,64,131,255]/255,

    Dan

  • Dan Ebberts

    August 12, 2020 at 9:29 pm in reply to: sourceRectAtTime() for shape layers?

    What do you get with sourceRectAtTime(1000,false) ?

    Dan

  • Dan Ebberts

    August 12, 2020 at 12:14 am in reply to: Animated text locked to a specific position

    Ah, OK. You’re using an opacity animator. For some reason I thought you were animating the text itself, but with the animator, the text itself never changes, so sourceRectAtTime() and counting the lines of text won’t work. It seems like somebody hacked together a solution for this, but I don’t recall what it is.

    Dan

  • Dan Ebberts

    August 11, 2020 at 11:27 pm in reply to: Animated text locked to a specific position

    Maybe a Position expression like this:


    pxPerLine = 18;
    txt = text.sourceText;
    n = txt.split("\r").length-1;
    value - [0,n*pxPerLine]

    Dan

  • Dan Ebberts

    August 11, 2020 at 9:05 am in reply to: set slider number to layer marker

    Try this:


    n = 0;
    val = 0;
    if (marker.numKeys > 0){
    n = marker.nearestKey(time).index;
    if (time < marker.key(n).time) n--;
    }
    if (n > 0){
    val = parseInt(marker.key(n).comment,10);
    val = isNaN(val) ? 0 : val;
    }
    val

    Dan

  • Dan Ebberts

    August 8, 2020 at 7:24 pm in reply to: Controlling color with checkbox controller

    The color channels are normalized to be between zero and one. You could use 0-255 values like this (example for yellow):

    [255,255,0,255]/255

    Dan

Page 135 of 1081

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