[Closed] How to distinguish objects that have same name?
Hi everyone,
Normally,we can select an object by its name,but if other objects have the same name,how can I select it?I remember there has a way to get an object’s ID,something like that,I am not sure,but I forgot what’s the function,can anyone help me?Thanks in advance!
Each node in the scene has a unique handle, you can get it like this:
$test.handle
Here’s the documentation on this:
On a side-note, although Max allows us to have duplicate names, I would highly discourage using them especially if you’re intending on writing scripted tools.
why do you think that ‘handle id’ is unique? because the help says this?
i would say that more likely that you can’t see more then one node in scene with a specified handle
if you are looking for unique id in the scene it’s the anim handle… but it might be different if you load this scene next time.
see the mxs help – AnimHandle System
Well, it’s unique to the scene, which is superficially unique and too brittle to be actually considered unique.
I suppose if he wanted something more unique he could install a NodeCreated callback, generate a GUID or ClassID and then store that to an appData channel in the node.
I still maintain that a workflow that encourages hash collisions isn’t very ideal.