This is not safe between sessions as IDs are dynamically generated and assigned 
in the order objects were created in the scene.  If an older object is deleted 
and the scene reopened, everything after it will have a new ID.

Matt



From: softimage-boun...@listproc.autodesk.com 
[mailto:softimage-boun...@listproc.autodesk.com] On Behalf Of Ciaran Moloney
Sent: Tuesday, June 04, 2013 8:52 AM
To: softimage@listproc.autodesk.com
Subject: Re: Persistent objects ids

Hi,
did you try XSIUtils.DataRepository.GetIdentifier() passing the siObjectGUID 
argument?
I've used this to keep track of ICE nodes without relying on name strings. It's 
persistent between sessions and is preserved when models are exported.
Works like a charm.
The only problem is that it's possibly a bit tricky to get a pointer back to 
the object, since you need to know what you're looking for. I use 
Application.FindObjects() to get a collection of objects of this class, then 
check for the ObjectGUID I'm looking for.

Ciaran


On Tue, Jun 4, 2013 at 12:49 PM, Michal Doniec 
<doni...@gmail.com<mailto:doni...@gmail.com>> wrote:
Hi,

Is there any obvious way I am missing which would allow me to identify objects 
in the scene, but not by name?
Something like ObjectID, but persistent between scene saves and loads. I can 
generate UUID or something similar using "ObjectAdded" event and store custom 
property but I'd rather avoid it.

I want to be able to track objects regardless if they were renamed or not.

--
----------
Michal
http://uk.linkedin.com/in/mdoniec

Reply via email to