Forum Replies Created

Page 87 of 1081
  • Dan Ebberts

    June 10, 2022 at 4:25 pm in reply to: Quick and simple LipSync

    Maybe something like this:

    n = comp(name).numLayers;

    s = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");

    maxVal = 24;

    minVal = 0;

    avg = (maxVal-minVal)/2;

    freq = 5;

    w = wiggle(freq,avg) - value + avg;

    s = Math.max(s,w);

    f = linear(s,minVal,maxVal,0,n-1);

    framesToTime(f);

  • Dan Ebberts

    June 8, 2022 at 7:28 pm in reply to: Quick and simple LipSync

    OK, so maybe what you need to do is remap the audio slider range to a range of frames that encompasses your range of mouth shapes. So you’d still time remap the MOUTH precomp layer and apply this expression to time remapping:

    n = comp(name).numLayers;

    s = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider");

    maxVal = 34;

    minVal = 10;

    f = linear(s,minVal,maxVal,0,n-1);

    framesToTime(f);

    Set minVal and maxVal to the min and max audio levels on the slider.

  • Dan Ebberts

    June 8, 2022 at 5:28 pm in reply to: Quick and simple LipSync

    I think the problem you’re going to run into is that the audio amplitude layer doesn’t contain any phoneme info that you can use to select the appropriate mouth shape. Unless you have some way to extract that info from the audio, you might be stuck with a more manual process. For example, you could use layer markers on your time-remapped MOUTH precomp layer where the comment matches the name of one of the mouth shape layers, and then use a time remap expression like this to display the corresponding mouth shape image:

    m = marker;

    val = 0;

    if (m.numKeys > 0){

    n = m.nearestKey(time).index;

    if (time < m.key(n).time) n--;

    if (n > 0){

    idx = comp(name).layer(m.key(n).comment).index;

    val = framesToTime(idx-1);

    }

    }

    val

  • Dan Ebberts

    June 6, 2022 at 7:06 pm in reply to: Specific word in paragraph be a different color

    I don’t know if it’s practical, but I guess you could have a duplicate text layer, behind the original, that you have converted to shapes and applied a gradient fill to. Then you could add an opacity animator to the text layer in front and make invisible the words that you want to have the gradient. Not sure if that meets your needs though…

  • Dan Ebberts

    June 6, 2022 at 3:53 pm in reply to: Specific word in paragraph be a different color

    I don’t think so, using this technique, because there’s no gradient animator for text.

  • Dan Ebberts

    June 2, 2022 at 7:56 pm in reply to: sampleImage() and subtraction

    Nice sleuthing, Filip. I also saw the -1 flash. I suspect that one possible contributing factor might be the calculation time required for sampleImage(). Maybe, under the hood, there’s some asynchronous calculation going on and sampleImage() isn’t reporting back in time. All speculation on my part, but an interesting mystery…

  • Dan Ebberts

    June 1, 2022 at 2:24 pm in reply to: sampleImage() and subtraction

    Well that is a head scratcher. I’ll keep looking at it, but I’m stumped at this point.

  • Dan Ebberts

    May 31, 2022 at 6:54 pm in reply to: sampleImage() and subtraction

    I would love to track this down if you can post a simplified project that demonstrates the issue…

  • Dan Ebberts

    May 30, 2022 at 4:35 pm in reply to: Help with Variable Color expression

    The trick is that the expression needs to determine which layer it’s currently working with. This example uses the layer index, but have to define the first and last index in the expression (you might also be able to calculate it from the layer name):

    colors = [[1,0,0,1],[1,.5,0,1],[1,1,0,1],[1,1,1,1]];

    firstIndex =1;

    lastIndex = 20;

    numColors = colors.length;

    idx = (index - firstIndex)/(lastIndex-firstIndex);

    colorIdx = idx*(numColors-1);

    if (colorIdx%1 != 0){

    color1 = colors[Math.floor(colorIdx)];

    color2 = colors[Math.floor(colorIdx) + 1];

    linear(colorIdx%1,0,1,color1,color2);

    }else{

    colors[colorIdx];

    }

  • Dan Ebberts

    May 28, 2022 at 11:21 pm in reply to: sampleImage() and subtraction

    Just for fun, as a source text expression, comment out the last line and add a new last line that’s just:

    x

    and see what you get. If x is less than zero, then you’ve got an illegal index into your array and I would expect the Legacy engine to give you exactly the message you got. The JavaScript engine doesn’t seem to generate the same error message (or necessarily any message at all)–I’m not sure why. If any of this pans out (negative value of x), I would check to make sure at least one of your sample points is over a 10×10 pixel area of 100% alpha. Other than that, hard to say without seeing it.

Page 87 of 1081

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