Maxon Developers
    • Downloads
      • All Downloads
      • Cinema 4D Python SDK
      • Cinema 4D C++ SDK
      • Cineware SDK
      • ZBrush GoZ SDK
      • Cinema 4D Python Examples
      • Cinema 4D C++ Examples
      • Project Tool
      • SDK Database
    • Documentation
      • Cinema 4D Python SDK
      • Cinema 4D C++ SDK
      • Cineware SDK
      • ZBrush GoZ SDK
    • Forum
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Forums
      • Overview
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • News & Information
      • Downloads
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Register
    • Login

    help with undo needed

    SDK Help
    0
    5
    57
    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
      Helper
      last edited by

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

      On 17/08/2006 at 01:20, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   9.6 
      Platform:   Windows  ;   
      Language(s) :   C.O.F.F.E.E  ;

      ---------
      Hi,

      I am new to coffee programming and have some problems with a script I wrote which I want to offer a proper undo. The script deletes several objects in the scene. When I want to undo the script action I have to do an undo for every deletion the script did. object by object.

      What I want is that the whole script action will be just one undo step.

      I tried with startundo(), endundo() and several addundo()'s in between but it does not work.

      So how can I combine several deletions in just one undo step?

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

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

        On 19/08/2006 at 04:49, xxxxxxxx wrote:

        Since I got no reply yet I try it another way to explain my problem:

        In the code beneath I delete 2 objects. When I undo the action I have to do undo twice for every deleted object. How can I combine the 2 undo's into one? Can you maybe give me an example with the code snippet beneath?

        main(doc,op)
        {
                doc->StartUndo();
                var op2 = op->GetNext();
                doc->AddUndo(UNDO_OBJECT,op);       
                CallCommand(12109); // Delete (Selected Object)
                doc->SetActiveObject(op2);
                doc->AddUndo(UNDO_OBJECT,op2);
                CallCommand(12109); // Delete (Selected Object)
                doc->EndUndo();
        }

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

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

          On 19/08/2006 at 05:39, xxxxxxxx wrote:

          Have you tried replacing UNDO_OBJECT with UNDO_OBJECT_DEL?

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

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

            On 19/08/2006 at 05:42, xxxxxxxx wrote:

            yes i tried it and all other sorts of stuff but nothing worked as I want it to work. maybe this undo thing is limited within a script? I dunno.

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

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

              On 19/08/2006 at 08:23, xxxxxxxx wrote:

              It is possible as I haven't had any difficulties in doing multiple AddUndo()s in COFFEE - but this is using v6.3 and as a plugin. So, it could be the script facet or the version. Have you tried this as a basic menu plugin to see if it has the same problem?

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