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

    Export objects with materials to new document

    Cinema 4D SDK
    python r19
    1
    2
    393
    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.
    • A
      AndreAnjos
      last edited by AndreAnjos

      Hi all,

      I was wondering if there is a method or function that I can use to export the selected objects and its materials to a new document? I couldn't find one that worked...

      I'm sure that I can come up with some code that can can clone the objects and materials separately and then connected them in the new document.

      Thank you in advance! ☺ 👍

      1 Reply Last reply Reply Quote 0
      • A
        AndreAnjos
        last edited by

        Found it! ☺

        c4d.documents.IsolateObjects(doc, t_objects)

        A helper routine to copy the objects t_objects of document doc to a new document (returned). All materials associated are also copied over and the links are corrected.

        Parameters:
        doc (c4d.documents.BaseDocument) – The document that contains the objects in t_objects.
        t_objects (List[c4d.BaseObject]) – The objects to isolate.
        Return type:
        c4d.documents.BaseDocument

        Returns:
        The document containing the isolated objects.

        Thank you all ! 👍

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