Forum Replies Created

Page 1070 of 1081
  • Dan Ebberts

    June 17, 2005 at 8:25 pm in reply to: Using “clamp” in a wiggle expression to limit

    >and key framed the slider from 0 to 15 which is about how far I wanted it to wiggle.
    >Will this have any bearing on the values in the Clamp array (is that the right terminology)?

    That probably means you should replace all the 40’s with 15’s

    >Did you learn all this Java script using AE Expressions or did you program prior to AE Expressions?

    Yes and yes. 🙂 I had never touched JavaScript before expressions but I’ve been writing code for a long time.

    Dan

  • Dan Ebberts

    June 17, 2005 at 8:25 pm in reply to: Using “clamp” in a wiggle expression to limit

    >and key framed the slider from 0 to 15 which is about how far I wanted it to wiggle.
    >Will this have any bearing on the values in the Clamp array (is that the right terminology)?

    That probably means you should replace all the 40’s with 15’s

    >Did you learn all this Java script using AE Expressions or did you program prior to AE Expressions?

    Yes and yes. 🙂 I had never touched JavaScript before expressions but I’ve been writing code for a long time.

    Dan

  • Dan Ebberts

    June 17, 2005 at 6:14 pm in reply to: Using “clamp” in a wiggle expression to limit

    Oh yeah, you’ll have to edit the last three expressions so that “layer1RestPos” represents Layer 1’s rest position. If Layer 1 is keyframed we have more work to do 🙂

    Dan

  • Dan Ebberts

    June 17, 2005 at 6:14 pm in reply to: Using “clamp” in a wiggle expression to limit

    Oh yeah, you’ll have to edit the last three expressions so that “layer1RestPos” represents Layer 1’s rest position. If Layer 1 is keyframed we have more work to do 🙂

    Dan

  • Dan Ebberts

    June 17, 2005 at 5:51 pm in reply to: Using “clamp” in a wiggle expression to limit

    Sure,

    w1 = wiggle(5,40) – value;
    w2 = clamp(w1,[-40,-40],[40,0])
    value + w2

    The first line is used to isolate the wiggle from the property’s (Position in this case) value. For example, if you have an object located at [100,100],

    wiggle(5,40)

    will give you values that range from [60,60] to [140,140]. These values are centered around [100,100]. By subtracing “value” (which is just shorthand for “the pre-expression value of this property” = the same as “position” in this case), you isolate the wiggle component and the result ranges between [-40,-40] and [40,40] (centered around [0,0]), which is what we need for the next step. The clamp function just clamps the first parameter so that it lies between the second an third parameters. In this case, it’g going to clamp our wiggle value between [-40,-40] and [40,0]. So what we have done here is replace all positive y values (which represents downward movement in the AE coordinate system) with 0’s.

    value + w2

    just adds the clamped wiggle component back onto the non-expression position value.

    In the second expression:

    w = wiggle(5,40) – value;
    value + [w[0],-Math.abs(w[1])

    We’re again isolating the wiggle component. The -Math.abs(w[1]) just ensures that any positive y wiggle value gets converted to a negative value (negative values will remain negative). This just reflects any downward wiggle to upward wiggle.

    You’re correct that if it were 3D we’d have to deal with x,y, and z.

    Assuming your wiggling layer is named “Layer 1” these expressions for your shadow layer should get you headed in the right direction:

    // mask expansion

    minExpansion = 0;
    maxExpansion = 25;

    layer1RestPos = [320,240];
    delta = thisComp.layer(“Layer 1”).position – layer1RestPos;
    linear(delta[1],-40,0,maxExpansion,minExpansion);

    // mask feather

    minFeather = 0;
    maxFeather = 25;

    layer1RestPos = [320,240];
    delta = thisComp.layer(“Layer 1”).position – layer1RestPos;
    f = linear(delta[1],-40,0,maxFeather,minFeather);
    [f,f]

    //position

    layer1RestPos = [320,240];
    delta = thisComp.layer(“Layer 1”).position – layer1RestPos;
    value + delta[0]

    Dan

  • Dan Ebberts

    June 17, 2005 at 5:51 pm in reply to: Using “clamp” in a wiggle expression to limit

    Sure,

    w1 = wiggle(5,40) – value;
    w2 = clamp(w1,[-40,-40],[40,0])
    value + w2

    The first line is used to isolate the wiggle from the property’s (Position in this case) value. For example, if you have an object located at [100,100],

    wiggle(5,40)

    will give you values that range from [60,60] to [140,140]. These values are centered around [100,100]. By subtracing “value” (which is just shorthand for “the pre-expression value of this property” = the same as “position” in this case), you isolate the wiggle component and the result ranges between [-40,-40] and [40,40] (centered around [0,0]), which is what we need for the next step. The clamp function just clamps the first parameter so that it lies between the second an third parameters. In this case, it’g going to clamp our wiggle value between [-40,-40] and [40,0]. So what we have done here is replace all positive y values (which represents downward movement in the AE coordinate system) with 0’s.

    value + w2

    just adds the clamped wiggle component back onto the non-expression position value.

    In the second expression:

    w = wiggle(5,40) – value;
    value + [w[0],-Math.abs(w[1])

    We’re again isolating the wiggle component. The -Math.abs(w[1]) just ensures that any positive y wiggle value gets converted to a negative value (negative values will remain negative). This just reflects any downward wiggle to upward wiggle.

    You’re correct that if it were 3D we’d have to deal with x,y, and z.

    Assuming your wiggling layer is named “Layer 1” these expressions for your shadow layer should get you headed in the right direction:

    // mask expansion

    minExpansion = 0;
    maxExpansion = 25;

    layer1RestPos = [320,240];
    delta = thisComp.layer(“Layer 1”).position – layer1RestPos;
    linear(delta[1],-40,0,maxExpansion,minExpansion);

    // mask feather

    minFeather = 0;
    maxFeather = 25;

    layer1RestPos = [320,240];
    delta = thisComp.layer(“Layer 1”).position – layer1RestPos;
    f = linear(delta[1],-40,0,maxFeather,minFeather);
    [f,f]

    //position

    layer1RestPos = [320,240];
    delta = thisComp.layer(“Layer 1”).position – layer1RestPos;
    value + delta[0]

    Dan

  • Dan Ebberts

    June 17, 2005 at 4:23 pm in reply to: expanding keyframes?

    Just select them all and Alt + drag the last one to 2 seconds. Is that what you mean?

    Dan

  • Dan Ebberts

    June 17, 2005 at 4:12 pm in reply to: Using “clamp” in a wiggle expression to limit

    Here are two different ways:

    w1 = wiggle(5,40) – value;
    w2 = clamp(w1,[-40,-40],[40,0])
    value + w2

    w = wiggle(5,40) – value;
    value + [w[0],-Math.abs(w[1])]

    Either expression will keep the object from moving below its starting point. The first one clamps downward movement, the second one reflects it upward.

    Dan

  • Dan Ebberts

    June 17, 2005 at 4:12 pm in reply to: Using “clamp” in a wiggle expression to limit

    Here are two different ways:

    w1 = wiggle(5,40) – value;
    w2 = clamp(w1,[-40,-40],[40,0])
    value + w2

    w = wiggle(5,40) – value;
    value + [w[0],-Math.abs(w[1])]

    Either expression will keep the object from moving below its starting point. The first one clamps downward movement, the second one reflects it upward.

    Dan

  • Dan Ebberts

    June 17, 2005 at 3:56 pm in reply to: Using “clamp” in a wiggle expression to limit

    Do you want it to just sit on the “floor” until the wiggle goes above that value, or do you want some other behavior?

    Dan

Page 1070 of 1081

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