I spoke with SolidAngle. Eventhough the problem has nothing to do with Arnold, they helped us to solve the issue.
There is a different behavior on Python when using BaseBitmap and MultipassBitmap for multiple renders.
We render thousands of elements from the object tree in C4D.
When you reuse a BaseBitmap the depth information will be saved for every element.
However when you do the same with a MultipassBitmap, it will only store the depth information for the first element.
Strangely this does not apply to the beauty image.
The solution is simple. We set up a new MultipassBitmap for every render call.
In hindsight, we should have initiated a new bitmap even for the BaseBitmap.
Thank you for time,
the arnold_setup_cryptomatte.py was interesting. However it only sets up the driver. Which we already did beforehand.
So we remain at the same problem.
Here are the two beauty images: first BaseBitmap, second MultipassBitmap.
Thank you for your help,
we talked about switching to the standard renderer. But this does not make sense. The materials and all the light is from Arnold. This means, I will not have a usefull beauty. Second, the depth settings are completly different aswell.
The things I know:
A: Arnold is capable of a correct beauty. (Seen in IPR Window and render with Script Multipass.)
B: Arnold is capable of a correct depth. (Seen in render with Script BaseBitmap)
The render settings are the same for both approaches. (We had enabled MultiPass-Options as you suggested)
What I need is A and B together. Something is slightly different when using BaseBitmap and MultipassBitmap (in a strange way).
I only change these two lines. How can it be, that if I use BaseBitmap, the depth pass saves correctly, but using MultipassBitmap, I lose all depth information. Why is the beauty slightly damaged with BaseBitmap, but not with MultipassBitmap?
We cannot tell whether it is an issue with Arnold, but it seems unlikely. I would think Arnold renders always the same, no matter what you define as bmp in Python. Do you even tell Arnold that I used a BaseBitmap or a MultipassBitmap???
We are now stuck in a situation, where I have to render twice. To get the beauty images with process A, depth and specular with process B.
This is not sustainable for the future.
Hope this information helps you.
What are the next steps?
we need to render EXR-files with beauty, depth and specular.
It renders out with Python:
res = documents.RenderDocument(doc, rd.GetData(), bmp, flags)
The problem is setting the correct bmp.
If we use BaseBitmap, it will damage the beauty but give me the correct depth and specular.
bmp = bitmaps.BaseBitmap()
However if we change it to MultipassBitmap, the beauty will perfect but the depth and specular is completly missing.
bmp = bitmaps.MultipassBitmap(2560, 1536, c4d.COLORMODE_RGB)
Is there a way to get the depth and specular added to the MultipassBitmap? Somehow it works automatically with BaseBitmap.