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
    1. Maxon Developers Forum
    2. bonsak
    3. Best
    B
    • Profile
    • Following 0
    • Followers 1
    • Topics 8
    • Posts 31
    • Best 1
    • Controversial 0
    • Groups 0

    Best posts made by bonsak

    • RE: Child render setting does not inhertit from parent

      Hi @ferdinand
      Thanks for looking into this.
      Sorry for not supplying enough info.
      This is in c4d version 24.037, Windows 10 and RS version 3.0.53
      I did actually tag the post initially 🙂

      I did some more digging and found out that if the renderdata i'm copying has non default values, the child will not get these values after the script has executed. Try this:

      • In your "My Render Settings" change the render resolution
      • Make a depth AOV in the RS AOV manager
      • Run the script
        = The resolution of the child is 1280x720 an there is no AOV in the childs RS AOV manager, but the parent has the same res as the original and a depth AOV in the manager (at least on my machine)

      But i figured out how to solve this by first inserting the child in the root of the Render Settings and then making it a child of the Redshift Deafult:

      import c4d
      import redshift
      from c4d import gui
      
      def MakeRsDefault(renderdata):
          default = renderdata.GetClone() # Clone active renderdata
          default.SetName("Redshift Default") # Set name
      
          # Set output format
          default[c4d.RDATA_FORMAT] = 1016606
          default[c4d.RDATA_FORMATDEPTH] = 2 # 32 bits
          default[c4d.RDATA_NAMEFORMAT] = 6 # name.000.ext
          doc.InsertRenderData(default) # insert new render setting
      
          # Set ACES 1.0
          defaultvprs = redshift.FindAddVideoPost(default, redshift.VPrsrenderer)
          defaultvprs[c4d.REDSHIFT_RENDERER_COLOR_MANAGEMENT_OCIO_VIEW] = 'ACES 1.0 SDR-video'
          defaultvprs[c4d.REDSHIFT_RENDERER_COLOR_MANAGEMENT_COMPENSATE_VIEW_TRANSFORM] = 1
      
          return default
      
      def MakeRsRaw(renderdata, parent):
          raw = c4d.documents.RenderData() # Clone active renderdata
          raw.SetName("Redshift Raw") # Set name
      
          # Set output format
          raw[c4d.RDATA_FORMAT] = 1016606
          raw[c4d.RDATA_FORMATDEPTH] = 2 # 32 bits
          raw[c4d.RDATA_NAMEFORMAT] = 6 # name.000.ext
          doc.InsertRenderData(raw) # insert "redshift raw"
      
          # Set Raw
          rawvprs = redshift.FindAddVideoPost(raw, redshift.VPrsrenderer)
          raw[c4d.RDATA_RENDERENGINE] = redshift.VPrsrenderer # Set Redshift as render
          rawvprs[c4d.REDSHIFT_RENDERER_COLOR_MANAGEMENT_OCIO_VIEW] = 'Raw'
          rawvprs[c4d.REDSHIFT_RENDERER_COLOR_MANAGEMENT_COMPENSATE_VIEW_TRANSFORM] = 0
          doc.InsertRenderData(raw, parent) # Make "redshift raw" a child of redshift default
      
          return raw
      
      def main():
          active = doc.GetActiveRenderData() # Get active renderdata
      
          # Check if Redshift is installed
          vprs = redshift.FindAddVideoPost(active, redshift.VPrsrenderer)
          if vprs is None:
              return
          # Check if Redshift is active render
          if active[c4d.RDATA_RENDERENGINE] == 1036219:
              parent = MakeRsDefault(active)
              child = MakeRsRaw(active, parent)
          else:
              gui.MessageDialog('Only works with Redshift Rendersettings')
              return
      
      
          # Set project settings for linear workflow
          doc[c4d.DOCUMENT_LINEARWORKFLOW] = 1
          doc[c4d.DOCUMENT_COLORPROFILE] = 0
      
          doc.SetActiveRenderData(parent) # set new setting as the active render setting
          parent.SetBit(c4d.BIT_ACTIVERENDERDATA)
          c4d.EventAdd()
      
      # Execute main()
      if __name__=='__main__':
          main()
      

      Regards
      Bonsak

      posted in Cinema 4D SDK
      B
      bonsak