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. tash
    3. Posts
    T
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 4
    • Best 0
    • Controversial 0
    • Groups 0

    Posts made by tash

    • RE: How to change render setting before add BatchRender

      Thank you for your very kindness support.πŸ₯Ί

      There are methods I didn't know about Python, so I learned a lot!
      I've already assembled the other parts, but I'm going to update it with the code you wrote.
      Please let me know if there is anything else!

      Cheers!

      posted in Cinema 4D SDK
      T
      tash
    • RE: How to change render setting before add BatchRender

      @ferdinand

      Ah. I found it.
      Found hint in C++ SDK Documents.

      https://developers.maxon.net/docs/cpp/2023_2/page_manual_renderdata.html

      doc = c4d.documents.LoadDocument(FILE_NAME, [ANY_SETTINGS])   
      
      rd = doc.GetFirstRenderData()
      
      while True:    
        if rd.GetName() == "typeB":
          break
      
        rd = rd.GetNext()
      
      doc.SetActiveRenderData(rd)
      
      // save
      
      

      I was able to do what I wanted to do!
      But please let me know if there is a better way.
      This code concerns an infinite loop if the "if" condition is not met.
      I'm still new to Python.

      thank you for your kindness 😌

      posted in Cinema 4D SDK
      T
      tash
    • RE: How to change render setting before add BatchRender

      Hi @ferdinand

      Thanks for your prompt reply.
      I gave you a simple code example, but I was imagining method 1.

      carry out your modifications of the document,

      doc = c4d.documents.LoadDocument(FILE_NAME, c4d.SCENEFILTER_OBJECTS | c4d.SCENEFILTER_MATERIALS)
      
      // Process changes to render settings here
      
      c4d.documents.SaveDocument(doc, f"{DIR}/FOOBAR.c4d", c4d.FORMAT_C4DEXPORT)
      

      I understand that the code will be like this. But... How should this be changed?
      For example, if the document render settings exist as typeA, typeB, I don't know how to change from typeA to typeB...

      https://developers.maxon.net/docs/py/2023_2/modules/c4d.documents/BaseDocument/index.html#BaseDocument.SetActiveRenderData
      I think this is a little different (is this useful when changing advanced settings?)
      However, the BaseDocument class doesn't seem to have any other rendering settings.

      Thank you for teaching me.
      γ‚Ήγ‚―γƒͺγƒΌγƒ³γ‚·γƒ§γƒƒγƒˆ 2022-08-07 2.44.33.png

      posted in Cinema 4D SDK
      T
      tash
    • How to change render setting before add BatchRender

      Is it possible to change the rendering settings before AddFile to BatchRender? I could not find in the documentation how to change the rendering settings.

      I want to switch the rendering settings included in the c4d file.
      I would appreciate it if you could tell me.

      I am not good at English, so please let me know if it is difficult to understand.

      Thank you.

          file_paths = glob.glob(f'{DIR}/**/*.c4d')
      
          br = c4d.documents.GetBatchRender()
          br.Open()
      
          for i, file in enumerate(file_paths):
              // "**I want to switch the rendering settings included in the c4d file.**"
              br.AddFile(file, i)
      
      
      posted in Cinema 4D SDK r23 python
      T
      tash