Skip to main content
Known Participant
October 12, 2018
Answered

creating a compound shape/mask from a moving shape layer or mask

  • October 12, 2018
  • 2 replies
  • 1555 views

I'm trying to figure out a way to take a rectangular shape ( or mask ), keyframe movement of that shape( or mask ) on a path, and where ever that object travels, it leaves a trail in the form of one continuous compound shape or mask. 

I'm just not sure where to start.     thanks for your suggestions!

    This topic has been closed for replies.
    Correct answer Rick Gerard

    For a hand erasing a chalkboard, I would probably use the following technique. The footage for the project I will share come from Adobe Stock. The project is not polished but it will show you the technique of creating a track matte to erase your line drawing using Motion Tracking and Paint. You'll find the footage here: 216033535, and you can download a watermarked copy for free. This took me about 15 minutes to do.

    Here's a step by step to reproduce this project:

    1. Create a library in Adobe stock and download this clip 216033535
    2. Drag the clip from the Library panel in AE to your Project panel
    3. Create a new comp from the clip (File>New Composition from selected is an easy way to do that)
    4. Open up the Motion Tracking workspace, select the clip, move down the timeline to the place where the hand first starts to erase the board
    5. Make sure the footage is selected in the Motion Tracking Panel and check Track Motion
    6. Adjust the feature region and search area to include enough detail that the track will hold. Tracking will be fairly slow with this setup but it is still going to be faster than setting up a bunch of keyframes by hand fo most footage. The setup should look something like this:
    7. When I do motion tracking I usually go to the Preferences>Display and select no motion path because it's easier to make adjustments without all of those keyframes cluttering up the scene
    8. Start tracking forward. If the tracker loses its way stop, adjust the position of the Feature Area and continue. I had to stop 3 times during this track and make adjustments
    9. When you have finished the track add a small solid (easier to see than a null) to the composition about 100 X 100 pixels, select the solid as the Target for the tracker and click apply. The solid should snap into position. I like to use blend modes so I can see through the solid and make sure that the track is good. I didn't have to adjust any of the position keyframes. The track was good enough for this job. Your comp should look something like this:
    10. Add a new comp-sized solid to the timeline (Ctrl/Cmnd + y), change to the Paint workspace, select the paint tool (Ctrl/Cmnd + b), make sure the mode is set to write on and draw a short path on the solid layer anywhere
    11. Reveal all modified properties in the Paint layer, spin down Paint to reveal Paint on Transparent and turn that on and you'll see something like this:
    12. Drag the last keyframe for Paint>Brush 1>Stroke Options>End so it lines up with the last position keyframe for the small solid
    13. Here comes the magic. Select the Small Solid Position property and make sure all of the keyframes are highlighted, copy (Ctrl/Cmnd + c), then select the Brush 1 Path property making sure it is highlighted and Paste (Ctrl/Cmnd + v). You can now move down the CTI to the end of the track and see the entire stroke.
    14. The stroke will probably be out of position quite a bit. Look for the Transform Brush 1>Position property and reset it to zero.
    15. You will adjust the size, roundness and rotation of the brush later, for now just leave it round. You will have to adjust the timing by modifying the end value in several places. The easiest technique is to move to a point where the action changes direction and then click and drag the End value until the brush lines up with the position of the Small Solid. It took me about 3 or 4 minutes to make the timing adjustments to get the paint stroke in sync with the hand. To make it easier to track the hand you can temporarily add a simple expression to the Start property that subtracts about .2 from the End value so you have a moving point. Once you have the timing fixed you can disable the expression and move to the next step. The expression looks like this:
               effect("Paint").stroke("Brush 1").strokeOption.end - .2
    16. After disabling or deleting the expression your comp will look something like this:

    1. When the timing has been adjusted all that is left is to adjust the diameter, roundness, and angle of the brush to make sure it is big enough to approximately cover the moving eraser. A few tweaks to the brush anchor point may be needed to get things to line up properly. As you can tell I usually use a blend mode for the paint layer so I can see through it also because it makes ajustments easier to make. When you are done you'll end up with something like this:
    2. The last steps for your project would be to add a background layer for the chalkboard, add the line drawing you want to erase, move the Paint layer above the drawing and make it an Alpha Inverted Track Matte for the drawing. You can test that and see that the paint layer erases the drawing and leaves the background. The last step is to put the original footage on top, apply Keylight and remove the original chalkboard. Your final comp would look something like this:

    You'll find the sample comp here. Dropbox - Paint On Mask.aep I might turn this into a video tutorial. It worked out fairly well. This sample comp needs a fair amount of cleanup to make it perfect but it should point you in the right direction. You could practice cleaning it up a little before you takled your own project.

    Note: Your browser may add a .txt extension to the AEP file when it is downloaded. If it does just delete it and the project should open for you.

    2 replies

    Known Participant
    October 12, 2018

    thanks so much for the advice!  Clearly I'm diving in the deep end when I probably should stick to the shallows, but sometimes it's the best way to learn....  sink or swim....

    Rick GerardCommunity ExpertCorrect answer
    Community Expert
    October 13, 2018

    For a hand erasing a chalkboard, I would probably use the following technique. The footage for the project I will share come from Adobe Stock. The project is not polished but it will show you the technique of creating a track matte to erase your line drawing using Motion Tracking and Paint. You'll find the footage here: 216033535, and you can download a watermarked copy for free. This took me about 15 minutes to do.

    Here's a step by step to reproduce this project:

    1. Create a library in Adobe stock and download this clip 216033535
    2. Drag the clip from the Library panel in AE to your Project panel
    3. Create a new comp from the clip (File>New Composition from selected is an easy way to do that)
    4. Open up the Motion Tracking workspace, select the clip, move down the timeline to the place where the hand first starts to erase the board
    5. Make sure the footage is selected in the Motion Tracking Panel and check Track Motion
    6. Adjust the feature region and search area to include enough detail that the track will hold. Tracking will be fairly slow with this setup but it is still going to be faster than setting up a bunch of keyframes by hand fo most footage. The setup should look something like this:
    7. When I do motion tracking I usually go to the Preferences>Display and select no motion path because it's easier to make adjustments without all of those keyframes cluttering up the scene
    8. Start tracking forward. If the tracker loses its way stop, adjust the position of the Feature Area and continue. I had to stop 3 times during this track and make adjustments
    9. When you have finished the track add a small solid (easier to see than a null) to the composition about 100 X 100 pixels, select the solid as the Target for the tracker and click apply. The solid should snap into position. I like to use blend modes so I can see through the solid and make sure that the track is good. I didn't have to adjust any of the position keyframes. The track was good enough for this job. Your comp should look something like this:
    10. Add a new comp-sized solid to the timeline (Ctrl/Cmnd + y), change to the Paint workspace, select the paint tool (Ctrl/Cmnd + b), make sure the mode is set to write on and draw a short path on the solid layer anywhere
    11. Reveal all modified properties in the Paint layer, spin down Paint to reveal Paint on Transparent and turn that on and you'll see something like this:
    12. Drag the last keyframe for Paint>Brush 1>Stroke Options>End so it lines up with the last position keyframe for the small solid
    13. Here comes the magic. Select the Small Solid Position property and make sure all of the keyframes are highlighted, copy (Ctrl/Cmnd + c), then select the Brush 1 Path property making sure it is highlighted and Paste (Ctrl/Cmnd + v). You can now move down the CTI to the end of the track and see the entire stroke.
    14. The stroke will probably be out of position quite a bit. Look for the Transform Brush 1>Position property and reset it to zero.
    15. You will adjust the size, roundness and rotation of the brush later, for now just leave it round. You will have to adjust the timing by modifying the end value in several places. The easiest technique is to move to a point where the action changes direction and then click and drag the End value until the brush lines up with the position of the Small Solid. It took me about 3 or 4 minutes to make the timing adjustments to get the paint stroke in sync with the hand. To make it easier to track the hand you can temporarily add a simple expression to the Start property that subtracts about .2 from the End value so you have a moving point. Once you have the timing fixed you can disable the expression and move to the next step. The expression looks like this:
               effect("Paint").stroke("Brush 1").strokeOption.end - .2
    16. After disabling or deleting the expression your comp will look something like this:

    1. When the timing has been adjusted all that is left is to adjust the diameter, roundness, and angle of the brush to make sure it is big enough to approximately cover the moving eraser. A few tweaks to the brush anchor point may be needed to get things to line up properly. As you can tell I usually use a blend mode for the paint layer so I can see through it also because it makes ajustments easier to make. When you are done you'll end up with something like this:
    2. The last steps for your project would be to add a background layer for the chalkboard, add the line drawing you want to erase, move the Paint layer above the drawing and make it an Alpha Inverted Track Matte for the drawing. You can test that and see that the paint layer erases the drawing and leaves the background. The last step is to put the original footage on top, apply Keylight and remove the original chalkboard. Your final comp would look something like this:

    You'll find the sample comp here. Dropbox - Paint On Mask.aep I might turn this into a video tutorial. It worked out fairly well. This sample comp needs a fair amount of cleanup to make it perfect but it should point you in the right direction. You could practice cleaning it up a little before you takled your own project.

    Note: Your browser may add a .txt extension to the AEP file when it is downloaded. If it does just delete it and the project should open for you.

    Szalam
    Community Expert
    Community Expert
    October 12, 2018

    You can copy a motion path and paste it into a mask/shape path.

    Known Participant
    October 12, 2018

    I'm NOT trying to copy the path...  I want to create a shape or mask that covers everywhere that shape or mask travels in one continuous motion..

    For example, if I was trying to create in AE, "paint" being put on a wall with a roller..   I want to be able to create a shape or mask of the roller, track that shape or mask, and everywhere it is rolled on the wall, it leaves a trail of "paint" created by that shape.

    Szalam
    Community Expert
    Community Expert
    October 12, 2018

    I'm saying you can create a path that follows the motion and then you can use that path to drive any of a dozen different methods of creating a visible trail. Particle effects (several options), Stroke effect, Vegas effect, Write On effect, animating trim paths on a shape layer, etc.

    Alternatively, you could use something like Echo or CC Wide Time to leave a trail behind as well. It kind of depends on what you're picturing in your head.