From 308c361d8993c49bd98be492ac3a006c407f7b7a Mon Sep 17 00:00:00 2001 From: Vladyslav Baranovskyi Date: Thu, 19 Dec 2024 17:04:50 +0200 Subject: [PATCH] Guarded assimp-related code --- openVulkanoCpp/Scene/MeshWriter.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/openVulkanoCpp/Scene/MeshWriter.cpp b/openVulkanoCpp/Scene/MeshWriter.cpp index 556743c..35be663 100644 --- a/openVulkanoCpp/Scene/MeshWriter.cpp +++ b/openVulkanoCpp/Scene/MeshWriter.cpp @@ -16,10 +16,13 @@ #include #include + +#if __has_include("assimp/Exporter.hpp") #include #include #include #include +#endif namespace OpenVulkano::Scene { @@ -89,6 +92,7 @@ namespace OpenVulkano::Scene void MeshWriter::WriteAsFBX(Geometry* geometry, const std::string& texturePath, const std::string& fbxPath) { +#if __has_include("assimp/Exporter.hpp") aiNode rootNode; aiScene scene; @@ -177,5 +181,8 @@ namespace OpenVulkano::Scene { throw std::runtime_error("Unable to write a fbx file to " + fbxPath + ": " + exporter.GetErrorString()); } +#else + throw std::runtime_error("Unable to convert the scene to FBX: Assimp is not available!"); +#endif } } \ No newline at end of file