THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 25/10/2005 at 15:31, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 9.1
Platform: Windows ;
Language(s) : C++ ;
---------
I tried using the following code to support Undo actions:
StopAllThreads();
if(!doc->StartUndo())
GePrint("StartUndo() failed!");
if(!doc->AddUndo(UNDO_CHANGE,op)) GePrint("AddUndo(UNDO_CHANGE,op) failed!");
//actually set new coords
p[frontpoint] -= result ^ axisstate;
if(!doc->EndUndo())
GePrint("EndUndo() failed!");
Where p is the PointObject pointer of op, which is the currently selected object. Only one point in the object gets moved.
When I try to undo it seems to work, but trying a second undo or a redo, cinema will die with an unhandled exception.
Any suggestions? Am I AddUndoing the wrong object?
Regards,
Zaphod