Check which Renderengine Used

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

  • 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,"]"  
      # 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,"]"  
          # look for the next   
          bvp = bvp.GetNext()  
    if __name__=='__main__':  

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

    That helps me a lot. Thank you.

Log in to reply