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

    tx3008

    @tx3008

    0
    Reputation
    3
    Profile views
    3
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    tx3008 Unfollow Follow

    Latest posts made by tx3008

    • RE: How to use Python to implement rendering with Octane in C4D and export as PNG

      @Dunhou I understand now. I have tried it successfully. Thank you very much!

      posted in General Talk
      T
      tx3008
    • RE: How to use Python to implement rendering with Octane in C4D and export as PNG

      @Dunhou
      Thank you very much for answering my questions. I saw your library yesterday and tried to write like this

      from typing import Optional
      import c4d
      
      
      ID_OCTANE: int = 1029525 # Octane 
      ID_REDSHIFT: int = 1036219 # Redshift
      ID_ARNOLD: int = 1029988 # Arnold
      ID_VRAY: int = 1053272
      ID_CORONA: int = 1030480
      ID_LOOKS: int = 1054755
      ID_CENTILEO: int = 1036821
      ID_OCTANE_VIDEO_POST = 1029525 # octane render
      file_path="C:/Users/admin/Documents/WXWork/1688858265477290/Cache/File/2024-09/OC_light/11.png"
      
      doc: c4d.documents.BaseDocument  # The active document
      op: Optional[c4d.BaseObject]  # The active object, None if unselected
      
      def GetVideoPost(document: c4d.documents.BaseDocument = None, videopost: int = ID_REDSHIFT) -> Optional[c4d.documents.BaseVideoPost]:
          """
          Get the videopost of given render engine of filled document.
      
          Args:
              document (c4d.documents.BaseDocument, optional): Fill None to check active documents. Defaults to None.
              videopost (int, optional): The id of the videopost. Defaults to ID_REDSHIFT.
      
          Returns:
              Optional[c4d.documents.BaseVideoPost]: The videopost we get.
          """
          if not document:
              document = c4d.documents.GetActiveDocument()
      
          rdata: c4d.documents.RenderData = document.GetActiveRenderData()
          vpost: c4d.documents.BaseVideoPost = rdata.GetFirstVideoPost()
          theVp: c4d.documents.BaseVideoPost = None
      
          while vpost:
              print(vpost.GetType())
              if vpost.GetType() == int(ID_OCTANE_VIDEO_POST):
                  theVp = vpost
              vpost = vpost.GetNext()
          return theVp
      def main():
      
          OctaneRenderer = GetVideoPost(c4d.documents.GetActiveDocument(),ID_OCTANE)
      
          OctaneRenderer[c4d.SET_PASSES_FILEFORMAT] = 6 # Octane PNG, 6 = PNG
          OctaneRenderer[c4d.SET_PASSES_SAVE_MAINPASS] = True
          OctaneRenderer[c4d.SET_PASSES_ENABLED] = True
          OctaneRenderer[c4d.SET_PASSES_SAVEPATH] = file_path
      
          c4d.EventAdd()
      
      if __name__=='__main__':
          main()
      

      But there are no images generated in the directory. What could be the reason?

      posted in General Talk
      T
      tx3008
    • How to use Python to implement rendering with Octane in C4D and export as PNG

      How to use Python to implement rendering with Octane in C4D and export as PNG

      posted in General Talk python
      T
      tx3008