SOLVED Export objects with materials to new document

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! ☺ 👍

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.

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

The document containing the isolated objects.

Thank you all ! 👍