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

    StartUndo triggers breakpoint.

    SDK Help
    0
    4
    1.2k
    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 01/06/2018 at 06:26, xxxxxxxx wrote:

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

      ---------
      Hello.

      I have a TagData plugin. In SetDParameter I check which parameter has been modified and depending on the result, I might change some other parameters as well.
      So, what I have to do is to encapsulate that change in a StartUndo and EndUndo.
      For some reason though StartUndo triggers a breakpoint, otherwise the undo/redo works correctly.
      How can I see what I do wrong ?

      Thank you for your time !

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

        On 01/06/2018 at 06:54, xxxxxxxx wrote:

        I thought tag parameters were already handled by Cinema's undo/redo system. Hence the need to provide CopyTo (and perferably Read and Write) methods.
        No need to perform your own StartUndo/EndUndo.

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

          On 03/06/2018 at 23:59, xxxxxxxx wrote:

          Hello and thank you for your answer !

          I need to synchronize a parameter in an object with a parameter in the a TagData applied to that object. I do that in SetDParameter method of the TagData. If the object is changed, I set the tag parameter in Execute method, while if the tag parameter is changed, I apply the change to the object in SetDParameter of Tag Data.

          Now, if ctrl-z is pressed, both tag and object parameters (which show the same value), should revert to their previous state. The problem is that it doesn't. So I assumed I had to use StartUndo in SetDParameter of the TagData. But Cinema4D triggers a breakpoint on StartUndo.

          How can I correctly synchronize 2 parameters in an object and TagData ?

          Thank you.

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

            On 04/06/2018 at 06:34, xxxxxxxx wrote:

            Hi,

            C4DS was pretty much right, Cinema 4D is already managing the undos on parameter changes. So you can't force it the way you tried. But there's a solution.
            MSG_DESCRIPTION_INITUNDO is the way to go here. Please see the code snippet in the Undo System Manual, it's already roughly what you want.

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