Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Dynamically magnify selected area

  • Dynamically magnify selected area

    Posted by Martin Marada on December 4, 2013 at 12:31 pm

    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];

    Martin Marada replied 12 years, 9 months ago 2 Members · 2 Replies
  • 2 Replies
  • Jason Jantzen

    December 5, 2013 at 7:15 pm

    I’m not sure if I follow correctly, but the small square is magnifying and the big square isn’t? Is the magnification happening only in the small square?

    What I’ve always done is create two layers for this kind of thing. One layer much bigger than your canvas (hopefully large resolution) and a second layer where you’re animation takes place. The small square that magnifies will reveal the much bigger version of your image. So you’d have to create a track matte over the big version of your image that follows your square for magnifying.

    There’s a tutorial over that here – https://mattrunks.com/en/tutorials/after-effects/magnifying-glass

    Jason Jantzen
    vimeo.com/jasonj

  • Martin Marada

    December 6, 2013 at 7:30 pm

    Thanx for your reply.

    But this is not what i want.

    I need seůect by small rectangle area, which has to be magnified, in this rectangle image remains same, its something like selector.

    And this selected area i need magnified in big rectangle.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy