C4D - AE Solid Overlap Issue
Hey there. I just starting learning the basics of C4D to AE workflow and I couldn't find a solution to an issue.
I made a cube that rotates all around in C4D, and put a compositing and external compositing tag on a null that's on the edge of the cube and checked "solid," in the hopes that I could bring it into AE and replace the solid with an image or text. Here it is in C4D - https://imgur.com/ZMTTWjs
I opened the C4D file in AE via Cineware, and it created a solid with the right position/orientation, and it follows the null perfectly. However, at a certain point, the solid "overlaps" the view of the cube, when the solid rotates to the bottom position of the cube. Here it is in AE - https://imgur.com/PnHhqAV
This is kind-of how I want it to look - https://imgur.com/XgKxmhP. With this, I rendered the C4D scene as an mp4, placed it in AE, placed the red solid underneath the clip, and placed a luma key on the mp4, getting rid of the black BG. The issue with this however, is that now the red solid doesn't show up when it's on the front side and faces the camera, as the cube is blocking it.
How would I go about having the red solid rotating around the cube, without it being visible when it's on the bottom, behind, or obscured by the main cube?
Can I assume that the Fancy cube is a 3D render that is now 2D footage? When you bring that footage into AE, it has no knowledge of depth so any layers you put on top of that layer will land in front and any layers you put behind will be obscured by the cube's alpha - even if those "in front" and "behind" layers are 3D solid layers. So putting the Red Solid on top, even though its a 3D layer, means it can't "go behind" the cube's flat render because there isn't really any behind to go to. You can think of it as : when you add a 2D layer (or an adjustment layer) into a 3D AE scene, wherever that 2D layer is in the stack AE flattens all the layers below and renders them along with that 2D layer on a 2D plane that sits at level 0. Any 3D layers above that layer start the 3D stack again with that newly rendered "flat" behind them.
So a couple of options.
You can split the Solid layer (cntl/shiftD), or whatever you are replacing the solid with- one for behind(below) and one for the front (on top) of the 2D render of the cube, and use the cube's alpha as a track matte for the one that sits behind (below). The top solid can just render on top and obscure the cube when it needs to and the behind one will be obscured by the cubes matte when it passes underneath. But that doesn't always work since the solid can be partially obscured itself AND partially obscure the cube at the same time. You can also get ringing when the solid is edge on - even though its a 3D layer it has no z depth itself - its flat flat flat.
You could render out a depth map or a position map of of the scene in C4D and use one of the 3D effects in AE to mask the solid based on the depth information.This isn't always the best and has some issues. You also need to render and comp in a high bit depth (not the same depth as the depth map) so that all the subtle differences in geometric depth can be captured.
You could use the track matte idea from the first solution and hand mask another layer of the solid in for spots where it both ends up behind and in front on the same frame.
I'm assuming you want to replace the solid with some other footage or you would have just rendered the whole thing in C4D and be done. Like an image that rotates about the cube?
You could use the cineware tools (or the C4D plug in if you are an older version of AE) and have the cube rendered from within After Effects. Then its truly 3D in the scene and the z position of the red solid is honored as it rotates in front and behind.
Thanks for the response Steve!
You are correct, I'm basically trying to see if I could replace the red solid with a video or image in AE, and have it rotate around without issue.
The first three solutions you listed are all viable, but I wan't to achieve a system where the solid rotates perfectly around in AE, without having to resort to masks, mattes, keying, etc if possible, as like you've mentioned, there may be some small detail-loss related issues and such.
So the odd thing is that I am using cineware, importing the c4d file directly into AE, and extracting the Cinema 4D scene data (i'm able to use AE cameras and such to manipulate the cube view in AE): https://imgur.com/nkmgzRp, but I think there is some strange conflict going on. Like you mentioned, the z position of the red solid should be honored through this, but I can't figure out exactly why it's not doing so.
I have a null that follows the rotation of the cube https://i.imgur.com/vnF7F10.png, and I also attached a compositing, and external compositing tag with the following settings to the null: https://i.imgur.com/PKHfn8U.png and https://i.imgur.com/a0qRMei.png. I've tried messing around with a bunch of the parameters but haven't found a solution yet.
I'm not sure how well AE handles 3d depth of obj's without 3rd party plugins. Have you tried to render the cube out with an object buffer pass? That should give you a matte to obscure the solid when it should be behind the cube.
OK rendering out a buffer solved my issue!!
What I ended up doing was making a flat primitive that was in the position of the rotated null, put a composting tag/buffer on it, brought both a render of the cube, and the luma render of the flat primitive, and set the red solid null as a luma track matte below the luma render.
I now have a clearer understanding of the c4d -> ae workflow. Thanks a ton Steve and Max!