Return-Path: Received: from mail-vb0-f41.google.com ([209.85.212.41] verified) by media-motion.tv (CommuniGate Pro SMTP 4.2.10) with ESMTP-TLS id 5237278 for AE-List@media-motion.tv; Tue, 01 Oct 2013 22:00:19 +0200 Received: by mail-vb0-f41.google.com with SMTP id g17so5385682vbg.0 for ; Tue, 01 Oct 2013 13:00:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=ZbCwKwvbSPwL9EPB26edKTOb1rfEfruiFpIuqX2XyLc=; b=D3fH/UU2BnzZYdUdFeUbTqshITtTbQoWyvvmCurgDtweCec3f4j/0ymeZKmBlG9Za3 ED5a5FAV4kSiUtqp2XvBxAL/GQRmeWbjCM5v3fiJZNtq+R8SWFJbyM7whHdodzsYtRsA lv+4pj4jtx2Om/S4dmPJ93CiA/Fl6xZyF30FRZZQZoaMHzP9vhE/8o/iejUqckfgHuJI DjWsxo3O4jkEsxZvCayOrGCa6pLYlDFGSeV8pX9hn7/RepLbjFQhdb461Zia7gsaqDgh FgV6eduPKy1yieHWZgqNWcTINlyQ8skTeyPBBWZhahcx20YfggeVsS+Rk6cTHKYznvda PniQ== X-Received: by 10.221.44.136 with SMTP id ug8mr29351666vcb.13.1380657642420; Tue, 01 Oct 2013 13:00:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.58.169.82 with HTTP; Tue, 1 Oct 2013 13:00:22 -0700 (PDT) In-Reply-To: References: From: Nathan Shipley Date: Tue, 1 Oct 2013 13:00:22 -0700 Message-ID: Subject: Re: [AE] Automating line breaks or batch convert to paragraphs To: After Effects Mail List Content-Type: multipart/alternative; boundary=001a113378d8553ee704e7b368ae --001a113378d8553ee704e7b368ae Content-Type: text/plain; charset=ISO-8859-1 "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: pullFrom = index-1; thisComp.layer(pullFrom).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 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 = text.sourceText; > newTxt = ""; > split = 0; > splitVal = thisComp.layer("control").effect("Slider Control")("Slider"); > for (i=0; i < txt.length; i++) { > newTxt = newTxt + txt[i] > split++; > if (split == splitVal) { > split = 0 ; > newTxt = 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. > > https://www.dropbox.com/s/evc1v6uq2p2k841/textWrap.aep > > > Phil > > > > > > *Phil Spitler* | Creative Technologist | *Bonfire Labs* | t : > 415.394.8200 m : 415.571.3139 > > Website | Facebook| > LinkedIn > > 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 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 >> > > > --001a113378d8553ee704e7b368ae Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
"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 exist= ing layer. =A0Then it will create line breaks where there are spaces. =A0I = think Phil's expression could break lines in the middle of words?

Thi= s could be tedious to set up, so you could duplicate your blank paragraph t= ext 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:

pullFrom = =3D index-1;
thisComp.layer(pullFrom).text.sourceText

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

Dunno. =A0Maybe that helps?
=A0- Nathan


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

Create a new null layer called &q= uot;control" and add a slider, this will tell the text how many charac= ters there are before it splits the line.

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



txt =3D text.sourceText;
newTxt =3D "";
split =3D 0;
splitVal =3D thisComp.layer("control").effect("Sl= ider Control")("Slider");
for (i= =3D0; i < txt.length; i++) {
newTxt =3D newTxt + txt[i]=A0
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&= #39;m sure but it does work.

Sample project is here.

https://www.dropbox.com/s/evc1v6uq2p2k841/textWrap.aep


Phil





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

Website | Facebook | <= a href=3D"http://www.linkedin.com/company/235257?trk=3Dtyah" target=3D"_bla= nk">LinkedIn

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

<= blockquote type=3D"cite">
That's a toughy. Maybe you co= uld 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. =A0I need to add line breaks to each of them =A0so they will fit int= o 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 laye= rs and give them all the same bounding box

or

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

Cheers,


-Chris



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


--001a113378d8553ee704e7b368ae--