ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Substring expression on the source.text, but I need to reference the original input value.

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Thomas Frenkel
Substring expression on the source.text, but I need to reference the original input value.
on Jul 16, 2018 at 5:16:41 pm

Greetings,
I have a text layer with a substring on the source.text attribute. The substring - combined with a slider - is used to animate in the text, character by character. This is a given structure and can't be replaced with text animators etc, which is why there is no simple solution to the following problem:
I need to calculate the width of the layer (with sourceRectAtTime.width) two times. Once before the substring was applied (to get the width of the original text) and once taking the substring into account. For both values I created simple slider controls on the same layer to store the results.

It would be best to have that on one layer. So duplicating the layer and applying the substring only to one layer while linking the source.text attributes would work but is not a practical solution.

I tried to force After Effects to calculate the first sourceRectAtTime.width expression before the substring expression by creating an unused variable in the source.text-expression before the substring that refers to the width slider control. Just to define the order of calculation. And that worked until I did the same for the second width-slider just the other way around. This time I created an unused variable in the width slider, that links to the source.text attribute, to force After Effects to calculate that before. But this didn't work, it became the same value as my first width slider. Apparently a layer can't have two different widths from two calulations.

Would be thankful for some insight,
Thomas


Return to posts index

Alex Printz
Re: Substring expression on the source.text, but I need to reference the original input value.
on Jul 16, 2018 at 5:34:08 pm

I don't think you can have recursive expressions like that that build on each other, since I think sourceRec requires a measurement relative to the composition (someone correct me if I'm wrong).

You could try setting a keyframe at t=-1 with your initial size/text animation, and then having your final size/text animation on another burner keyframe t=-2, and then references sourceRecAtTime(-1/-2) for your two different sizes?

Alex Printz
Mograph Designer


Return to posts index

Thomas Frenkel
Re: Substring expression on the source.text, but I need to reference the original input value.
on Jul 16, 2018 at 6:37:03 pm

Thank you. The problem is that the source.text, while being animated via substring, is also keyframed, so that different lines of text/words appear over the duration of the composition. That's why I can't use a specific point in time for the final text.

I also think it's impossible. Just wanted to confirm from different sources.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]