Static Mesh Primitive Component for Custom Depth Stencil

You should be able to do it anywhere as far as I know. This was in a normal blueprint actor.