Accessing 3rd Party Engines



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 17/11/2011 at 04:59, xxxxxxxx wrote:

    Hi guys,
    I want to access and change rendersettings of 3rd Party Engines via Python, but at the moment it seems like I can't properly access the settings.
    Example:
    I want to turn off the reflections in the rendersettings. If I do this for the internal render engine everything works fine.

      
    doc = c4d.documents.GetActiveDocument()  
    rendersettings = doc.GetActiveRenderData()  
    rendersettings[c4d.RDATA_OPTION_REFLECTION] = False  
    c4d.EventAdd()  
    

    The same code won't work for external render engines.

      
    doc = c4d.documents.GetActiveDocument()  
    rendersettings = doc.GetActiveRenderData()  
    rendersettings[c4d.VP_VRAYBRIDGE_REFLREFR] = False  
    c4d.EventAdd()  
    

    I was told that C4D interprets 3rd Party Engines as Post-Effects, so "VP_" might stand for "VideoPost_" , I suppose? Then I understand that this code won't work as the external engine is not implemented in RenderData Class and so of course the "rendersettings" then don't know the attribute "c4d.VP_VRAYBRIDGE_REFLREFR". But in SDK I couldn't find the proper information to access the Post-Effects, so I'm kind of stuck right now.
    Is there a way to access 3rd Party Engines?

    Regards

    Christian



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 17/11/2011 at 05:40, xxxxxxxx wrote:

    I got it halfways working now (just had to look 2 threads below mine 😊).

      
    def check_vray() :  
      doc = c4d.documents.GetActiveDocument()  
      rdata = doc.GetActiveRenderData()  
        
      post = rdata.GetFirstVideoPost()  
      if post == None: return  
        
      while post:  
          if post.GetType() == 1019782:  
                
              post[c4d.VP_VRAYBRIDGE_REFLREFR] = 0  
              post = None  
              
          else:  
                
              post = post.GetNext()  
                    
      c4d.EventAdd()  
    if __name__=='__main__':  
      check_vray()  
      
    

    But there is a problem - if I change boolean values Cinema crashes. If I change numerical values everything works fine. It seems to be V-Ray related, because if I change boolean values in the Cineman Tab it works just fine.
    Is there any known behaviour which can cause this? Would the bugreport which is created help?

    Regards

    Christian



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 17/11/2011 at 07:42, xxxxxxxx wrote:

    Originally posted by xxxxxxxx

    But there is a problem - if I change boolean values Cinema crashes. If I change numerical values everything works fine. It seems to be V-Ray related, because if I change boolean values in the Cineman Tab it works just fine.

    If I understand, this crash:

    post[c4d.VP_VRAYBRIDGE_REFLREFR] = False
    

    and this work:

    post[c4d.VP_VRAYBRIDGE_REFLREFR] = 0
    

    ?

    EDIT: Have you tried to set another bool value ? VP_VRAYBRIDGE_LIMITDEPTH for example.

    Originally posted by xxxxxxxx

    Is there any known behaviour which can cause this? Would the bugreport which is created help?

    Yes, you can send the bugreport to Maxon first then to the developers of V-Ray for C4D.
    The bugreport can tell them if the application crashed in C4D or in the plugin.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 17/11/2011 at 07:49, xxxxxxxx wrote:

    No this is not what I meant, sorry if I was unclear about it.
    Neither "False" or "0" are working for booleans. It doesn't make a difference, everytime I try to change the boolean value it crashes.
    I meant numerical Values for things like max. Value for Anti-Aliasing, or Transparency Levels etc., values which really are numerical data types.
    As I said - for CineMan (I tried it there because its also a VP and external render engine) it works just fine. Also the error message says that "vraybridge.cdl64" is causing the crash, so it should definetly be V-Ray related at least.
    I'm in contact with Stefan who is responsible for V-Ray and he says that it works fine if you write the Code with C+. So it seems that there's something of with V-Ray <-> Python. I also sent him my _bugreport.txt, should I send it to Maxon either, if it seems V-Ray related?
    edit:
    Yes I also tried other boolean checkboxes, crashed there too.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 17/11/2011 at 08:11, xxxxxxxx wrote:

    Originally posted by xxxxxxxx

    No this is not what I meant, sorry if I was unclear about it.
    Neither "False" or "0" are working for booleans. It doesn't make a difference, everytime I try to change the boolean value it crashes.
    I meant numerical Values for things like max. Value for Anti-Aliasing, or Transparency Levels etc., values which really are numerical data types.

    Thanks for the clarification 🙂.

    Originally posted by xxxxxxxx

    As I said - for CineMan (I tried it there because its also a VP and external render engine) it works just fine. Also the error message says that "vraybridge.cdl64" is causing the crash, so it should definetly be V-Ray related at least.
    I'm in contact with Stefan who is responsible for V-Ray and he says that it works fine if you write the Code with C+. So it seems that there's something of with V-Ray <-> Python. I also sent him my _bugreport.txt, should I send it to Maxon either, if it seems V-Ray related?

    You should send the bugreport to Maxon, to see if it's a C4D problem (Python or something else).


Log in to reply