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

    Undo for NodeData plugins [SOLVED]

    SDK Help
    0
    3
    317
    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

      On 26/03/2015 at 07:28, xxxxxxxx wrote:

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

      ---------
      Hi.

      I am trying to get a NodeData plugin react to undo commands. The Plugin is attached to the document via a SceneHookData and inspectable via my own TreeView manager. It's also possible to change it's parameters in the AttributeManager, using the active object manager library.

      But these changes in the AM, do not react to undo commands. I tryied to override the NodeData::IsDocumentRelated() and NodeData::GetDocument() Methods, but it didn't work. Maybe i'm doing it wrong or missing something else.

      It is basically the same structure which we discussed in this thread and maybe it's part of the same problem.

      Cheers,
      Heinrich.

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

        On 27/03/2015 at 08:12, xxxxxxxx wrote:

        Hello Heinrich,

        do you process the MSG_DESCRIPTION_INITUNDO?
        Your code could look like so:

        case MSG_DESCRIPTION_INITUNDO:
        {
          DescriptionInitUndo* uData = static_cast<DescriptionInitUndo*>(node);
          if (!uData || !uData->doc)
            break;
          uData->doc->AddUndo(UNDOTYPE_CHANGE_SMALL, node);
          return true;
        }
        
        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          On 27/03/2015 at 09:22, xxxxxxxx wrote:

          That did the trick. Thank you very much.

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