On 18/08/2014 at 06:58, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 13-15
Platform: Windows ;
Language(s) : C++ ;
---------
Hi,
is there a way to prevent swapping the *op with *undo if the user clicks undo after MoveHandle?
My objectdata plugin works with rather complex data managing a kind of a grid consisting of splines, that are connected. These connection data is stored in private memory. The user is able to move these conection points around using handles. Works all perfect unless undo is clicked. Then, the private memory is invalid, since the object is swapped by the undo copy.
I've already overwritte the MoveHandle method, so that it doesn't call GetHandle from the undo copy.
Bool XXX::MoveHandle(BaseObject *op, BaseObject *undo, const Vector &mouse;_pos, LONG hit_id, QUALIFIER qualifier, BaseDraw *bd)
{
HandleInfo info;
GetHandle(op,hit_id,info);
SetHandle(op,hit_id,info.CalculateNewPosition(bd, op->GetMg(), mouse_pos),info);
return TRUE;
}
So I either need to prevent the undo copy swapping and provide a custom undo functionality or I need to find a way, that the undo copy includes the private data.
Any help is very appreciated!
Thanks,
Klaus