Multiple bool undo problem
-
I'm having a weird problem on my plugin, there's a bool attribute that triggers generation of some geometry, and is not undoing correctly.
I can enable (see new geometry), Undo (geometry is gone), fine.
But if I enable (see new geometry) disable (erase geometry) and then Undo, I was expecting to go back to the enabled state, but nothing happens.
If I enable/disable several times, looks like Undo only works from the enabled to disabled state.
This was driving me crazy, but then i noticed that if I do something else in between the enable/disable, undo works.
Then I tried a native C4D node that has bool to test, like the Relief.
If I set some parameters, click Spherical, and undo, works fine.
But if I click Spherical several times, I see the same problem that I have on my plugin.
Undo works just once, and for enabled to disabled.Is that expected behaviour?
Is C4D just ignoring all my undos just because I came back to the previous state, then it just erases the last undo? -
Hi Roger, thanks for reaching out us.
With regard to the reported behavior, I'm able to reproduce it either with a custom ObjectData and the ordinary Cinema 4D standard tools (like cube generator and the Fillet option).
But there's more: if the undo operates on a parameter whose values is currently equal to its initializing value, the undo is simply ignored.
This can be easily tested and verified by initializing theBOOL
parameter used in the resource totrue
in theObjectData::Init()
: as you will see the result is simply the opposite of your reported case.To me the behavior is consistent but I will check with the team responsible and see if it can be considered a bug.
Best, Riccardo