Plugin Cafe Homepage
Forum Home Forum Home > Plugin Cafe > SDK Help
  New Posts New Posts
  FAQ FAQ  Forum Search

StartUndo triggers breakpoint.

Author
Message
  Topic Search Topic Search
peterakos View Drop Down
Member
Member


Joined: 2015 Jul 13
Online Status: Offline
Posts: 349
Direct Link To This Post Topic: StartUndo triggers breakpoint.
    Posted: 2018 Jun 01 at 6:26am

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 !
Back to Top
C4DS View Drop Down
Member
Member


Joined: 2015 Dec 01
Online Status: Offline
Posts: 235
Direct Link To This Post Posted: 2018 Jun 01 at 6:54am
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.

Back to Top
peterakos View Drop Down
Member
Member


Joined: 2015 Jul 13
Online Status: Offline
Posts: 349
Direct Link To This Post Posted: 2018 Jun 03 at 11:59pm
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.

Back to Top
Andreas Block View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2014 Oct 01
Location: Hannover
Online Status: Offline
Posts: 1878
Direct Link To This Post Posted: 2018 Jun 04 at 6:34am
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.

Cheers,
Andreas
SDK Support Engineer
Back to Top

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.61 [Free Express Edition]
Copyright ©2001-2009 Web Wiz

This page was generated in 0.109 seconds.