Today's installment will cover two questions I received on the same subject: masks.
The first question is from Scott Southerland, who asked:
Our bread and butter is packaging in Illustrator. This is the second time I've run into this mysterious dotted underline type layer thing. What is it, how does it get created? Where do they come from? :)
What Scott is referring to here are layers that appear in the Layers palette with a dashed underline beneath the name of the layer (or object). See the Group that appears at the bottom of the Layers palette in this screenshot:
If you select that Group and take a look at the Appearance palette (you know me), you'll notice that Illustrator indicates the Group as the target, and the target also has a dashed underline beneath it.
So what's with the dashed line?
The answer is that the dashed line is an indication that the object (or Group in this case) is an opacity mask. With the mask selected, you can take a look at the fully-expanded Transparency palette to see both the artwork and the mask.
The palette also allows you to disable the mask (Shift-click on it), edit the art and mask separately, or to release the mask (from the Transparency palette fly-out menu). Of course, there's plenty else you can do with opacity masks. I've spoken about them here, and of course, you can get more detailed information in the book.
This leads us to our second question, which was posed by long-time friend and artist supreme Ron Chan:
I came up with this strange anomaly that I never really thought about all the years I've been doing it - until I went through it step by step.
1 - Start off with two simple shapes
2- Make a mask (clipping mask) using the top object
3- Direct select a path segment of the mask and copy and paste in front
4- Complete the shape and fill it with a color
5- The shape is INSIDE the mask or at least is giving the appearance of being masked -- but how can that be? The shape is sitting on top of the mask! If you look at the layers the stacking order confirms it. Additionally, if you take another object, direct select the masked object, then paste in front -- that object also becomes part of the mask but is sitting two levels above the Clipping Mask (although it is still in the Group).
I always thought that an Clipping Mask always had to be on the top of the stacking order?
More weirdness. When I close and reopen the file again, the stacking order changed! The Clipping Mask is back on top of
everything. So I did it again, and yes the object is on top of the clipping mask but is still affected by the mask. I closed the file down and opened it up again -- viola! The stacking order changed so that the object is below the clipping mask.
Am I going crazy or what???
And so, the masked crusader strikes again! This is precisely why I urge people to utilize Layer Clipping Masks rather than just use the Object > Clipping Mask > Make command. Not because the result is that much different, but because it exposes something in the user interface that you might normally overlook. I discuss Layer Clipping Masks in detail here, and of course, you can find more detailed information in my book as well. But your question does require a bit of an additional explanation of how these things work.
First, it's always important to take a look at the Layers palette when working with masks. As we revealed in the first question above, items that are opacity masks show up with dashed underlines in the Layers palette. Well, items with a SOLID underline are clipping masks. When you create a Layer Clipping Mask, the object that is the topmost object in the layer becomes the mask for that entire layer. But here's the kicker -- once you've turned an object into a mask, it stays a mask, even if you change the stacking order. That means if you turn an object into a clipping mask, then change the stacking order in your layer so that the item with the underline (the mask) is not the top-most object anymore (see screenshot below), that object will still mask objects that appear above it, within that layer.
It appears that when you close and reopen the file, Illustrator moves the mask back to the top of the stacking order for you (maybe Teri can explain why -- maybe it's just because Illustrator cares about your sanity).
When you specify masks using the Object > Clipping Mask > Create command, Illustrator groups the objects together and makes the topmost object the mask (if you look within the Group in the Layers palette, you'll see it underlined) -- but again, once the mask is created, even if it's moved to a different spot in the stacking order, it will still act as a mask for that entire group.
In all of these cases, the solution is to release the mask, change the stacking order as desired, and then to reapply the mask.