Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python 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
    • Recent
    • Tags
    • Users
    • Login

    How to retrieve pass object channel ID [SOLVED]

    Scheduled Pinned Locked Moved PYTHON Development
    5 Posts 0 Posters 464 Views
    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.
    • H Offline
      Helper
      last edited by

      On 12/01/2016 at 12:17, xxxxxxxx wrote:

      Hi

      I have multiple object channel passes.
      How do I get the group ID that you can set for the pass in render settings?

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        On 13/01/2016 at 01:31, xxxxxxxx wrote:

        Hello,

        what exactly do you mean? Do you want to access the Group ID of the Render Buffer objects in the render settings? This can be done by accessing the render settings (GetActiveRenderData()) and then the multipass objects (GetFirstMultipass()) :

          
        renderData = doc.GetActiveRenderData()    
        mp = renderData.GetFirstMultipass()  
          
        while mp is not None:  
               
              passType = mp[c4d.MULTIPASSOBJECT_TYPE]  
                
              if passType == c4d.VPBUFFER_OBJECTBUFFER:  
                      bufferID = mp[c4d.MULTIPASSOBJECT_OBJECTBUFFER]  
                        
                      print("Buffer ID: "+str(bufferID))  
                
              mp = mp.GetNext()  
        

        best wishes,
        Sebastian

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          On 13/01/2016 at 08:48, xxxxxxxx wrote:

          Yes,  mp[c4d.MULTIPASSOBJECT_OBJECTBUFFER] is what i was searching for.
          While we are at the pass topic, the whole reason for these questions is to get the output name for a pass.

          Is there a way to get the pass name as it is written to disk?
          The value of the render token $pass?

          Or do I have to manually create a list like:
          if type=VPBUFFER_RGBA:
           name= "rgb"
          elif type=VPBUFFER_SHADOW
            name = "shadow"

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            On 14/01/2016 at 04:12, xxxxxxxx wrote:

            Hello,

            these strings are only handled internally in the core and it is not possible to directly obtain them. But you could simply read the name of the multipass object with GetName():

              
            renderData = doc.GetActiveRenderData()    
            mp = renderData.GetFirstMultipass()  
              
            while mp is not None:  
                   
                  print(mp.GetName())  
                    
                  mp = mp.GetNext()  
            

            best wishes,
            Sebastian

            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              On 14/01/2016 at 05:06, xxxxxxxx wrote:

              Hi

              Ok, then I have to use the workaround with the if type=.

              mp.GetName() returns the display name ($userpass) and not the internal name that is written to disk ($pass).

              thanks

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