Solved Insert scene under object

Hello guys! I know how to merge a scene with a current project. But i have no idea how to insert scene under parent with coordinats of this parent.

I want to create custom nulls thats why i want to it. What should i add in this code if i want insert scene under object?

import c4d
def main():
    doc.StartUndo() # Start recording undos
    path = "C:\Users\Jamaletdinov.r\Desktop\ArrowR.c4d" 
    flags = c4d.SCENEFILTER_OBJECTS | c4d.SCENEFILTER_MATERIALS | c4d.SCENEFILTER_MERGESCENE 
    c4d.documents.MergeDocument(doc, path, flags) 
    c4d.EventAdd()
    doc.EndUndo() 
if __name__=='__main__':
    main()
  1. Set active scene first object to, for example, variable MyFirstObject.
  2. Merge another scene to active document. All new objects will be pasted on the top of all in hierarchy.
  3. Put all objects before MyFirstObject to null.
  4. Place the null where you need.

Checkout my python tutorials, plugins, scripts, xpresso presets and more
https://mikeudin.net

Hi,

There's no direct way of doing that. I see two possibilities:

  • Create an Xref as a child of the object, define the imported document as the document for the xref, make the xref editable.
  • Open your document and clone all objects one by one. You could end up with lofs of issues if the document has a lot of links. (material, effectors etc etc)

The problem is, as you can see on this thread, that some parameters of the xref are not accessible with python.
The problem with links can be handle with AliasTrans.

Cheers,
Manuel

MAXON SDK Specialist

MAXON Registered Developer

  1. Set active scene first object to, for example, variable MyFirstObject.
  2. Merge another scene to active document. All new objects will be pasted on the top of all in hierarchy.
  3. Put all objects before MyFirstObject to null.
  4. Place the null where you need.

Checkout my python tutorials, plugins, scripts, xpresso presets and more
https://mikeudin.net

hi,

hoo thanks a lot @mikeudin I somehow didn't though about this one xD

Cheers,
Manuel

MAXON SDK Specialist

MAXON Registered Developer

Mike, thank you a lot!