Forum Replies Created

Page 148 of 1081
  • It’s not clear to me exactly what you’re trying to do, but basically, if an expression refers to the value of the property hosting that expression, it only has access to the pre-expression value. Expressions on any other property accessing the value of that property only have access to the post-expression value. It’s confusing, until you get used to it.

    There is a hack, that used to work in some circumstances (but I haven’t tried it lately) where an expression can publish its host property’s pre-expression value for other expressions to use by using negative time. You would do something like this (let’s say for the position property):

    if (time < 0){
    valueAtTime(-time);
    }else{
    // regular expression goes here
    }

    then the expression for any other property that needed the pre-expression position value would do this:

    p = position.valueAtTime(-time);

    to get the pre-expression position value. There is an issue about what happens at time = 0, but if that matters in your scenario, you can just add an offset to the negative time used:

    valueAtTime(-time-1);

    and correspondingly:

    p = position.valueAtTime(-time-1);

    I don’t know if any of this is useful to you, and as I mentioned, I’m not even sure it will still work.

    Dan

  • Try this for each shape’s opacity transform:

    maxDelay = 5; // turn all shapes on within 5 seconds
    seedRandom(index,true);
    myDelay = random(maxDelay);
    time – inPoint < myDelay ? 0 : 100

    Dan

  • Dan Ebberts

    April 28, 2020 at 6:37 am in reply to: Text expression random wiggLe per character

    Try this: Add a position Animator to the text and set the y position value to the negative number that represents the maximum amount that you want the letters to move upwards. Add an expression Selector and apply this expression to its Amount property:

    freq = 1;
    seedRandom(textIndex,true);
    50 + wiggle(freq,50)-value;

    Set the freq value to how fast you want the wiggles to occur (wiggles per second).

    Dan

  • Dan Ebberts

    April 27, 2020 at 10:32 pm in reply to: Text Characters Rotation Randomness

    Something like this maybe:


    seedRandom(textIndex,true);
    myVal = random(-100,100);
    midPoint = (inPoint+outPoint)/2;
    if (time < midPoint)
    linear(time,inPoint,midPoint,0,myVal)
    else
    linear(time,midPoint,outPoint,myVal,0)

    Dan

  • Dan Ebberts

    April 27, 2020 at 8:48 pm in reply to: Text Characters Rotation Randomness

    Hmm… there are only two directions for rotation, so I think we need a more detailed description of what you’re after.

    Dan

  • Dan Ebberts

    April 27, 2020 at 7:32 am in reply to: Wiggle expression between 2 values only

    There’s not much to it really, this should cover it:

    https://www.javascripttutorial.net/javascript-ternary-operator/

    Dan

  • Dan Ebberts

    April 26, 2020 at 3:35 pm in reply to: Wiggle expression between 2 values only

    It basically says if the wiggled value is less than 50, set the result to 0, otherwise set it to 100.

    ThE ?/: syntax is an example of the JavaScript ternary operator, which is a compact form of if/else.

    Dan

  • Dan Ebberts

    April 24, 2020 at 8:53 pm in reply to: Random opacity on specific way

    This is a pretty simple version that might get you started:


    minFade = .1;
    maxFade = .5;
    minHold = .5;
    maxHold = 1.5;
    minDelay = 1;
    maxDelay = 1.5;
    seedRandom(index,true);
    myFade = random(minFade,maxFade);
    myHold = random(minHold,maxHold);
    myDelay = random(minDelay,maxDelay);
    myStart = random(minDelay);
    if (time > myStart){
    myPeriod = myFade*2 + myHold + myDelay;
    t =(time - myStart)%myPeriod;
    if(t < myFade)
    linear(t,0,myFade,0,100)
    else
    linear(t,myFade+myHold,myFade*2+myHold,100,0);
    }else
    0

    Dan

  • Try it this way:


    s = thisComp.layer("Controller").effect("Random Seed")("Slider");
    n = thisComp.layer("Controller").effect("Steps")("Slider");
    l = thisComp.layer("Controller").effect("Max Length")("Slider");
    seedRandom(s,true);
    var pts = [];
    var x = y = 0;
    pts.push([x,y]);
    rPrev = Math.floor(random(4));
    for(i = 0; i < n; i++) {
    var d = Math.floor(random(l));
    var r = (rPrev + 3 + Math.floor(random(3)))%4;
    switch(r) {
    case 0:
    x += d;
    break;
    case 1:
    y += d;
    break;
    case 2:
    x -= d;
    break;
    case 3:
    y -= d;
    break;
    }
    pts.push([x,y]);
    rPrev = r;
    }
    createPath(pts, [], [], false);

    Dan

  • if (index%3 == 0)

    should be true for layers 3,6,9,etc.

    Dan

Page 148 of 1081

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