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

    Removing IsolateObjects document

    Cinema 4D SDK
    r23 r25 c++ 2023 r20
    2
    3
    635
    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.
    • C4DSC
      C4DS
      last edited by

      I am using IsolateObjects to copy an object into a separate document in order to render a preview of the isolated object.

      The documentation mentions "The caller owns the pointed document."
      Do I simply need to perform a BaseDocument::Free on the obtained document?
      Or do I need to call KillDocument?

      1 Reply Last reply Reply Quote 0
      • C4DSC
        C4DS
        last edited by C4DS

        I was reading the original R20 documentation, when the above question popped up.
        Luckily, the latest online SDK documentation contains a BaseDocument Manual, where it mentions (if I understand it correctly) that KillDocument is to be called to remove a BaseDocument from the list.
        Which means KillDocument should only be used if a BaseDocument was created and inserted in the list (via InsertBaseDocument).

        So, as long as I use IsolateObjects without performing an InsertBaseDocument I should be fine with calling BaseDocument::Free to free the obtained basedocument.
        If I perform an IsolateObjects and subsequently call InsertBaseDocument then I should use KillDocument.
        Correct?

        1 Reply Last reply Reply Quote 0
        • ManuelM
          Manuel
          last edited by

          hi,

          yes, KillDocument is not necessary in that case.

          Cheers,
          Manuel

          MAXON SDK Specialist

          MAXON Registered Developer

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