Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Masking Questions (replacing someone’s eyes)

  • Masking Questions (replacing someone’s eyes)

    Posted by Mike Derk on October 19, 2007 at 9:25 pm

    I have two masking questions.

    Here’s what I was doing: I had some video of a person and I was replacing her eyes with “alien” eyes.

    I created a photoshop file of the replacement eyes, and then brought that into AE.

    Using a mask, I masked out the areas that I did not want.

    Now the questions:
    1. When she blinked, I wanted/needed to mimic that by changing the shape of the masks. How can I change the position of the vertices and the curvature of a mask? (They were already in place because I had tracked her eyes.)

    2. Once I had done all I could, I realized I had positioned her eyes, i.e. I had positioned the photoshop file too high. I wanted to shift it down, but keep the masks where they were. The overall effect would be to show a different part of the photoshop image, but in the same place as before.

    I had pick whipped the position of the photoshop file to my trackers, so I don’t know how to alter it. Using the transform effect did everything backwards: it kept the same part of the photoshop file showing, but shifted it to a different place.

    Obviously, I could go back to photoshop, adjust the source, and reload it, but is there an internal fix?

    Mike Derk replied 18 years, 6 months ago 2 Members · 3 Replies
  • 3 Replies
  • Mike Derk

    October 20, 2007 at 2:59 am

    I suppose I should add that the reason the original eyes were in the “right” place is that I used a “same frame as…” to get a reference.

    And I have CS3.

    And, I read about rotoscoping in the “click here first” and didn’t find the answer to my question.

  • Mike Clasby

    October 20, 2007 at 6:10 pm

    1) It’s always good to put the expression you created on a Null (or paste the tracker keyframe to the Null) then parent the eyes to the Null, that way you can adjust the relative position easily.

    If the eyes were right originally, then out of position later, does the footage need to be stabilized first?

    Methinks you need to look at Andrew’s tut ‘Demon Face”, as an aside he puts Sunglasses on Demon face, stabilizing the footage so the new Face and sunglasses stick correctly, then adding back the original movement. This is a must see for what you’re trying to do:

    https://library.creativecow.net/articles/kramer_andrew/Demon_Face_Warp.php

    2) You can change the shape of mask by keyframing the Mask Shape (MM reveals). set keyframes, then don the timeline drag a mask vertices to a new spot (or select more than 1 with a selection box you drag with your selection arrow), or double click any vertices to get a little transform box (like in PhotoShop) to resize, rotate the mask. Mask Shape Keyframes can be copied/Pasted like any others.

    So for you’re eye mask, if it 4 point, one left corner, top, right corner, and bottom, then set the Mask Shape keyframes, and 2 frames later (Page Down key 2 times, or however many frames you want it to take) single click on the top vertices, drag it don to the middle, then select the bottom vertices, drag up to make a slit. You can even adjust the Bezier handles of other vertices at the same time,. Three frames farther don, return the eye to normal, manually or copy that first Mask Shape keyframe an paste it in this spot.

    You should have a blink.

    Copy/Paste these three keyframes wherever you want the blink.

    One you get that down, if the blinking is excessive (beyond convenient Copy/Pasting, then you can do an expression to let Markers trigger or loop keyframes, like this:

    MARKER Triggers loop – This only really works if there’s not animation to they eye otherwise, the layer will stay at frame 0, then play from there when it hits a marker.

    1) Set up the blink at the beginning of the layer, so 3 Mask shape keyframes in the first 4 to 6 frames. Don’t worry, the blink will only happen later where you place the Marker, not in this actual spot.

    2) Precompose the layer (Layer>Precompose, Move All Attributes).

    To that precomp layer, Layer>Enable Time Remapping. And you should get two time remapping keyframes, one beginning, one end.

    3) Add this expression to Time Remapping (Copy the Expression, Alt-Click the Time Remapping Stopwatch, Paste, Click outside the box):

    n = 0;
    if (marker.numKeys > 0){
    n = marker.nearestKey(time).index;
    if (marker.key(n).time > time){
    n–;
    }
    }
    if (n > 0) t = time – marker.key(n).time + inPoint else t = inPoint;
    valueAtTime(t);

    Now place a Marker anywhere you want a blink. Place Marker by sleeting the layer and hitting the “*” key (Asterisk) on the numeric pad. Marker now gives you a blink. Add as many markers as you want blinks.

    This is a hack of a Dan Ebbert’s expression, several really.

  • Mike Derk

    October 20, 2007 at 10:53 pm

    I think using the Null to parent the eyes is going to be the missing link.

    I have seen the Demon Warp, and that’s basically what I did in my project, except I added the mask on to of the image (what would correspond to Andrew’s sunglasses). Only then did I realize that they were situated too high, so I’m getting a lot of white and not a lot of pupil. But it all tracks great. The right-place/wrong place thing is purely asthetic, but I still didn’t know how to fix it.

    I’ll hold onto those expressions. This is week one for me with AE, so I’ve got some baby steps to take first.

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