public static void ExportToFile(ObjectSet objectSet, string outputFilePath) { AssimpSceneHelper.Export(ExportToAiScene(objectSet), outputFilePath, Ai.PostProcessSteps.FlipUVs); if (objectSet.TextureSet == null) { return; } string outputDirectoryPath = Path.GetDirectoryName(outputFilePath); foreach (var texture in objectSet.TextureSet.Textures) { string extension = TextureFormatUtilities.IsBlockCompressed(texture.Format) && !texture.IsYCbCr ? ".dds" : ".png"; TextureDecoder.DecodeToFile(texture, Path.Combine(outputDirectoryPath, texture.Name + extension)); } }
public static ObjectSet ImportFromFileWithSingleObject(string filePath) { string texturesDirectory = Path.GetDirectoryName(filePath); return(ImportFromAiSceneWithSingleObject(AssimpSceneHelper.Import(filePath), texturesDirectory)); }