Link Field kepp object after delete objec
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 22/09/2006 at 12:35, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R9.5
Platform:
Language(s) :---------
I have a XPresso-Tag with a Coffee-node.
In this node i get a userdata field : Link type.
This link I ask exist a link in this field.
if yes, i get GlobalMatrix and copy it to another objekt.
Now I test the XPresso:
All right, if I have a link in the data field, the GlobalMatrix will get from the link object. If not, user can change it by himself.
BUT when I delete the Objekt in the Szene, without delete it before in the userdata field, my XPresso-Tag shown the Object longer as exist and block the user changing of the object.
But there is no object.
If I make second ask:
if (YourCam)
{
if (doc->FindObject(YourCam->GetName()))
{
Will be the same, he find a object !
Why ?
Is it a bug, or a priority problem ? -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 22/09/2006 at 15:11, xxxxxxxx wrote:
If the user deleted the object from the document, but you had previously stored YourCam, YourCam will still point to memory (that is, not NULL) even though the object no longer exists.
You may need to go about this in the opposite direction. Store the name somewhere (as long as you can guarantee uniqueness) and first try to find the object. Then you are guaranteed to have a valid object pointer.
Have you considered BaseContainer::GetObject() and SetObject()? This seems to be rudimentary Link support for COFFEE and the return of GetObject() will reflect the existence of the object in the document.