[Closed] SDK: Object equality?
I’m trying to check the equality of two items in the SDK (SplineShape’s), but I can’t find anything that indicates a unique ID for the item. Is there one?
you can use
CoreExport AnimHandle Animatable::GetHandleByAnim ( Animatable * anim ) [static]
When you have the INode objects as pointers you can simply compare them with “==”.
When you have the INode objects as pointers you can simply compare them with “==”.
Every Animatable is given a handle value when allocated. The values are unique within a scene, but are not saved with the scene, and no guarantees are provided about handle values from one load to another. Handles are intended for use as sort/hash keys, when load and save are not required. They are safer than pointers, since the Animatable may be deleted, in which case the handle value is never reused for another Animatable within the current session, and searching for the Animatable via GetAnimByHandle() simply yields NULL.
so there maybe a case where you can copy/store a pointer value, the node/object is deleted and later a new but different node/object is created at that address. Now a comparison test would produce true in that case.