Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Adding Layers to a MultipassBitmap

    Cinema 4D SDK
    c++
    2
    2
    413
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • WickedPW
      WickedP
      last edited by ferdinand

      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?

      WP.

      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.

      wickedp.com

      1 Reply Last reply Reply Quote 0
      • ManuelM
        Manuel
        last edited by

        Hi,
        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)
        7375d915-1e62-4b6b-b174-3a16d05a5e20-image.png

        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
        import c4d
        
        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)
            folder1.SetParameter(c4d.MPBTYPE_NAME, "folder")
            folder1.SetParameter(c4d.MPBTYPE_SAVE, True)
        
            
            layer1 = folder1.AddLayer(None, c4d.COLORMODE_ARGB)
            layer1.SetParameter(c4d.MPBTYPE_NAME, "layer1")
            layer1.SetParameter(c4d.MPBTYPE_SAVE, True)
           
                
            layer2 = mpb.AddLayer(folder1, c4d.COLORMODE_ARGB)
            layer2.SetParameter(c4d.MPBTYPE_NAME, "layer2")
            layer2.SetParameter(c4d.MPBTYPE_SAVE, True)
            
            
            c4d.bitmaps.ShowBitmap(mpb)
        
        
        if __name__ == '__main__':
            main()
        

        Cheers,
        Manuel

        MAXON SDK Specialist

        MAXON Registered Developer

        1 Reply Last reply Reply Quote 0
        • First post
          Last post