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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Check which Renderengine Used

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 539 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 15/01/2018 at 02:28, xxxxxxxx wrote:

      Hello, I need to check which Renderengine is use. 
      For Physical I can use:

      vp = rd.GetFirstVideoPost()
      if vp.GetType() == c4d.VPxmbsampler:
      	print "is Physical"
      

      But How Can I check if Vray or Redshift is used for example?

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

        On 16/01/2018 at 02:07, xxxxxxxx wrote:

        Hi Holgar, thanks for writing us.

        With reference to your question, rather than accessing the BaseVideoPost via RenderData::GetFirstVideoPost() I recommend to retrieve the active render engine from the active RenderData instance and querying for the RDATA_RENDERENGINE parameter.
        Once you've obtained the value which correspond to the engine ID (which is expected to be unique for any rendering engine) you could loop through the BaseVideoPost instances stored in the active RenderData and check for the same ID

          
        import c4d  
          
        def main() :  
          # retrieve the active RenderData instance   
          rd = doc.GetActiveRenderData()      
          if rd is None:  
              return  # this should never be the case    
          # retrieve the rendering engine ID currently in use  
          rdEngine = rd[c4d.RDATA_RENDERENGINE]  
          if rdEngine == 0:  
              print "Current render engine is Standard [", rdEngine,"]"  
              return       
          # retrieve the first BaseVideoPost instance  
          bvp = rd.GetFirstVideoPost()  
            
          # loop through the different BaseVideoPost instances inserted in the RenderData instance  
          # and search for the one matching the active rendering engine ID  
          while bvp is not None:  
              # retrieve the engine ID  
              bvpType = bvp.GetType()  
              # compare against the active engine ID  
              if bvpType == rdEngine:  
                  bvpName = bvp.GetName()  
                  print "Current render engine is", bvpName, "[", rdEngine,"]"  
                  return  
              # look for the next   
              bvp = bvp.GetNext()  
            
          
        if __name__=='__main__':  
          main()  
          
        
        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          On 16/01/2018 at 02:15, xxxxxxxx wrote:

          That helps me a lot. Thank you.

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