While it may not sound like a big issue at first, I recently realized that having duplicate names in Maya can be more problematic than I originally thought.
Maya handles these duplicate names by using a “long name” internally, but some other scripts (including some default scripts) will complain about it and constantly throw error messages. I also realized that after renaming my objects, my .ma files became lighter, sometimes up to 20% lighter!
The “Long Name” that Maya uses is the name of the object preceded by the object’s parent. If that is still duplicated, it’s adding the grandparent as well, and will continue to add parents names until it becomes a unique name. Using these long names in the .ma file takes more characters, hence the increased file size.
I find it worth it to fix duplicate names for that reason alone.
I searched for scripts online, and found 2 great posts online, but decided to combine their 2 solutions, with a bit of my own code mixed in to come up with a new script.
Here is my code, with comments to explain the process: