For those not keen on reading much, here is the quick version…
I am trying to save a text file which lists all files and meshes used within an asset prefab so I can clean up the data set… but here’s the kicker… not all mesh names are unique and I can’t find a way to uniquely identify the mesh used in the scene.
The full explanation…
I have a project that has gone on too long, with too many client changes, too many artists cross working, and too many applications used for modeling a particular asset, and things are getting very unruly.
At last count there are over 400 different mesh objects spread amongst more than 50 fbx files. There are meshes within some files that are not being used anymore and or are being replaced with alterations / fixes in other files, and I’d like to get back to one clean data set.
To do so I was going to write an editor script to catalog the meshes used within a scene hierarchy tracking the mesh name and the fbx file they came from into a text file. I would then via python reassembly the disparate pieces into one data set by importing the files into Maya and keeping only the parts I need.
The problem I have is that some of this data came from Maya initially, which allows the user to have duplicate names for objects in the same file (so long as they are in a different section of the hierarchy).
Using functions within AssetDatabase, PrefabUtility, etc… I can get the sharedMesh name, and the fbx file it comes from, but when there are two or more meshes with the same name within the FBX file, I can find no way to differentiate them…
I really don’t want to go down the road of writing an .OBJ exporter due to things like edge smoothing, UV maps, and the like, which would certainly complicate and potentially alter the data from its current state.
Any suggestions on how I can fully resolve which meshes I need?
PS (the object in the scene does not necessarily match the original fbx prefab’s hierarchy since this is a prefab created from many different files - so marching through the hierarchy as it is in the scene will not work)