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

    Changing camera/take/render setting in the render queue

    Cinema 4D SDK
    2
    3
    932
    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.
    • B
      beezle
      last edited by

      Hey guys,
      I'm trying to write a script for batch rendering. I've seen a few scripts floating around that do this, but these are for adding a separate file for every render.
      Our pipeline is a bit different. We have many cameras in a single environment c4d file, each of which we need a single PSD octane render for. I can queue up the renders from the file using AddFile just fine, but they all populate with the same settings, rendering the same camera. I don't know how to access that new item in the queue so I can then change everything with the script that I can do manually through the dropdowns: the Camera most importantly, but also the Take and Render Settings if need be.
      Is there any way to do this?
      Thanks.

      1 Reply Last reply Reply Quote 0
      • M
        m_adam
        last edited by

        Hi @beezle unfortunately I'm afraid the API doesn't contain methods to update the Camera/Take/Render setting as you could do within the UI.
        So the only way is to load the document, edit the doc, save it, and load it.

        This was explained in How to adjust output path in Python Batchrender class?

        Cheers,
        Maxime.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        B 1 Reply Last reply Reply Quote 0
        • B
          beezle @m_adam
          last edited by beezle

          @m_adam Thanks. I gave that a shot, but unfortunately, it's still adding multiple copies of the same camera. Am I doing something wrong?

          docs = c4d.documents
          doc = docs.GetActiveDocument()
          cams = getSelectedCameras(doc.GetActiveObjects(0))
          path = doc.GetDocumentPath()
          cFile = path + '\\' + fName
          
          queue = docs.GetBatchRender()
          queue.Open()
          base = doc.GetActiveBaseDraw()
          for cam in cams:
              docs.LoadDocument(cFile, c4d.SCENEFILTER_OBJECTS | c4d.SCENEFILTER_MATERIALS)
              base.SetSceneCamera(cam)
              docs.SaveDocument(doc, cFile, c4d.SAVEDOCUMENTFLAGS_DONTADDTORECENTLIST, c4d.FORMAT_C4DEXPORT)
              queue.AddFile(cFile, queue.GetElementCount())
          
          1 Reply Last reply Reply Quote 0
          • First post
            Last post