Return-Path: Received: from atl4mhob01.myregisteredsite.com ([209.17.115.39] verified) by media-motion.tv (CommuniGate Pro SMTP 4.2.10) with ESMTP id 5237356 for AE-List@media-motion.tv; Tue, 01 Oct 2013 23:46:50 +0200 Received: from mailpod.hostingplatform.com ([10.30.71.208]) by atl4mhob01.myregisteredsite.com (8.14.4/8.14.4) with ESMTP id r91LlDYe031773 for ; Tue, 1 Oct 2013 17:47:13 -0400 Received: (qmail 16909 invoked by uid 0); 1 Oct 2013 21:47:13 -0000 X-TCPREMOTEIP: 60.225.197.206 X-Authenticated-UID: chris@chriszwar.com Received: from unknown (HELO ?192.168.0.3?) (chris@chriszwar.com@60.225.197.206) by 0 with ESMTPA; 1 Oct 2013 21:47:12 -0000 From: Chris Zwar Content-Type: multipart/alternative; boundary="Apple-Mail=_1B28B638-35CE-4E97-9D02-E9F94AE5097A" Message-Id: <19D4DD72-D8D5-4944-8546-F5F91C1B0C4B@chriszwar.com> Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: [AE] Automating line breaks or batch convert to paragraphs Date: Wed, 2 Oct 2013 07:47:10 +1000 References: To: "After Effects Mail List" In-Reply-To: X-Mailer: Apple Mail (2.1508) --Apple-Mail=_1B28B638-35CE-4E97-9D02-E9F94AE5097A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Thanks Phil, That's awesome. I ended up going through and doing them all manually, = as it allowed me to tweak the line breaks to best suit each sentence. =20= I had a lot of names and titles and doing it by hand made sure they read = better over multiple lines than an automated version would have. But thanks again for the code and this is one to get pasted into the = workbook for next time. Cheers! -Chris On 02/10/2013, at 6:54 AM, Phil Spitler wrote: > Ok, I modified my expression to make it only break where there are = space. >=20 >=20 > txt =3D text.sourceText; needABreak=3D0; newTxt =3D "";split =3D 0; > splitVal =3D thisComp.layer("control").effect("Slider = Control")("Slider");=20 > for (i=3D0; i < txt.length; i++) { > newTxt =3D newTxt + txt[i]=20 > split++; > if (split =3D=3D splitVal) {needABreak=3D1} > if (txt[i] =3D=3D " " & needABreak =3D=3D1) > { > split =3D 0 ; > newTxt =3D newTxt +"\r"; > } > } >=20 > newTxt >=20 >=20 >=20 > Here is a link to the revised project. >=20 > https://www.dropbox.com/s/evc1v6uq2p2k841/textWrap.aep >=20 >=20 > Phil >=20 >=20 >=20 >=20 >=20 >=20 >=20 > Phil Spitler | Creative Technologist | Bonfire Labs | t : = 415.394.8200 m : 415.571.3139 >=20 > Website | Facebook | LinkedIn >=20 > On Oct 1, 2013, at 1:28 PM, Phil Spitler wrote: >=20 >> Ahh. Forgot about splitting words.=20 >>=20 >> Nathan's idea seems a better way to go.=20 >>=20 >> Phil >>=20 >> Phil Spitler | Creative Technologist | Bonfire Labs | t : = 415.394.8200 m : 415.571.3139 >>=20 >> Website | Facebook | LinkedIn >>=20 >> On Oct 1, 2013, at 1:00 PM, Nathan Shipley = wrote: >>=20 >>> "Is there a way to batch convert point text layers to paragraph text = layers and give them all the same bounding box?" >>>=20 >>> Not sure about batch converting them, but you can make a blank = paragraph text layer at the size you want and pick-whip it's source to = the existing layer. Then it will create line breaks where there are = spaces. I think Phil's expression could break lines in the middle of = words? >>>=20 >>> This could be tedious to set up, so you could duplicate your blank = paragraph text layer and have it look at, say, the layer above it for = it's source text so you wouldn't have to pick-whip it every time with an = expression like this: >>>=20 >>> pull=46rom =3D index-1; >>> thisComp.layer(pullFrom).text.sourceText >>>=20 >>> ... where you apply that expression to the Source Text value for = your blank paragraph text layer and place the paragraph layer below the = existing text layer in the stack. Then it's just a matter of = duplicating that layer. >>>=20 >>> Dunno. Maybe that helps? >>> - Nathan >>>=20 >>>=20 >>> On Tue, Oct 1, 2013 at 12:26 PM, Phil Spitler = wrote: >>> Ok, I just whipped up this expression that will do the trick. >>>=20 >>> Create a new null layer called "control" and add a slider, this will = tell the text how many characters there are before it splits the line. >>>=20 >>> Apply the following expression to the source text of your text = layer. You can also then copy the expression and paste it to all your = text layers. >>>=20 >>>=20 >>>=20 >>> txt =3D text.sourceText; >>> newTxt =3D ""; >>> split =3D 0; >>> splitVal =3D thisComp.layer("control").effect("Slider = Control")("Slider"); >>> for (i=3D0; i < txt.length; i++) { >>> newTxt =3D newTxt + txt[i]=20 >>> split++; >>> if (split =3D=3D splitVal) { >>> split =3D 0 ; >>> newTxt =3D newTxt +"\r"; >>> } >>> } >>>=20 >>> newTxt >>>=20 >>>=20 >>>=20 >>> I just tested it and it works great, my coding is not the most = efficient I'm sure but it does work. >>>=20 >>> Sample project is here. >>>=20 >>> https://www.dropbox.com/s/evc1v6uq2p2k841/textWrap.aep >>>=20 >>>=20 >>> Phil >>>=20 >>>=20 >>>=20 >>>=20 >>>=20 >>> Phil Spitler | Creative Technologist | Bonfire Labs | t : = 415.394.8200 m : 415.571.3139 >>>=20 >>> Website | Facebook | LinkedIn >>>=20 >>> On Oct 1, 2013, at 12:00 PM, Louai Abu-Osba wrote: >>>=20 >>>> That's a toughy. Maybe you could have a script run through each = layer and add line breaks every x number of characters? >>>>=20 >>>>=20 >>>> On Tue, Oct 1, 2013 at 12:54 AM, Chris Zwar = wrote: >>>> Hi, >>>>=20 >>>> I'm having a total brain freeze and could do with some advice. >>>> I have several hundred text layers that are currently single lines = of point text. I need to add line breaks to each of them so they will = fit into a column, each line will probably be split over 5-6 separate = lines. >>>>=20 >>>> So: >>>>=20 >>>> 1) Is there a way to batch convert point text layers to paragraph = text layers and give them all the same bounding box >>>>=20 >>>> or >>>>=20 >>>> 2) Is there a animation preset I can use to automatically add line = breaks at the nearest word after every x characters? >>>>=20 >>>> Cheers, >>>>=20 >>>>=20 >>>> -Chris >>>>=20 >>>>=20 >>>>=20 >>>> +---End of message---+ >>>> To unsubscribe send any message to >>>>=20 >>>=20 >>>=20 >=20 --Apple-Mail=_1B28B638-35CE-4E97-9D02-E9F94AE5097A Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii phil@bonfirelabs.com> = wrote:
Ok, I modified my = expression to make it only break where there are = space.


txt =3D text.sourceText; = needABreak=3D0; newTxt =3D "";split =3D 0;
splitVal =3D = thisComp.layer("control").effect("Slider = Control")("Slider"); 
for (i=3D0; i < = txt.length; i++) {
newTxt =3D newTxt + = txt[i] 
split++;
if (split =3D=3D = splitVal) {needABreak=3D1}
if (txt[i] =3D=3D " " & = needABreak =3D=3D1)
{
split =3D 0 ;
newTxt =3D newTxt +"\r";
}
}

newTxt



Here is a link to the revised = project.



Phil







signature1 Phil = Spitler  |  Creative Technologist   |  Bonfire Labs  |  t : 415.394.8200  m : = 415.571.3139

Website | Facebook | LinkedIn

On Oct 1, 2013, at 1:28 PM, Phil Spitler wrote:

Ahh. Forgot about splitting = words. 

Nathan's idea seems a better way = to go. 

Phil

Phil Spitler  |  Creative Technologist =   |  Bonfire = Labs  |  t = : 415.394.8200  m = : 415.571.3139


On Oct 1, 2013, at 1:00 = PM, Nathan Shipley <nshipley@gmail.com> = wrote:

"Is there a way to = batch convert point text layers to paragraph text layers and give them = all the same bounding box?"

Not sure about = batch converting them, but you can make a blank paragraph text layer at = the size you want and pick-whip it's source to the existing layer. =  Then it will create line breaks where there are spaces.  I = think Phil's expression could break lines in the middle of = words?

This could = be tedious to set up, so you could duplicate your blank paragraph text = layer and have it look at, say, the layer above it for it's source text = so you wouldn't have to pick-whip it every time with an expression like = this:

pull=46rom =3D = index-1;
thisComp.layer(pullF= rom).text.sourceText

... where you apply that = expression to the Source Text value for your blank paragraph text layer = and place the paragraph layer below the existing text layer in the = stack.  Then it's just a matter of duplicating that = layer.

Dunno.  Maybe that = helps?
 - = Nathan


On Tue, Oct 1, 2013 at 12:26 PM, Phil Spitler = <phil@bonfirelabs.com> = wrote:
Ok, I just whipped up this = expression that will do the trick.

Create a new null = layer called "control" and add a slider, this will tell the text how = many characters there are before it splits the line.

Apply the following expression to the source text of your = text layer. You can also then copy the expression and paste it to all = your text = layers.



txt =3D text.sourceText;
newTxt =3D = "";
split =3D 0;
splitVal =3D = thisComp.layer("control").effect("Slider Control")("Slider");
for (i=3D0; i = < txt.length; i++) {
newTxt =3D newTxt + txt[i] 
split++;
if (split =3D=3D splitVal) {
split =3D 0 = ;
newTxt =3D newTxt +"\r";
}
}

newTxt



I just tested it and it works great, my coding is not the most efficient = I'm sure but it does work.

Sample project = is here.



Phil






On Oct 1, 2013, at 12:00 PM, Louai Abu-Osba = wrote:

That's a = toughy. Maybe you could have a script run through each layer and add = line breaks every x number of characters?


On Tue, = Oct 1, 2013 at 12:54 AM, Chris Zwar <chris@chriszwar.com> wrote:
Hi,

I'm having a total brain freeze and could do with some advice.
I have several hundred text layers that are currently single lines of = point text.  I need to add line breaks to each of them  so = they will fit into a column, each line will probably be split over 5-6 = separate lines.

So:

1) Is there a way to batch convert point text layers to paragraph text = layers and give them all the same bounding box

or

2) Is there a animation preset I can use to automatically add line = breaks at the nearest word after every x characters?

Cheers,


-Chris



+---End of message---+
To unsubscribe send any message to <ae-list-off@media-motion.tv>

=

=

<= br>= --Apple-Mail=_1B28B638-35CE-4E97-9D02-E9F94AE5097A--