- Pre-compose the layers you want to mask and apply a track matte to the pre-comp using the mask. Think of pre-composing as an equivalent of creating a layer group.
- Use Set Matte effect on each of the layers you want to mask. This is easiest to do if you apply set matte once and then create an animation preset to apply to the other layers. Just get set matte to do what you want it to do on the first layer, Select Set matte in the ECW or in the Timeline, then go to Animation>Save animation preset. Then select all of the other layers you want to apply the set matte to and apply the preset.
- Put the mask at the bottom of the layers you want to mask and enable the preserve transparency switch, then nest this group in the composition with the other layers.
Here's another tip. You could define a custom color for all of the layers you want to use the matt on, then use the custom color for a group selection. This may make things easier down the line.
I think I did something similar before I posted my question but wanted to make sure if using nested comps is the only way.
I duplicated the comp, on one of the copies I deleted the layers I wanted to be masked and did the opposite in the other copy (I guess I should have useed pre-compose to make this in one step) In the other copy I created a solid on top and used it as a stencil for the layers below. Then I dropped that comp into the other.
I will try your method too.