Sorry folks, I keep spamming my topic! I've realised there's another issue. AddLayer() returns NULL, and from a topic I made previously (some time a go now) it was reported as a bug, but it's never been fixed by the looks of it.
How can I add layers to a MultipassBitmap!? How does the command Render to Picture Viewer do it?
edit by @ferdinand : Forked from Render settings Multi-Pass flag. Please open new topics for new questions, your follow up questions were too broad to be put into the same topic.
If you want the layer and folder to be displayed in the picture viewer you need to define the parameter MPBTYPE_SAVE to True.
MPBTYPE_SHOW is defined by default to true when you add a layer.
This parameter will just disable the layer as seen below. (the red eye)
This example will create a folder with a layer in it and another layer below the folder.
If it is working with pyhton, it should work with c++, you can share a bit of your code so we can reproduce it.
from typing import Optional
doc: c4d.documents.BaseDocument # The active document
op: Optional[c4d.BaseObject] # The active object, None if unselected
def main() -> None:
mpb = c4d.bitmaps.MultipassBitmap(640, 480, c4d.COLORMODE_ARGB)
folder1 = mpb.AddFolder(None)
layer1 = folder1.AddLayer(None, c4d.COLORMODE_ARGB)
layer2 = mpb.AddLayer(folder1, c4d.COLORMODE_ARGB)
if __name__ == '__main__':