Undo and CustomDatatype
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 20/02/2006 at 12:44, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 9.5
Platform: Windows ;
Language(s) : C++ ;---------
Hi!
I need to save some points arrays in my Plugin. Thus, I have used the CustomDataType functions and it works fine. Now, I try to add Undo actions. My question is simple : how use the BaseContainer::AddUndo(LONG type, void *data) when data points to a element of a CustomDataType?
If the variable with the type of my CustomDataType is called MyData and contains the element Vector *arr, when I type
BaseDocument *doc = GetActiveDocument;
doc->AddUndo(UNDO_CHANGE, MyType.arr);
Cinema4D crashes.
Is there an explanation or must I explain more about my code?
Thanks. -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 22/02/2006 at 11:36, xxxxxxxx wrote:
You can't use AddUndo() in this way. The data must be included in the document. So you need to put this custom data type into the container of such an instance (e.g. an object).
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 26/02/2006 at 04:14, xxxxxxxx wrote:
Ok, thanks.
But, how can I put the custom data in a BaseContainer?
That is not clear in the documentation. Can you eventually post a little code?
Thanks in advance, -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 09/03/2006 at 15:54, xxxxxxxx wrote:
Use BaseContainer::SetData() with a GeData() intialized with your custom datatype. For example:
bc->SetData(MY_ID, GeData(MY_DATATYPE_ID, data));