Skip to main content
Inspiring
March 17, 2022
Question

CC Repetile fit composition

  • March 17, 2022
  • 3 replies
  • 445 views

I was wondering what would be the mathematical solution to tile properly an image to fit the composition while taking the scale as a parameter.

 

thanks

 

This topic has been closed for replies.

3 replies

Mylenium
Legend
March 19, 2022

You didn't mention anything about scaling. It helps to be precise! Simply multiply the expansion values by the inverse of the scaling factor, in this case 2. Example:

 

mDown=(cHei-mY+mHei+0.5)*2;

 

Mylenium

MaxLPAuthor
Inspiring
March 19, 2022

I did precise it in the question and the calculation is highly inacurate or the software has some issues even after trying multiple alteration of the formula even before asking the question.

When the scale is negative the image is too small & way too big when it is over 100% wich create major memory issues.

please try it out on your side before please!

 

cordially, Maxime

Mylenium
Legend
March 17, 2022

Repetile uses absolute pixel values, so it's as simple as figuring out the difference between comp size and layer size, possibly also accounting for position if it's not centered. Example:

 

mWid=thisLayer.width;
mHei=thisLayer.height;
cWid=thisComp.width;
cHei=thisComp.height;
mX=thisLayer.transform.position[0];
mY=thisLayer.transform.position[1];

 

mDown=cHei-mY+mHei+0.5;
mUp=mY-mHei*0.5;
mRight=cWid-mX+mWid*0.5;
mLeft=mX-mWid*0.5;

 

Insert the respective code bits in the corresponding controls of the effect.

 

Mylenium

MaxLPAuthor
Inspiring
March 18, 2022

it does not work. the scale is at 50%.

 

Ann Bens
Community Expert
Community Expert
March 17, 2022

Moving question from Premiere to Ae forum.