THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 28/02/2008 at 05:29, xxxxxxxx wrote:
Cinema 4D Version: 10.111
Platform: Windows ;
Language(s) : C++ ;
is it possible to have undos of various objects and the document in a single undo block between StartUndo() and EndUndo()?
doc->StartUndo(); \> doc->AddUndo(UNDO_CHANGE, doc); // no idea how to place this \> Bool solo= solo_objects(doc, doc->GetFirstObject()); // function contains undos for objects \> if(solo) doc->GetDataInstance()->GetContainerInstance(SOLO_ID)->SetLong(ID_SOLO_SET, solo); \> else doc->GetDataInstance()->RemoveData(SOLO_ID); \> EventAdd(); \> doc->EndUndo(); \>
in the code above i have that recursive solo_objects function with an AddUndo() for every object in the scene/object manager. this works fine, everything is undone as intended except for the change to the document. and it doesnt matter whether i put doc->AddUndo(UNDO_CHANGE, doc) before that solo_objects function or inside it, right before the doc is modified. so is it possible at all? btw the only thing i do with the doc is storing a subcontainer in the doc's container but after clicking UNDO the container in the doc is still there, unlike the containers and changes to all the objects - that works fine.
i hope that was clear enough... thank you very much.