Advertisement
Guest User

Untitled

a guest
May 21st, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //paste to position
  2. gw = function(ind){
  3. res = 0;
  4. for( j = ind; j >= 1; j--){
  5.     if((thisComp.layer(j).rotation.value/90)%2 == 0)
  6.         res += thisComp.layer(j).sourceRectAtTime(time).width*thisComp.layer(j).scale[0]/100;
  7.     else
  8.         res += thisComp.layer(j).sourceRectAtTime(time).height*thisComp.layer(j).scale[1]/100;
  9. }
  10. return res
  11. }
  12.  
  13. i = index-1;
  14. if(!i){
  15.     if((rotation.value/90)%2 != 0){
  16.         [height, width]/2
  17.     }else{
  18.         [width, height]/2
  19.     }
  20. }else{
  21.     x = gw(i) + width/2;
  22.     y = height/2;
  23.  
  24.     if((rotation.value/90)%2 != 0){
  25.         x = gw(i) + height/2;
  26.         y = width/2;
  27.     }
  28.  
  29.     [x, y]
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement