Forum Replies Created

Page 969 of 1081
  • Dan Ebberts

    July 18, 2007 at 2:57 am in reply to: adding falloff to an expression

    Sure, but it would be like this:

    transform.position.valueAtTime(time-1)[1]

    Dan

  • Dan Ebberts

    July 18, 2007 at 12:23 am in reply to: Animate Checkbox to Audio Waveform

    You could convert the audio to keyframes and start with something simple like this:

    threshold = 5.0;
    level = thisComp.layer(“Audio Amplitude”).effect(“Both Channels”)(“Slider”);

    if (level > threshold){

    // mouth open code goes here

    }else{

    // mouth closed code goes here

    }

    Dan

  • Dan Ebberts

    July 17, 2007 at 5:11 pm in reply to: existence ?

    Try this:

    L = comp(“3×1”).layer(“LIGNES”);

    if (L.hasParent){
    s1 = L.parent.transform.scale;
    s2 = L.transform.scale;
    [s1[0]*s2[0]/100, s1[1]*s2[1]/100]
    }else{
    L.transform.scale
    }

    Dan

  • Dan Ebberts

    July 17, 2007 at 1:54 pm in reply to: video speed connected to audio amplitude

    The problem is that expressions have no memory. No information is passed from one frame to the next, so an expression has no way of knowing if its value is increasing or decreasing.

    What you have to do is loop frame by frame from time zero to the current frame, and recalculate the expression at each frame, accumulating the results as you go. Cumbersome, but possible.

    Dan

  • Dan Ebberts

    July 17, 2007 at 1:46 pm in reply to: existence ?

    You can use JavaScript’s try/catch construct for this, like this:

    try{
    target=comp(thisComp.layer(1).name).layer(thisComp.name);
    }catch(err){
    target = // something else
    }

    In the catch section you have to define what value to use for target if the try section fails.

    Dan

  • Dan Ebberts

    July 17, 2007 at 1:07 pm in reply to: video speed connected to audio amplitude

    The easiest (and best) way to do this is with Trapcode’s Sound Keys plugin and a time remapping expression.

    Other than that, you’ll need to modify your expressions so that it loops through all previous frames and accumulates the audio amplitude at each frame. Then you would multiply the total by some scale factor, add that to the current time, and convert to frame number. That will cause the value to always keep increasing, and increase faster in response to louder audio.

    Dan

  • Dan Ebberts

    July 17, 2007 at 12:59 pm in reply to: adding falloff to an expression

    Play around with this:

    decayTime = 1; // decay time (seconds)
    mult = 5;
    audLev = thisComp.layer(“Audio Amplitude”).effect(“Both Channels”)(“Slider”);

    k = 4.605/decayTime;
    currFrame = Math.round(time/thisComp.frameDuration);
    decayFrames = Math.round(decayTime/thisComp.frameDuration);
    sampleFrame = Math.max(0, currFrame – decayFrames);
    decayTime = 0;
    curMax = 0;

    while (sampleFrame <= currFrame){ sampleVal = audLev.valueAtTime(sampleFrame * thisComp.frameDuration) * mult; curVal = curMax/ Math.exp(decayTime * k); if (sampleVal >= curVal){
    curMax = sampleVal;
    decayTime = 0;
    }else{
    decayTime += thisComp.frameDuration;
    }
    sampleFrame++;
    }
    curVal

    Dan

  • Dan Ebberts

    July 13, 2007 at 4:41 pm in reply to: Corner pin rotation and transformation delima

    If I understand Glennser’s method, it seems like you could apply a layer transform expression to the pins of the second instance of CC Power Pin to tie them directly to the tracking points for the frame. It would look like this:

    fromComp(thisComp.layer(“Frame Layer”).motionTracker(“Tracker 1”)(“Track Point 1”).attachPoint)

    Dan

  • Dan Ebberts

    July 7, 2007 at 10:41 pm in reply to: Changing Parameters based on Distance from Camera?

    Here’s an example for opacity. You’ll need to adjust the parameters to fit your situation:

    minDist = 600;
    maxDist = 800;
    minOpacity = 30;
    maxOpacity = 100;

    d = length(toWorld(anchorPoint),thisComp.activeCamera.position);
    linear(d,minDist,maxDist,maxOpacity,minOpacity)

    Dan

  • Dan Ebberts

    July 7, 2007 at 10:30 pm in reply to: Moving Layers in 3d around a center point

    You must have left off the minus sign at the front of the expression (does the same thing as multiplying by -1). Glad you got it working though.

    Dan

Page 969 of 1081

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