Skip to main content
Participant
June 17, 2022
Question

displayed a certain number of text lines from text layer in child composition

  • June 17, 2022
  • 3 replies
  • 399 views

There is a text layer#1 with 6 text lines. It is necessary that 1st, 2nd and 3d text line from layer#1 be displayed on a text layer#2, and 4th, 5th and 6th text line be displayedon a text layer#3 .And generally speaking, text layer#1 shoud be precomposed.

 

thanx)

This topic has been closed for replies.

3 replies

Adam24585301qycn
Inspiring
June 17, 2022

if the text layer is precomposed just replace

thisComp.layer("text 1")

with

comp("precomp").layer("text 1")

Adam24585301qycn
Inspiring
June 17, 2022

this is for the first 3

 

a=thisComp.layer("text 1").text.sourceText.split('\r')[0];
b=thisComp.layer("text 1").text.sourceText.split('\r')[1];
c=thisComp.layer("text 1").text.sourceText.split('\r')[2];
a+" "+b+" "+c

Adam24585301qycn
Inspiring
June 17, 2022

and

 

d=thisComp.layer("text 1").text.sourceText.split('\r')[4];
e=thisComp.layer("text 1").text.sourceText.split('\r')[5];
f=thisComp.layer("text 1").text.sourceText.split('\r')[6];
d+" "+e+" "+f

Adam24585301qycn
Inspiring
June 17, 2022

when you say 6 text lines, you mean there is a return between each line of text in that layer ? and you want the first lines to appear as 1 line in a different text layer, and then the next 3 to appear on the a different layer. and what hppens if there is 7 lines of text ?

Adam24585301qycn
Inspiring
June 17, 2022

for example this would combine all 6 onto one layer ( now we need to figure out how to stop at 3, etc.... )

 

thisComp.layer("text 1").text.sourceText.replace(/\r/g, " ");