ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

SourceRectAtTime for multiple lines hack?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Roei Tzoref
SourceRectAtTime for multiple lines hack?
on Feb 2, 2018 at 7:23:55 pm

is `SourceRectAtTime()` possible for multiple lines of text as a one block of text i.e for one text layer with multiple lines and line breaks . I am looking for creating a typewriter text for a paragraph of text and that for each line of text the rectangle fits.

Thanks

Roei Tzoref
2D/VFX Generalist & Instructor
♫ AeBlues Tutorials ♫
http://www.tzoref.com


Return to posts index

Kevin Camp
Re: SourceRectAtTime for multiple lines hack?
on Feb 3, 2018 at 1:52:42 am

can you do the typewriter effect in the source text? if so, sourceRectAtTime() should work for what I think you are trying to do.

You may want to have a fixed width for the rectangle, but as the text types onto a new line the box should expand vertically to accommodate the new line(s).

a simple type-on expression in source text would be something like this:

rate = 10 ; // characters per second
substr( 0, rate * ( time - inPoint ) )

Kevin Camp
Art Director
KCPQ, KZJO & KRCW


Return to posts index

Roei Tzoref
Re: SourceRectAtTime for multiple lines hack?
on Feb 3, 2018 at 7:54:44 am

Hi Kevin, I need this for a transcript animation that follows a sound guide so I do need an end keyframe that I could animate.

Roei Tzoref
2D/VFX Generalist & Instructor
♫ AeBlues Tutorials ♫
http://www.tzoref.com


Return to posts index


Kevin Camp
Re: SourceRectAtTime for multiple lines hack?
on Feb 10, 2018 at 12:51:30 am

sorry Roei, just saw this...

if you are still working on this, add a slider to the text layer and set keyframes to animate from 0 to 1, then try this expression:

completion = effect("Slider Control")("Slider") ;
n = linear( completion, 0, value.length ) ;
substr( 0, n )

the text will type-on based on the keyframes set on the slider.

Kevin Camp
Art Director
KCPQ, KZJO & KRCW


Return to posts index

Roei Tzoref
Re: SourceRectAtTime for multiple lines hack?
on Feb 10, 2018 at 5:59:26 pm

thanks Kevin. I tried but I don't see any different result than simply not using the expression and regular animator with scale property. here's my problem:

when I want it to look like this:


here's the project file if you can test it:
https://drive.google.com/open?id=1JWBrWp8s_stqHTVK5zMMTJb6bEdc1EBP

you can use myriad hebrew.

Roei Tzoref
2D/VFX Generalist & Instructor
♫ AeBlues Tutorials ♫
http://www.tzoref.com


Return to posts index

Kevin Camp
Re: SourceRectAtTime for multiple lines hack?
on Feb 15, 2018 at 3:31:14 am
Last Edited By Kevin Camp on Feb 15, 2018 at 3:39:30 am

now i see what you are trying to do...

the only way I think you can do this is to use separate text layers for each line...

it would be nice to have one master text layer that you type into, and then expression on several other text layers that parse the 'master' text into separate lines bassoon newlines (\n or \r\n), but i've never been able to get after effects to detect a newline, just a hard return (\r).

example:

text.sourceText.split('\r')[1]; // will return the second line after a hard return (carriage return)

but

text.sourceText.split('\n')[1]; // will will not return the second line after a newline wrap in area text

maybe some one has found a workaround to detect newlines and will chime in.

Kevin Camp
Art Director
KCPQ, KZJO & KRCW


Return to posts index


Roei Tzoref
Re: SourceRectAtTime for multiple lines hack?
on Feb 15, 2018 at 5:00:15 pm

Thanks for all your feedback Kevin.

Roei Tzoref
2D/VFX Generalist & Instructor
♫ AeBlues Tutorials ♫
http://www.tzoref.com


Return to posts index

Costel Letsoc
Re: SourceRectAtTime for multiple lines hack?
on Feb 21, 2018 at 5:42:38 pm

I'm dealing with a similar question which is what do you have to do in case you have a strap with two lines of text

Line1; Full Name (format text = Bold 50pt)
Line 2; Description (format text = Regular 35pt)

and the box needs to adjust size based on the line that is the longest one ...

Size of bg box to be scaled on the Text Source "Full Name "+ Text Source "Description"


Return to posts index

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