• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Expression for animating text on tight spiral

New Here ,
Apr 07, 2021 Apr 07, 2021

Copy link to clipboard

Copied

I am trying to animate a long string of numbers around a tight Archimedean spiral mask path by using this expression I found…

 

Source text:

rate = 100; // characters per second

txt = “31415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602……..and on and on”;

txt.substr(0,timeToFrames(time*rate*thisComp.frameDuration));

 

The path is set to “reverse” with text aligned right so the numbers appear at the centre and fill the spiral.

 

The expression works for me, but all the text disappears once a certain number of characters have appeared on the spiral:

https://drive.google.com/file/d/1ivuzj0gxyeYIkJSeYAnmlQ1Foldf0G-5/view?usp=sharing

 

My first and last margins are set to 0.0 and I haven’t used a text box – I rechecked the the text layer is set as point text and not a paragraph.

 

Is there any way I can fix this so the numbers can keep filling the spiral without disappearing?

 

I'd appreciate any help.

TOPICS
Expressions , How to

Views

586

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 08, 2021 Apr 08, 2021

Copy link to clipboard

Copied

There are intrinsic limits in JavaScript math like it's implemented in AE like the number of characters in a string or integer numbers capping off at 32000. The usual limits AE has as a whole. You need to split up your work into manageable segments instead of just firing the data at the expression. Should not be an issue, as clearly not all characters would be visible at all times, anyway.

 

Mylenium

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Apr 08, 2021 Apr 08, 2021

Copy link to clipboard

Copied

Have you tried selecting "Force Alignment" under the Path Options inside the Text Property group?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 08, 2021 Apr 08, 2021

Copy link to clipboard

Copied

I would have used a text animator instead of a random number expression. You are just running out of available characters before you get to the end of the path. You are also adding 3 characters per frame. Do you need that kind of speed. Nobody is going to be able to read it, so concentrate on the look instead of the actual numbers.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 08, 2021 Apr 08, 2021

Copy link to clipboard

Copied

Thanks for the replies.

 

It seems that no matter how many digits are in the source text, After Effects will scroll up to 466 of them on to the spiral before they disappear. I don't know if this is due to my hardware set-up or not.

 

This happens with force align and also other text in animators being used instead of the expression.

 

I'll do what Mylenium suggested and break the animation into segments.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 09, 2021 Apr 09, 2021

Copy link to clipboard

Copied

I created a spiral in Illustrator because it is easy, copied and pasted it as a mask path on a text layer, then used this page to generate 2000 random numbers from 1 to 1000, then copied them and pasted them to the text layer and added an opacity animator. The string was so much longer than the path that I added a bunch more points and ended up with this:

crazy spiral.png

Here's the project file for you to look at. I think you have a bigger problem with your expression than you do with the idea and the capability of the text layer to contain enough characters. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 12, 2024 Aug 12, 2024

Copy link to clipboard

Copied

LATEST

Are you a bowhunter or an archer looking to optimize your bow performance? If so, understanding brace height is crucial to achieving accuracy and consistency in your shots.

Brace height, the distance between the deepest part of the grip and the string of a bow, plays a key role in the bow’s speed, noise level, and forgiveness.

By using a Brace Height Calculator, you can determine the ideal brace height for your bow setup. In this blog post, we will provide you with five actionable tips to help you make the most of a Brace Height Calculator and improve your shooting experience.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines