Skip to main content
Known Participant
November 28, 2022
Question

Text content based on expression randomly glitches

  • November 28, 2022
  • 4 replies
  • 1096 views

I've set up a simple timer counting from 30 to 0 seconds. It works fine except the actual rendering of the numbers. Sometimes, at the end of a second, the number shifts it selves to the side before transitioning into the following one. It's a matter of 1 frame, but noticeable.
Does anybody please know how to fix it?
Thank you.

This topic has been closed for replies.

4 replies

Dan Ebberts
Community Expert
Community Expert
November 28, 2022

Is there a Tracking Animator, an animated mask, or a track matte involved?

Known Participant
November 28, 2022

None of the mentioned in this text layer. In terms of the whole composition, yes. But all the mattes don't interfere with this text layer.

Dan Ebberts
Community Expert
Community Expert
November 28, 2022

Any Source Text keyframes around the time of the glitch?

Mylenium
Legend
November 28, 2022

Check your font as already mentioned. The code appears to work just fine.

 

Mylenium

Known Participant
November 28, 2022

I've tried several different fonts with various settings. Always the same result.

Mylenium
Legend
November 28, 2022

Get rid of the Math.max. in this context it doesn't make any sense. To convert fractional values use Math.round or use the built-in timeToFrames() method.

 

Mylenium

Known Participant
November 28, 2022

The Math.max() function was used to fix the final zero in place.. And even when I deleted it, the glitches remained.

Mylenium
Legend
November 28, 2022

Without seeing your code nobody can tell you much. This simply looks like you are using some code that uses dynamic alignment/ padding and the internal logic is simply one frame off. Eitehr that or you are using a font that produces alternate glyphs. in the latter case you could at least try and turn these options off in the character palette. Anything else will require proper details.

 

Mylenium

Known Participant
November 28, 2022

Sorry for the lack of detail. 
The whole expression I'm using goes like this:

rate = -1;
clockStart = 31;

clockTime = Math.max(clockStart + rate*(time - inPoint),0);

t = Math.floor(clockTime);
min = Math.floor((t/3600)/60);
sec = Math.floor(t%60);

Compisition has relular settings, 1080p 25fps.