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:
Cinema 4D Version: 9.5
Platform: Windows ;
Language(s) : C++ ;
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;
Is there an explanation or must I explain more about my code?
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).
On 26/02/2006 at 04:14, xxxxxxxx wrote:
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,
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));