Compositing Grease Pencil

Hey. Is there a way to have GreasePencil work with Cryptomatte? Or any other way to have acces to different Grease Pencil Layers for Compositing / Postprocessing?
The only way I found so far is prerender to severall Imageseq/Videos?

Cryptomatte is only recognizing 3D surfaces. It does not take into account Grease Pencil objects.

But you can directly exploit your Grease Pencil layers in compositing nodes.
All you have to do precise in Grease Pencil Layer properties, under Adjustment panel, a ViewLayer dedicated to this GP layer.
The Grease Pencil layer will be rendered only in this View Layer and not in the other ones.

For example, you can populate a scene with lots of Grease Pencil objects using a “Fills” layer and a “Lines” layer. If you create corresponding Fills and Lines View Layers and assign them to each GP layer of each GP object ; you will end-up with all fills of scene in one Compositing View Layer and all lines in another one.

You also have the ability to indicate a Pass index per GP Material or GP layer that can be exploited by an ID Mask node.

1 Like

Works Perfect! Thanks alot

The last part doesn’t appear to be true. I made a grease pencil object, made squares and circles with different fills. Set the pass Index for each fill material. The mask Id doesn’t seem to recognise anything, just get a black screen in the viewer node.

looks like it didn’t work in old versions either. Unless i’ve done something wrong. I’d appreciate if you could provide a quick blend file if it works for you.

You are right. I was confused by speed of Grease Pencil changes and made a mistake.
Those pass indexes are not used by IDmask node for compositing but by GPO modifiers.

View Layer restriction should be sufficient to obtain any desired input for compositing.

Thanks for confirming. Yes view layers will have to do.