Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

New Here ,
Jun 17, 2022 Jun 17, 2022

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)

TOPICS
Expressions , How to
304
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 17, 2022 Jun 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 ?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 17, 2022 Jun 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, " ");

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 17, 2022 Jun 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 17, 2022 Jun 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 17, 2022 Jun 17, 2022
LATEST

if the text layer is precomposed just replace

thisComp.layer("text 1")

with

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines