I try to combine the sub mesh of a fbx model to root when importing it. I've combined sub mesh successfuly at runtime before. But when I do the same via editor script ( in OnPostprocessModel() in a subclass inherits from AssetPostprocessor), the result mesh is null. The part of code like this:
The log shows that the subMeshCount and vertexCount of result sharedMesh are not zero. But when I dorp the asset to sence it shows nothing, and the inspector shows it's mesh is missing while all materials exist. I guess it's due to I can't save the result to the import asset because it's a fbx file, or is there something I've missing ? I'll be very greatful on your help.
asked Apr 04 '11 at 07:25 AM
You created an instance of Mesh in memory, but the Mesh is not saved as asset. I've never done this with a mesh, but i guess you have to use AssetDatabase.AddObjectToAsset. The example there adds an AnimationClip to a material. The clip shows up as child of the material ( kinda crazy ;) ).
answered Apr 04 '11 at 11:21 AM