UUID vs OpenMaya MDagPath



I’m currently working on improving my toolbase, and one of the things I’m writing is a custom Maya node wrapper. The idea is basically to have a custom class, which returns full path on __repr__, so it can simply be passed even to maya cmds functions. Along with, maybe, other basic functions.

But right now I’m not sure which would be the best approach - store MDagPath or UUID of the object?

I’m curious to know about other people’s experience on this matter, about whether UUIDs are used (built into Maya since 2016ish or custom) and if so - how, what pros and cons they have compared to using MDagPath for this matter.


I still use MDagPath, I have heard that it uis possible to end up with two identical UUIDs in the same scene through referencing the same maya file multiple times.


I’m almost 100% certain this is true. IIRC, multiple imports of an object or references (maybe even just duplicated objects?) have the same UUID. Which is insane, since it defeats the purpose of UUID, no? I recall opening a scene with dozens of little warnings/errors about duplicate UUIDs, which all came from some form of duplicate objects like this. This was in 2016 of some flavor.


Interesting. Thanks for replies. So I suppose I’ll avoid UUIDs, thanks.