PDA

View Full Version : Referencing a node other than by its .name?


Riffmaster
03-15-2012, 05:12 PM
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..

miauu
03-15-2012, 08:27 PM
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.

Riffmaster
03-15-2012, 09:17 PM
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.

PEN
03-16-2012, 01:32 AM
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?

Riffmaster
03-16-2012, 12:27 PM
Thanks Pen. No I hadn't looked at the nodeTransformMonitor, but will give it a try.

CGTalk Moderation
03-16-2012, 12:27 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.