Working with Layers
Layers are nearly identical to groups in concept, but they offer more flexibility and functionality. Whereas groups are used to combine design elements in a file, layers also allow you to organize and combine elements within a file. Just as groups can be nested within each other, so can layers. And just as groups are containers that hold contents within them, layers are containers as well. In addition, layers, just like groups, can also have attributes applied to them. As we explore the power of layers in Illustrator, all of these concepts will come to light.
The Layers Palette
You'll start learning to use layers by taking a look at the Layers palette and learning some of its simple functions. Then you'll put together everything that you've learned in this chapter to take full advantage of the power found in the Layers palette.
By default, all Illustrator documents are created with a single existing layer, called Layer 1. The buttons across the bottom of the palette are used to activate clipping masks (which we'll cover in detail in Chapter 5, Brushes, Symbols, and Masks), create new layers and new sublayers, and to delete layers. To the left of each layer are two boxes—the box on the far left controls layer visibility, whereas the other box enables locking ( Figure 3.29 ). The Layers palette menu contains duplicates of these functions, as well as some other functions that we'll cover when we talk about animation in Chapter 10, Illustrator and the Web.
Figure 3.29 All files are created with a blank layer in the Layers palette.
Double-clicking a layer enables you to specify several settings for that layer ( Figure 3.30 ):
- Name. Every layer can have its own distinct name. Layer names are important when you're creating SVG files and generally make files easier to work with. Naming layers is especially important when you're designing templates. A file littered with layers named Layer 1, Layer 2, Layer 3, can make editing a challenging task.
- Color. This setting is a bit deceiving because it doesn't add a fill color to the layer but instead defines the selection color used for the layer. When you select an object in Illustrator, the path of that object is highlighted so that you see what is selected. By assigning different colors to each layer, you can tell what objects belong to which layer by selecting the object and observing the highlight color. Setting a layer color to black or really light colors generally isn't a good idea because you won't be able to differentiate a selection from a regular path.
- Template. This setting is used specifically when you want to manually trace placed images. Setting a layer as a Template automatically locks the layer and sets the Dim Images setting to 50 percent. Although this makes it easier to see and draw over placed images, the new Live Trace feature makes this option less important.
- Show. This setting controls layer visibility (whether the art on a layer is shown or hidden) and performs the same function as clicking the show/hide icon in the Layers palette.
- Preview. This setting controls the preview setting for the chosen layer. By default, Illustrator's Preview mode is turned on, but unchecking this option displays the layer in Outline mode.
- Lock. This setting controls layer locking and performs the same function as clicking the lock/unlock icon in the Layers palette itself. Locking a layer effectively prevents you from selecting any object on that layer.
- Print. By default, all layers in a file will print. However, Illustrator allows you to uncheck this option to create a nonprinting layer. This can be useful when you want to add instructions to a template file or to explain how a file should be folded or printed, but you don't want those instructions to print. Layers that have the Print option turned off appear italicized in the Layers palette.
- Dim Images to. This option allows you to define an opacity setting for placed images. By making placed images dim, you can make it easier to manually trace them. This feature is often used in tandem with the Template function.
Figure 3.30 The Layer Options dialog allows you to specify settings for each layer—most notably, the name of the layer.
Object Hierarchy
When a layer contains artwork, a disclosure triangle appears just to the left of the layer. Clicking this triangle reveals the contents of the layer within the Layers palette ( Figure 3.31 , next page). Every object that appears in an Illustrator document appears listed in the Layers palette. The order in which items appear has significance—it indicates the stacking order, or object hierarchy of the file. Objects that appear at the bottom of the Layers palette are drawn first, and therefore they appear at the bottom of the object stacking order.
Figure 3.31 Clicking a disclosure triangle reveals the raw power of the Layers palette—the ability to view the entire object hierarchy of a file.
You can drag items listed in the Layers palette to adjust where they sit in the stacking order. Dragging an object from the bottom of the Layers palette to the top of the palette places that object at the top of the stacking order. It's important to note that each layer and each group also maintain their own stacking order. The Layers palette basically represents the stacking order of the entire file.
You can create nested layers by dragging one layer into another layer ( Figure 3.34 ). You can do the same with groups as well, which makes it easy to organize your artwork even after the art is created. In fact, this method of dragging items within the Layers palette makes it possible to move objects from one group and place them into another group. As you learned earlier in this chapter, groups can have attributes applied to them; this becomes significant because when you're moving an object into a group that has an attribute applied to it, that object takes on the attributes of the group. The reverse applies as well, so simply moving an object from one layer to another, or into or out of a group can change the appearance of the art in your file.
Figure 3.34 When you're dragging layers in the Layers palette, black arrows on the left and right indicate that you're moving a layer into another layer rather than above or below it.
Layers and Appearances
If you take another look at the Layers palette, you'll notice that to the right of every item listed is a small circle, called the target indicator ( Figure 3.35 ). If you remember, we spoke earlier about how the target controls where attributes are applied. If you take the same examples we used earlier, the ones of identical design elements of which one is grouped and one is not, you can clearly see how targeting works.
Figure 3.35 The little circles that appear on the right side of each layer are target indicators.
In the Layers palette, the ungrouped design element appears listed as separate paths, whereas the grouped design element appears as objects nested inside a group ( Figure 3.36 ). When you select the first design element, a double circle appears on each of the individual paths, indicating that those paths are targeted ( Figure 3.37 ). Now select the grouped design element and you'll see that although the objects are selected, the group is targeted ( Figure 3.38 ).
Figure 3.36 A quick look at the Layers palette reveals the hierarchy of the file. Layer 1 contains two path objects and a group. The group contains two path objects.
Figure 3.37 Selecting the path objects also targets the two individual paths. The large squares to the right indicate the objects are selected and the small square to the right of the layer indicates that some objects on the layer are selected, but not all of them.
Figure 3.38 When selecting the group, Illustrator's Smart Targeting feature targets the group, not the objects themselves. Notice the double circle target indicator appears only on the group, not the objects.
Now you'll add a drop shadow to each of the design elements. A quick glance at the Layers palette now shows that some of the target indicators are shaded or filled, whereas some of the target indicators are hollow ( Figure 3.39 ). Hollow circles indicate that the item listed has a basic appearance, whereas filled circles indicate that a complex appearance exists on that object (Adobe engineers refer to these filled circles as meatballs). Just by looking at the Layers palette, you can tell that the second design element has some kind of effect applied to the group. This is your first indication that ungrouping such a group will result in a change in appearance.
Figure 3.39 Shaded target indicators—meatballs—show where complex appearances exist.
You can manually target groups or layers by clicking the target indicator for that object. For example, you can target a layer and then use the Appearance palette to add a new stroke. The Appearance palette lists the attributes for the targeted layer, and if you look at the contents of the palette, you'll see that the stroke appears above the contents of the layer. Dragging the stroke underneath the contents of the layer causes the stroke to be drawn behind each of the objects on that layer ( Figure 3.40 ). When you drag a shape into such a layer the object automatically appears to have a stroked appearance, and when you drag any objects out of that layer, that stroked appearance disappears.
Figure 3.40 With a layer targeted, you can add appearances directly to the layer. Here, a stroke has been added to the layer, and the stroke has been moved to appear below the contents of the layer, adding an interesting outlining effect.
The important concept to remember is that taking a quick look at the Layers palette and scanning for meatballs helps you find complex appearances that appear in the file. In this way, you won't accidentally change a file's appearance just by grouping or ungrouping objects.
The Appearance palette is also useful in helping you understand how files are built because if you select an object that is part of a group or layer that has an appearance applied, the Appearance palette lists the group or layer above the target ( Figure 3.41 ).
Figure 3.41 When you select an object that is part of a group or layer that has a complex appearance, the Appearance palette alerts you to this by displaying multiple targets.