On 08/12/2014 at 05:27, xxxxxxxx wrote:
It is possible on Read() that the linked object does not exist in the document yet due to ordering of creation in C4D so that method is untrustworthy. I would also caution against using pointers (memory addresses) for storing data structures in file.
You could add a LINK description to your object and the link is automatically saved and loaded with the plugin object (document file) instead. C4D maintains the proper linked object reference. If you want, the description element can be hidden from the A.M. interface (i.e.: HIDDEN keyword) so that the user does not see it.
If the element must be dynamic, then GetDDescription() must be used and it gets trickier since now you must maintain a method to recreate the Link to the same object in the document (or in memory) each time.