I use a lot of custom assets in every single project. Those assets can be very big MoGraph setups, Xpresso rigs, Python Generators or whatever. That’s why I had an idea to make a little script that merges your asset from absolute file path to your existing project.

Instead searching your asset every time in folders or content browser, you can simply create custom asset with this script and place it to Cinema 4D’s layout.

import c4d

def main():
    doc.StartUndo() # Start recording undos
    path = "C:\\c4d-assets\\my-asset.c4d" # Your asset file path, change this
    flags = c4d.SCENEFILTER_OBJECTS | c4d.SCENEFILTER_MATERIALS | c4d.SCENEFILTER_MERGESCENE # Merge objects and materials
    c4d.documents.MergeDocument(doc, path, flags) # Merge asset to active project
    c4d.EventAdd() # Refresh Cinema 4D
    doc.EndUndo() # Stop recording undos
if __name__=='__main__':
    main()

You can also use this to load models (obj, abc, fbx) or different c4d projects into your active document.
If you use Mac, use “/” instead “\\” (line 5)

Updated 26/03/2019

Cinema 4D, Python