[Closed] Referencing a node other than by its .name?
Is there a way to reference objects in the scene other than by it’s screen name?
Problem I’m having is trying to keep track of objects that have either been deleted or just renamed, is there some object ID tag that I can use to explicitly reference the object rather than by some fickle screen name?
Any suggestions appreciated.
D.
Edit: Sorry answered my own question, Node handles are what I was thinkin of…
AnimHandle system:
GetHandleByAnim – GetAnimByHandle
Node Handles:
inode.handle
Note that getAnimByHandle and getHandleByAnim are different every time when you reload the scene. For example:
GetHandleByAnim $Box001 – 3890P
Reload the scene
GetHandleByAnim $Box001 – 4565P
The inode.handle is saved with the scene, and when you reload the scene, the value will be the same. But, if you are merge scenes, the objects from the merged scene will have different inode.handle.
P.S. I didn’t saw your Edit.
Thanks miauu. The “GetHandleByAnim – GetAnimByHandle” was actually what i was thinking of to begin with, although thanks for pointing out that the anim handles change on reload.
The node handle will be most appropriate for my needs anyway as I need these handles remain persistent on reloads.
Cheers,
D.
Don’t forget that they are only persistent in the given file, merge the node into a new file and it then has a new handle. Have you looked at weak references using nodeTransformMonitor?
Thanks Pen. No I hadn’t looked at the nodeTransformMonitor, but will give it a try.