AE【sourceRectAtTime()】文本框随文字变化而变化
(2020-06-04 10:49:40)
标签:
aesourcerectattime |
分类: AE |
(2)形状图层---Rectangle Path---size
margin=70;
text_width=thisComp.layer("文本").sourceRectAtTime().width;
text_height=thisComp.layer("文本").sourceRectAtTime().height;
box_width=text_width+margin*2;
box_height=text_height+margin*2;
[box_width,box_height]
(3)形状图层---Transform:Rectangle---position
t=thisComp.layer("文本");
tRect=t.sourceRectAtTime(time,false);
tUL=t.toComp([tRect.left,tRect.top]);
tLR=t.toComp([tRect.left+tRect.width,tRect.top+tRect.height]);
tCenter=(tUL+tLR)/2
myRect=sourceRectAtTime(time,false);
myUL=toComp([myRect.left,myRect.top]);
myLR=toComp([myRect.left+myRect.width,myRect.top+myRect.height]);
myCenter=(myUL+myLR)/2
delta=myCenter-tCenter;
value-delta
最终效果:
前一篇:人生三境界
后一篇:[转载]摄影师格言35条