R19 Python Multipass (Arnold)



  • Hello,
    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()
    bmp.Init(x=2560, y=1536,depth=32)

    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)
    bmp.AddChannel(True, True)

    Is there a way to get the depth and specular added to the MultipassBitmap? Somehow it works automatically with BaseBitmap.

    Thank you,
    David



  • Hi David, thanks for reaching us.

    With regard to your support request, I've tried locally using the standard renderer and, assuming I've already enabled the Multi-Pass option in the Render Settings and created the two desired passes (Specular and Depth in this case), the script you've described (I guess extracted from here) works properly generating a final Multi-pass picture with the expected passes.

    Two notes from my side:

    • BaseBitmap::AddChannel is only responsible for adding an additional alpha channel not to fill it.
    • if you have not enabled the Multi-Pass option in the Render Settings or the passes you'r interested in are missing in the Render Settings, then Python is not the way to go, since you need to provide a MultipassObject as described in here.

    Can you please try to run your script with the standard renderer? If it fails even with it, we need to dig further, otherwise it's likely to be an issue with Arnold. In this last case, we can't be of any further help here.

    Looking forward your feedback, give best.
    Riccardo



  • Hi,

    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)
    C: 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?

    Thanks,
    David



  • Hi David, thanks for following up.

    Let's proceed step-by-step:

    • 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.

      I never wanted you to switch to the standard renderer for your production needs but just wanted to see if the script you where referring was working with the standard renderer.
      Having the script working with the standard rendered would have simply excluded any implication with the script itself.

    • Looking at C4DtoA it looks like that multiple passes are enabled by using the AOVs section in the Render Settings of Arnold and not using the MultiPass option which is indeed unavailable
      0_1548953966184_309b5158-03d1-43df-9c44-9992f92514ec-image.png
      When AOVs are set in Arnold via the Render Settings, it automatically creates a MultiPass bitmap where the different buffers are rendered, but adding an AOV in Arnold cannot be done via MultipassObject.

    Searching around, what instead I suggest is to look into the arnold_setup_cryptomatte.py script which should be located, on a correct C4DtoA installation, under <CinemaAppPath>/library/scripts/

    In this script you will find all the means to create new AOVs, adding them to the Render Settings panel and finally render your multi-pass bitmap in the picture viewer.

    Following the above hints I'm sure you'll succeed in generating correct multi-pass bitmap for your production purposes.

    Best, Riccardo



  • Hi Riccardo,

    the arnold_setup_cryptomatte.py was interesting. However it only sets up the driver. Which we already did beforehand.

    0_1548958372757_driver.png

    So we remain at the same problem.

    Here are the two beauty images: first BaseBitmap, second MultipassBitmap.

    0_1548958544005_process_a.png

    0_1548958566832_process_b.png


    Thank you for your help,
    David



  • Hi David, I think that this issue should be reported to SolidAngle since the first picture you posted (the output to BaseBitmap) in the last post looks like more a rendering artifact and, beside that, the difference in brightness looks like some sort of gamma correction not being correctly set.

    Looking forward any findings with SolidAngle, give best.

    Riccardo



  • Hi Riccardo,

    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,
    David