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
    • Recent
    • Tags
    • Users
    • Login

    How do I use AddUndo with MergeDocument()?

    Scheduled Pinned Locked Moved SDK Help
    4 Posts 0 Posters 328 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 02/03/2010 at 04:48, xxxxxxxx wrote:

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

      ---------
      I am inserting objects from one C4D file into another using MergeDocument().

      If I want to add undo for that, how do I use the AddUndo()?
      Do I have to put a UNDO_NEW for each object inserted? Or do I have to put a UNDO_CHANGE before the MergeDocument command? In the latter case, what pointer do I need to pass in the AddUndo(type,pointer) command?

      Thanks for help.

      Juergen

      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 02/03/2010 at 04:52, xxxxxxxx wrote:

        As an addition: This is what I try to do:

          
        doc->StartUndo();   
        if (!MergeDocument(doc,bodyFile,SCENEFILTER_MATERIALS|SCENEFILTER_OBJECTS,NULL))   
        {   
        GePrint(GeLoadString(IDS_s**cE_ERROR_BODYOBJECT));   
        bodyOp = BaseObject::Alloc(Onull);   
        doc->InsertObject(bodyOp,NULL,NULL);   
        doc->AddUndo(UNDO_NEW, bodyOp);    //add an undo for the insertion   
        }   
        else   
        {   
        doc->AddUndo(????);    //add an undo for the MergeDocument ?   
        }   
        
        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 02/03/2010 at 07:38, xxxxxxxx wrote:

          MergeDocument() automatically creates an undo step. If want to have more control you have to use LoadDocument() and merge the objects manually.

          cheers,
          Matthias

          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 03/03/2010 at 03:23, xxxxxxxx wrote:

            I am fine with the automatic undo. Thanks for the info.

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