private static void ExportModelCollider(Mesh mesh, string filename, string foldername) { ExportMaterial[] exportMaterials = new ExportMaterial[1]; exportMaterials[0] = new ExportMaterial(); exportMaterials[0].name = "Standard"; exportMaterials[0].filepath = ""; exportMaterials[0].generated = true; FBXExporter.Export(foldername, filename, mesh, exportMaterials, false); }
private static void ExportModelPart(IVisualPart part, string filename, string foldername) { Mesh volMesh = part.mesh; Material[] volumeMaterials = part.materials; int matCount = volumeMaterials.Length; ExportMaterial[] exportMaterials = new ExportMaterial[matCount]; for (int m = 0; m < matCount; m++) { exportMaterials[m] = new ExportMaterial(); exportMaterials[m].name = volumeMaterials[m].name; exportMaterials[m].filepath = AssetDatabase.GetAssetPath(volumeMaterials[m]); exportMaterials[m].material = volumeMaterials[m]; exportMaterials[m].generated = false; } // string filenameSuffix = vol.name;//todo check uniqueness // string filename = string.Format("{0}_{1}", building.exportFilename, filenameSuffix); FBXExporter.Export(foldername, filename, volMesh, exportMaterials, false); }