Is there any way to add generated assets (LODs etc) to imported models (fbx)?
I would like to be able to generate LOD geometry for any imported models automatically, and for cleanliness, have these stored as part of the original model/prefab, rather than in other prefabs or assets alongside the original imported model.
I have no problem modifying the generated prefab during OnPostprocessModel and setting up LODGroups etc, but I can’t seem to find any way to save these assets to the imported mesh, as I would with any other asset/subasset situation.
Using AssetDatabase.AddObjectToAsset to add the mesh assets logs the error:
“Failed to load ‘D:/XYZ/Assets/Player_Body_Default_Male.fbx’. File may be corrupted or was serialized with a newer version of Unity.”
while using AssetPostprocessor.context.AddObjectToAsset seems to do nothing at all.
Is there something silly I might be overlooking here, or is this something that can’t really be done?
To be clear, I don’t want to edit the fbx itself, just the data which unity creates on import.
This is really the last step in having a seamless automatic LOD pipeline in Unity.
There does not seem to be a way to fix this issue. I think its possible hypothetically, but there are issues currently with multiple users etc. I have logged a bug on Unity’s own autolod tool, which seems to suffer the same problem. Storing data on an “internal asset” (not stored in the assets folder, but in the library) seems hazardous. I would really love this resolved