Add various improvements to models importing code

This commit is contained in:
Wojtek Figat
2023-11-30 11:31:58 +01:00
parent 712c400e43
commit c5df7ad689
7 changed files with 11 additions and 20 deletions

View File

@@ -1117,11 +1117,15 @@ bool ModelTool::ImportDataOpenFBX(const char* path, ImportedModelData& data, Opt
}
ofbx::u64 loadFlags = 0;
if (EnumHasAnyFlags(data.Types, ImportDataTypes::Geometry))
{
loadFlags |= (ofbx::u64)ofbx::LoadFlags::TRIANGULATE;
if (!options.ImportBlendShapes)
loadFlags |= (ofbx::u64)ofbx::LoadFlags::IGNORE_BLEND_SHAPES;
}
else
loadFlags |= (ofbx::u64)ofbx::LoadFlags::IGNORE_GEOMETRY;
if (!options.ImportBlendShapes)
loadFlags |= (ofbx::u64)ofbx::LoadFlags::IGNORE_BLEND_SHAPES;
{
loadFlags |= (ofbx::u64)ofbx::LoadFlags::IGNORE_GEOMETRY | (ofbx::u64)ofbx::LoadFlags::IGNORE_BLEND_SHAPES;
}
ofbx::IScene* scene = ofbx::load(fileData.Get(), fileData.Count(), loadFlags);
if (!scene)
{