Skip to main content
Atte J.
Inspiring
March 21, 2020
Question

Time remapping in precomp with an expression (mouth shapes)

  • March 21, 2020
  • 2 replies
  • 2630 views

I'm animating a character and I have the different mouth shapes sequenced in a precomp as 1 frame images. I'm controlling the time remapping of the precomp in the next comp with a slider control on a null. Here's the expression for the mouth shapes precomp:

 

thisComp.layer("mouth shapes").effect("shape")("Slider") /25

 

Frame rate is 25fps and obviously the shapes comp is being time remapped in that next comp. "mouth shapes" is the control null.

 

So why is it that some shapes that I key are not the ones that the number refers to (1=A, 2=B etc.)? Particularly 5 gets replaced by 6 and 9 is taken over by 10... 🙂 This is very frustrating and I have no idea where to look for the problem, everything is set up the way it should be to my best knowledge. And get this, sometimes when I change the transform values of the transform parent of the shapes precomp the shape snaps to the neighboring shape, all without  me changing the time remapping value...

 

Is this just the regular AE quirky bs or am I missing something? I hope you were able to picture my setup, it's a bit complicated...

This topic has been closed for replies.

2 replies

Community Expert
March 21, 2020

Your expression just divides the slider value by the frame rate and does nothing to eliminate the decimal points between the frame numbers. That is why you are getting blended frames. You have two options. If you want to drag the slider control add this expression to time remapping:

 

framerate = 1/thisComp.frameDuration;
Math.floor(thisComp.layer("mouth shapes").effect("Slider Control")("Slider")) / framerate

 

If you just want to type in the numbers for the Slider value or drag the value you can simply add Math.floor(value) to the slider. 

 

When I do this kind of thing I edit the value range of the sliders to correspond to the number of different frames in the animation and just drag the slider around. 

 

I always define the frame rate in an expression by dividing 1 by the frame duration. It eliminates the possibility of errors. 

Atte J.
Atte J.Author
Inspiring
March 22, 2020

Thank you, Rick! It was that simple...! Time remapping is accurate now.

 

However, I don't see how that solves the mystery of the parent's transforms affecting time remapping. In my view they have absolutely no connection...

Atte J.
Atte J.Author
Inspiring
March 22, 2020

Whoa, wait...

 

I'm still getting pretty funky values like 0.0399932861 instead of 0.04 when time remapping should be in frame #1. Needless to say I'm using round numbers as key values and always hold keyframes.

 

Looks like I'll still have to figure this out...

Atte J.
Atte J.Author
Inspiring
March 21, 2020

And just to clarify, I'm animating the shapes with constant key values, not linear, bezier etc.