Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python 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

    Cloning a document?

    Scheduled Pinned Locked Moved SDK Help
    6 Posts 0 Posters 406 Views
    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.
    • H Offline
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 29/10/2012 at 03:11, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:    
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      Hi,
      Is there a simple way to get a clone of a BaseDocument?

      I'm writing a plugin that the parses the active document and exports it to an external format. In some cases, this requires me to modify the document, and therefore I would like to work with a clone of the active document instead.

      Best regards
      /Filip

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 29/10/2012 at 05:01, xxxxxxxx wrote:

        Since BaseDocument is ultimately derived from C4DAtom you should be able to do:

          
        BaseDocument *cloned_doc = current_doc->GetClone(COPYFLAGS_0, NULL);   
        

        You'd need to try this to see if it works though.

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 29/10/2012 at 06:14, xxxxxxxx wrote:

          Thanks, I'll try that.

          /Filip

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

            On 30/10/2012 at 01:27, xxxxxxxx wrote:

            Tried it and it seems to work fine. Thanks for the help! A follow up question:

            According to the docs, I own the BaseDocument returned by GetClone(). Right now, I'm freeing the document with BaseDocument::Free(cloned_document), is that the right way to do it?

            Best regards
            /Filip

            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

              On 30/10/2012 at 02:01, xxxxxxxx wrote:

              That would be how I would do it, yes.

              1 Reply Last reply Reply Quote 0
              • H Offline
                Helper
                last edited by

                THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

                On 30/10/2012 at 08:25, xxxxxxxx wrote:

                OK, thanks!

                /Filip

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