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

    PY change GI settings?

    SDK Help
    0
    3
    562
    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
      Helper
      last edited by

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

      On 19/10/2010 at 08:19, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   12 
      Platform:      
      Language(s) :       PYTHON  ;

      ---------
      Hello there,

      with:

      import c4d
      from c4d import gui, documents

      def main() :
          doc = documents.GetActiveDocument()
          rd = doc.GetActiveRenderData()
          # get antialiasing
          AA_ = rd[c4d.RDATA_ANTIALIASING]
          # set antialiasing
          rd[c4d.RDATA_ANTIALIASING] = 2 #2 is best AA

      I can read and set Render data (AA, resolution, and so on)

      But:

      print rd[c4d.GI_SETUP_DATA_DIFFUSE_DEPTH]

      does not work (as it is a Post effect?)

      how can I get and set GI settings, and how can I look up wether GI is active as a post effect.

      Thanks a Lot!
      Jops

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

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

        On 19/10/2010 at 11:30, xxxxxxxx wrote:

        Hi Jops,

        first you have to iterate through the attached video posts and locate the GI video post. Just pass the render data object to this function and you get the GI video post object.

        def GetGIPostEffect(rd) :
            """
            Returns the GI post effect from a passed
            RenderData object
            
            :return: Can be None if  no GI VP found.
            """
            post = rd.GetFirstVideoPost()
            while post:
                if post.GetType()==c4d.VPglobalillumination:
                    return post
                post = post.GetNext()
            return None
        
        vpgi = GetGIPostEffect(rd)
        if vpgi: return
          
        vpgi[c4d.GI_SETUP_DATA_DIFFUSE_DEPTH]
        

        To check if its enabled or disabled use:

        vpgi.GetBit(c4d.BIT_VPDISABLED) #is True if its disabled
        

        Hope this helps!

        Cheers, Sebastian

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

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

          On 20/10/2010 at 00:30, xxxxxxxx wrote:

          Hi Sebastian,

          thanks for your quick and detailed reply 🙂

          Thanks a lot!!!

          Jops

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