-
Dynamically magnify selected area
Hello
I will be glad if someone could help me with this.
I have following problem i can’t solve for whole day.
My composition is 1280×720.
preview here: https://optika-petru.cz/prev.jpg
I have two rectangles: small (blue one) and BIG (green one) and need magnified copy of part of image which is in small and display it in BIG magnified.
I need it dynamicaly – if small is moved, display dynamicaly its magnified content in big, and if big is moved its content remains same.
I tried to parent adj. layer to BIG rectangle.
In Adjustment layer is effect magnify.And I tried to control Magnify center point by expression, which doesn’t work well.
This expression is Try-fail.
Maybe it’s impossible to do it this way, and somebody know better way.
So if somebody know how to solve it, i will be glad for some advice.Sorry for my english, it’s not my native language.
x = thisComp.layer("small").transform.position[0];
y = thisComp.layer("small").transform.position[1];this_point = thisComp.layer("small").transform.position;
that_point = thisComp.layer("BIG").transform.position;//diff = thisComp.layer("BIG").transform.position[0] - thisComp.layer("small").transform.position[0]
delta=sub(this_point, that_point);
mag = effect("Magnify")("Magnification")/100;
delta = delta * mag ;
[x+delta[0],y+delta[1]];//[x,y];
//[x*mag,y*mag];