user29838: I am a beginner in After Effects. I came to know the TrkMat - Alpha Inverted Matte "Text" option to make the text transparent within a shape like the below image.

But when I move the text outside of the shape, it will stay as transparent.
Is there any way to make the text non-transparent when moving out of the shape like the below image? 

So that when an animation occurs, the text will be non-transparent at first and the portion going inside the shape will become transparent immediately. Please help me to know if I can do this. I couldn't find any solution from the internet.

user1950: It's harder to do than it should be, I guess because AE is layer-based rather than node-based like Fusion etc.
You're going to have to make a copy of both of your layers, parent each copy to the original layer – so you only have to move one of each – and arrange them so that your layer stack looks like
text
solid
solid
text

(or vice versa). Now make the bottom solid a track matte for the text layer, using alpha-inverted, so that the text is only visible where the solid isn't, and make the top text the track matte for the top solid, once again using alpha -inverted, so that it punches a hole in the top solid layer. The top solid will form the left hand part of the design and the bottom text the right side.
You could also use just the original layers and have one of them use difference mode, pre-comp them both and then use a extract effect to turn the black parts into transparency, but you'll then have to do the animating in a separate comp, which can make it harder to work with.
There is also the Set Matte effect. A lot of people struggle with this effect, it's a lot less intuitive than the slightly more complicated solutions above, so you'll have to do some research. A good explainer video here.

29838: <p>I am a beginner in <code>After Effects</code>. I came to know the <code>TrkMat</code> - <code>Alpha Inverted Matte "Text"</code> option to make the text transparent within a shape like the below image.</p>

<p><a href="https://i.stack.imgur.com/w6w75.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/w6w75.png" alt="enter image description here"></a></p>

<p>But when I move the text outside of the shape, it will stay as transparent.</p>

<p><strong>Is there any way to make the text non-transparent when moving out of the shape like the below image?</strong> </p>

<p><a href="https://i.stack.imgur.com/SMumc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SMumc.png" alt="enter image description here"></a></p>

<p><strong>So that when an animation occurs, the text will be non-transparent at first and the portion going inside the shape will become transparent immediately</strong>. Please help me to know if I can do this. I couldn't find any solution from the internet.</p>
 1950: <p>It's harder to do than it should be, I guess because AE is layer-based rather than node-based like Fusion etc.</p>

<p>You're going to have to make a copy of both of your layers, parent each copy to the original layer – so you only have to move one of each – and arrange them so that your layer stack looks like</p>

<pre><code>text
solid
solid
text
</code></pre>

<p>(or vice versa). Now make the bottom solid a track matte for the text layer, using alpha-inverted, so that the text is only visible where the solid <em>isn't</em>, and make the top text the track matte for the top solid, once again using alpha -inverted, so that it punches a hole in the top solid layer. The top solid will form the left hand part of the design and the bottom text the right side.</p>

<p>You could also use just the original layers and have one of them use difference mode, pre-comp them both and then use a extract effect to turn the black parts into transparency, but you'll then have to do the animating in a separate comp, which can make it harder to work with.</p>

<p>There is also the <strong>Set Matte</strong> effect. A lot of people struggle with this effect, it's a lot less intuitive than the slightly more complicated solutions above, so you'll have to do some research. A good explainer video <a href="https://www.youtube.com/watch?v=Qqk7IAPqsQ0" rel="nofollow noreferrer">here</a>.</p>
