Forum Replies Created

Page 1022 of 1081
  • Dan Ebberts

    May 17, 2006 at 1:20 am in reply to: randomize layer order script?

    If they’re sequenced and you re-order them, won’t that mess things up? Do you also need to resequence them?

    Dan

  • Dan Ebberts

    May 17, 2006 at 1:20 am in reply to: randomize layer order script?

    If they’re sequenced and you re-order them, won’t that mess things up? Do you also need to resequence them?

    Dan

  • Dan Ebberts

    May 15, 2006 at 8:14 pm in reply to: blink expression

    The code just calculates a new random seed every 2 seconds and uses that to generate a random number between 0 and 1, which it uses to decide whether the opacity should be off or on. If it should be on, it also makes sure that it has been on for less than .5 seconds (holdTime) or else it turns opacity off.

    Yours seems to have several problems. First, your seed calculation will produce a new seed every frame (not very useful). Then you generate a random number, but don’t assign it to a variable. Then you test the layer’s opacity (which will always be the same value unless you have keyframed it). Then you test the opacity value again (by the way the JavaScript equality test is == not =) and depending on the result you either set holdTime to .5 (and then never use that value) or set opacity to 2 (?)

    I’m guessing you’re confused by the fact that an expression can’t pass info to itself from one frame to the next. Any time you reference the value of the property that the expression is applied to you get the static (or keyframed) value, not the one generated previously by the expression.

    Dan

  • Dan Ebberts

    May 15, 2006 at 8:14 pm in reply to: blink expression

    The code just calculates a new random seed every 2 seconds and uses that to generate a random number between 0 and 1, which it uses to decide whether the opacity should be off or on. If it should be on, it also makes sure that it has been on for less than .5 seconds (holdTime) or else it turns opacity off.

    Yours seems to have several problems. First, your seed calculation will produce a new seed every frame (not very useful). Then you generate a random number, but don’t assign it to a variable. Then you test the layer’s opacity (which will always be the same value unless you have keyframed it). Then you test the opacity value again (by the way the JavaScript equality test is == not =) and depending on the result you either set holdTime to .5 (and then never use that value) or set opacity to 2 (?)

    I’m guessing you’re confused by the fact that an expression can’t pass info to itself from one frame to the next. Any time you reference the value of the property that the expression is applied to you get the static (or keyframed) value, not the one generated previously by the expression.

    Dan

  • Dan Ebberts

    May 15, 2006 at 4:27 pm in reply to: blink expression

    Start with this, then let’s take it from there:

    period = 2
    holdTime = 0.5;

    seed = Math.floor(time/period);
    t = time%period
    seedRandom(seed,true);
    if ( random() > .5 && t < holdTime) 100 else 0; Dan

  • Dan Ebberts

    May 15, 2006 at 4:27 pm in reply to: blink expression

    Start with this, then let’s take it from there:

    period = 2
    holdTime = 0.5;

    seed = Math.floor(time/period);
    t = time%period
    seedRandom(seed,true);
    if ( random() > .5 && t < holdTime) 100 else 0; Dan

  • One way: Duplicate your layer between the walls (just to mark its spot). Apply a slider and this position expression to the original:

    slider = effect(“Slider Control”)(“Slider”);
    topY = thisComp.layer(“top wall”).position[1];
    bottomY = thisComp.layer(“bottom wall”).position[1];
    y = linear(slider,0,100,topY,bottomY);
    [value[0],y]

    Use the slider to move the original layer back to the y position of the duplicate and delete the duplicate. The layer should now stay in relative position as you move the wall layers.

    Dan

  • One way: Duplicate your layer between the walls (just to mark its spot). Apply a slider and this position expression to the original:

    slider = effect(“Slider Control”)(“Slider”);
    topY = thisComp.layer(“top wall”).position[1];
    bottomY = thisComp.layer(“bottom wall”).position[1];
    y = linear(slider,0,100,topY,bottomY);
    [value[0],y]

    Use the slider to move the original layer back to the y position of the duplicate and delete the duplicate. The layer should now stay in relative position as you move the wall layers.

    Dan

  • It will wiggle around the static or keyframed value of the parameter. If you have opacity set to 50% and use the expression wiggle(4,50) you’ll get what you’re after. Open the expression graph and you’ll see what’s happening.

    Dan

  • It will wiggle around the static or keyframed value of the parameter. If you have opacity set to 50% and use the expression wiggle(4,50) you’ll get what you’re after. Open the expression graph and you’ll see what’s happening.

    Dan

Page 1022 of 1081

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