Object material that is completely transparent, but occludes other objects I'm trying to overlay some animated 3D models over live action footage. Some of the models (I'll call them collection A) will appear behind objects that are in the footage. I also have matching models for the live action objects that will be in front (collection B) and they are already animated to move exactly like the live action versions. I hope I'm explaining that clearly.
My issue is that I want to only be able to see the live action footage of collection B. I want the collection B 3D models to be transparent, but still occlude collection A so that collection A appears behind the footage of collection B.
I'm not sure that there's actually a way to do this, even with custom material nodes. I've seen posts describing a way to do it with compositing, but I wasn't able to replicate it. I would very much appreciate any help.
I'm on version 2.9, with the eevee engine.
Unfortunately, I can't upload my actual .blend file or screenshots, since this is for work. But as an example, in the screenshot below, I'd like the cube to be completely transparent, and the desert to show through. But I want the piece of the sphere that is covered by the cube to also be transparent, and the desert to show through that as well.

Here is my current compositing setup:
I think what you want is a holdout shader.  A holdout shader is like a transparent emission shader: wherever it is, it writes transparency (alpha 0).  It still gets occluded itself.

With the use of a holdout shader, you can then alpha layer your footage that describes both background and foreground objects.
Holdout shaders work both in Eevee and Cycles.