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. sophiapreymaker
    S
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 2
    • Best 0
    • Controversial 0
    • Groups 0

    sophiapreymaker

    @sophiapreymaker

    0
    Reputation
    1
    Profile views
    2
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    sophiapreymaker Unfollow Follow

    Latest posts made by sophiapreymaker

    • RE: Converting ABC file to AEC using c4dpy?

      Hi Maxime, thanks for the information - so just to clarify, I need to use RDATA_PROJECTFILESAVE in order to export as an AEC?

      posted in Cinema 4D SDK
      S
      sophiapreymaker
    • Converting ABC file to AEC using c4dpy?

      Hello, I'm having a bit of trouble figuring out how to convert my ABC file to an AEC file using c4dpy. I wrote a script that works to convert it to a C4D file:

      import c4d
      
      def import_alembic_and_export_c4d(alembic_path):
          # Create a new document
          doc = c4d.documents.BaseDocument()
      
          # Load the Alembic file
          print(alembic_path)
          alembic_file = c4d.documents.LoadDocument(alembic_path, c4d.SCENEFILTER_MERGESCENE)
          if alembic_file is None:
              print("Failed to load Alembic file.")
              return
      
          c4d.documents.LoadFile(alembic_path)
          # Iterate through the objects in the Alembic file and add them to the target document
          for obj in alembic_file.GetObjects():
              doc.InsertObject(obj.Clone(), None, None)
      
           # Set the output path for the AEC file
          c4d_path = alembic_path.replace(".abc", ".c4d")
      
          c4d.documents.SaveDocument(doc, c4d_path, c4d.SAVEDOCUMENTFLAGS_NONE, c4d.FORMAT_C4DEXPORT)
          print(f"Exported C4D file: {c4d_path}")
      
      
      
      if __name__ == "__main__":
          import sys
          import os
          if len(sys.argv) != 2:
              print("Usage: python import_export.py /path/to/alembic.abc")
              sys.exit(1)
      
          alembic_path = sys.argv[1]
          import_alembic_and_export_c4d(alembic_path)
      

      Obviously, this creates a different type than I would like - is it possible to script something similar for creating an AEC file instead? I noticed there's no format option for AEC under saving the document, so I assume it would need to involve rendering instead?

      This would be for Cinema4D 2023 for Windows.

      Thank you!

      posted in Cinema 4D SDK windows python
      S
      sophiapreymaker