Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Moving position upward and downward
- //350 is 350px
- //3 is speed
- posY = 540;
- posX = 960;
- posY = posY + Math.sin(time*3) * 350;
- [posX,posY]
- ////////////////////////////
- Default position
- x = transform.position[0];
- y = transform.position[1];
- ////////////////////////////
- To start an expression at the specific time
- timeStart = 4; //start at 4 sec
- if(time>timeStart){
- //insert your expression here
- }else{
- //do nothing,but make sure there is a returned result
- }
- ////////////////////////////
- +---[ SHAPE LAYER AUTO-FIT TEXT WIDTH ]----------------------------+
- |
- | [ Shape Layer > Transform > Position ]
- |
- t = thisComp.layer("my_text");
- 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
- | [ Shape Layer > Rectangle 1 > Scale ]
- |
- t = thisComp.layer("my_text");
- tRect = t.sourceRectAtTime(time,false);
- tUL = t.toComp([tRect.left,tRect.top]);
- tLR = t.toComp([tRect.left+tRect.width,tRect.top+tRect.height]);
- myRect = sourceRectAtTime(time,false);
- myUL = toComp([myRect.left,myRect.top]);
- myLR = toComp([myRect.left+myRect.width,myRect.top+myRect.height]);
- margin = 10;
- [(tLR[0]-tUL[0] + 2*margin)/(myLR[0]-myUL[0]),(tLR[1]-tUL[1]+ 2*margin)/(myLR[1]-myUL[1])]*100
- +--------------------------------------------------------------------------------------------------------+
- http://youtube.com/ShuichiSyad
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement