Categories
AE

[익스프레션] 특정문구 아래 라인 만들기

특정 문구의 위치를 확인하여 밑줄 만들기

totalCount = thisComp.layer("Text").text.sourceText.split("\r").length;
lineCount = thisComp.layer("Text").text.sourceText.split("\r").findIndex(w => w.includes(thisComp.layer("underbarText").text.sourceText));

a=thisComp.layer("Text").sourceRectAtTime();
h=thisComp.layer("Text").transform.position[1]+(lineCount - totalCount)*79.56;
t=thisComp.layer("ControlEffect").effect("top")("Slider");
l=thisComp.layer("ControlEffect").effect("left")("Slider");

spaceValue = 12.68;
underbarText = thisComp.layer('underbarText');
leftLineText = thisComp.layer('leftLine');
uTWidth = underbarText.sourceRectAtTime().width;
flWidth = thisComp.layer('firstLine').sourceRectAtTime().width;
slWidth = thisComp.layer('secondLine').sourceRectAtTime().width;
llWidth = leftLineText.sourceRectAtTime().width;
lIndex = thisComp.layer("Text").text.sourceText.split("\r").findIndex(w => w.includes(thisComp.layer("underbarText").text.sourceText));

d = (flWidth - slWidth) / 2;
leftWidth = (lIndex ? (d > 0 ? d : 0) : (d > 0 ? 0 : Math.abs(d))) + llWidth; 
spaceWidth = thisComp.layer('Text').text.sourceText.split('\r')[lIndex].split(underbarText.text.sourceText)[0].replace(leftLineText.text.sourceText.trim(), '').length;

[(thisComp.width - a.width)/2 + leftWidth + spaceWidth * spaceValue + l, h + t]

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다