Skip to main content
Inspiring
November 1, 2011
Question

[AI CS4 Mac] How to Create a Layer Clipping Mask?

  • November 1, 2011
  • 1 reply
  • 1104 views

Hi Folks,

How does one go about creating a layer clipping mask using the SDK?

What I want to do is to simulate clicking on the "Make/Release Clipping Mask" button (the left-most picture button) that is at the bottom of the Layers Panel.

Thanks!

-- Jim

This topic has been closed for replies.

1 reply

Inspiring
November 1, 2011

Never mind. I think I just figured it out.

I just created a clipping group and made it the first item in the layer's group (sAIArt->GetFirstArtOfLayer()).

I was having trouble with getting it to work, but as soon as I posted this message I found a bug and it started working.

If there is a better way, I'm all ears!

Thanks!

-- Jim

A. Patterson
Inspiring
November 1, 2011

Clipping masks work, but they can be a little clunky (as you might tell from their weird way of being set up). You might find opacity masks more flexible. An opacity mask is basically a group attached to a layer, in which you store paths that represent holes in the mask. These holes have an opacity value for how much shows through. So anything in the mask group is a hole (there can be many) and anything in the layer (as normal) shows through those holes. Setting it up is simpler but it depends on the kind of clipping you're trying to do which is easier. We find it easier when doing knockouts for labels on lines, but clipping paths are also possible, just a little more annoying.