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

    SendModelingCommand c4d.MCOMMAND_JOIN

    Cinema 4D SDK
    python
    2
    3
    629
    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.
    • B
      Boony2000
      last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • M
        m_adam
        last edited by

        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.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        1 Reply Last reply Reply Quote 0
        • B
          Boony2000
          last edited by

          Thanks for the info!

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