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

    Accessing 3rd Party Engines

    Scheduled Pinned Locked Moved PYTHON Development
    5 Posts 0 Posters 508 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

      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

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

        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

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

          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.

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

            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.

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

              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).

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