SOLVED SendModelingCommand c4d.MCOMMAND_JOIN

Hi!

The documentation for c4d.utils.SendModelingCommand states

doc (c4d.documents.BaseDocument) – The document for the operation. Should be set if possible. Must be set for MCOMMAND_JOIN [...]

But this code for example works fine:

splineA = c4d.BaseObject(c4d.Osplinecircle)
splineB = c4d.BaseObject(c4d.Osplinecircle)
splineB[c4d.PRIM_PLANE] = c4d.PRIM_PLANE_XZ
null = c4d.BaseObject(c4d.Onull)

splineA.InsertUnder(null)
splineB.InsertUnder(null)

splineC = c4d.utils.SendModelingCommand(c4d.MCOMMAND_JOIN, [null], doc=None)[0]
doc = c4d.documents.GetActiveDocument()
doc.InsertObject(splineC)

Is there a specific reason you should have a document to do that operation in?

On a side note it would be really helpful if the documentation stated that you need to have the objects in a null in order to merge them and not pass a list of the objects as you might think.

Hi @Boony2000, regarding the need for a document, this is mostly in the case of Object relying on scene element.
As an example, you pass an Object being deformed by an effector driven by a shader field. Since it really depends on the context, an exhaustive list can't be made by us since it will most likely miss some case.
However, we can't for sure improve the documentation on this point.

I will also add a note for the Null, this is indeed a counter-intuitive behavior that needs to be documented.

Thanks for your remarks,
Cheers,
Maxime.

Thanks for the info!