Copy link to clipboard
Copied
Hi, i'm a beginner.
I'm trying to create a simple composition where a text change color when a shape layer pass through this text. The background is blue a text is white, when a big white square rotate over this text (obv the anchor is in bottom left) the text should become blue as text the backgroung and then become again white.
I thought to duplicate the text layer and apply a mask that follow the rotation of the square level but i can't do it, i've tried also with null object.
Is there a solution for it. I think it should be easy.
Thanks
Copy link to clipboard
Copied
User a duplicate/ pre-composition of the rotating square as a track matte.
Mylenium
Copy link to clipboard
Copied
Thanks mylenium. Could you explain me better please?
Copy link to clipboard
Copied
Track mattes allow you to use one layer to determine the visibility of another. Outlined here: https://helpx.adobe.com/after-effects/using/alpha-channels-masks-mattes.html
For your specific example, you have your shape and your text:
Create a duplicate of your shape layer, and move that above the text layer. Make a duplicate of your text layer, as well. Go ahead and change the color of this second version of the text.
If your Modes column is not visible, reveal it. You can do this by right-clicking in the header bar of the timeline columns:
...and/or it is often just hiding behind the Switches column (they share space, since they're the two most commonly-used columns here). There's a button at the bottom that allows you to toggle, or you can swap them by pressing the F4 key.
Now that you have the Modes column open, on your upper text layer ("Some text 2", in my example), set the Track Matte mode to Alpha Matte. It will use the layer directly above it to determine the visibility of THIS layer.
You should now see this second version of the text (blue in my example), only where that square exists.
Based on your description, I would now parent the top square (layer 1) to the bottom one (layer 4), so you only need to keyframe one of them. If your text will be moving at all, go ahead and parent those together as well.
Let us know if you have additional questions!
There are other ways to achieve this effect (that involve fewer duplicate layers), but this one seemed the most straightforward to explain.
To answer your original question, yes, it's possible to link a mask to a shape layer, but you'd likely need to offset the positions to make them visually line up, which would end up being more complicated for a user not familiar with expressions.
Good luck!
Copy link to clipboard
Copied
Thank you very much!
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more