-
Random Position Based on Scale
Hello,
I have a comp that is 1920×1080. It has several layers, with a random scale value on each layer (e.g. Layer 1 scale is 125%, Layer 2 scale is 112%……). The range of the scaling is 100% to 150%
I was hoping to generate a random position for each layer based on its scale value. The positional randomness of the scaled layer would be restricted by its borders and/or corners so that it filled the 1920 x 1080 comp window at all times (not revealing the layer beneath it).
I think I have a few lines, but haven’t been able to solve it. Here is what I have so far.
I figured the limits could be something like this…
Width
minVal =((transform.scale/100*thisComp.width)-thisComp.width/2)-thisComp.width/2;
maxVal =((transform.scale/100*thisComp.width)-thisComp.width/2)+thisComp.width/2;Height
minVal =((transform.scale/100*thisComp.height)-thisComp.height/2)-thisComp.height/2;
maxVal =((transform.scale/100*thisComp.height)-thisComp.height/2)+thisComp.height/2;and the randomness could be something like this…
seedRandom(index,true);
s = random(minVal,maxVal);
[s,s]but I haven’t been able to figure out a way to get it all to work together in one expression. Any help would be great. Thanks in advance.