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

    How to adjust output path in Python Batchrender class?

    Cinema 4D SDK
    python r21
    3
    3
    697
    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.
    • I
      ilad
      last edited by Manuel

      Hi , i am batch rendering images with different output path in Python , i want to adjust the output path when i add image render to render queue in Python

      Is there any way to finish that ?i Google a lot and look through documents , but there is no explicit way to do that ..

      I really need this function cause i need render thousand of images in C4D , and if no solution , i have to manually adjust the render queue output path , which would be a disaster to me , kill my great designer dream in baby.

      Thanks if you have any ideas ! Love you .

      1 Reply Last reply Reply Quote 0
      • P
        PluginStudent
        last edited by

        I guess you could

        • load the file you want to render with LoadDocument()
        • change the c4d.RDATA_PATH in the document's render settings
        • save the file with SaveDocument()
        • and add that saved document to the render queue, so the render queue's "Output File" uses the document's render path
        1 Reply Last reply Reply Quote 0
        • M
          m_adam
          last edited by

          Hi sorry I overlook your answers,

          There is no way to directly change the path in the RenderQueue to do so, you have to edit the document.
          So before adding a document, you need to load them, then define the path in the render setting and then resave the file.
          Here a quick example.

          import c4d
          
          # Load the document
          docPath = r"PATHtoc4dFile.c4d"
          doc = c4d.documents.LoadDocument(docPath, c4d.SCENEFILTER_OBJECTS | c4d.SCENEFILTER_MATERIALS, None)
          
          # Retrieves the active render setting
          renderData = doc.GetActiveRenderData()
          
          # Set the new path for the picture
          renderData[c4d.RDATA_PATH] = r"MyPicturePath.exr"
          
          # Save the document
          c4d.documents.SaveDocument(doc, docPath, c4d.SAVEDOCUMENTFLAGS_DONTADDTORECENTLIST, c4d.FORMAT_C4DEXPORT)
          

          Cheers,
          Maxime.

          MAXON SDK Specialist

          Development Blog, MAXON Registered Developer

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