StartUndo triggers breakpoint.



  • 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 !



  • 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.



  • 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.



  • 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.


Log in to reply