mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 16:14:38 +00:00
Prevents engine crash when loading shapes using the KHR_draco_mesh_compression extension.
This commit is contained in:
parent
ae8c964b95
commit
d0ca41e103
2 changed files with 15 additions and 1 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
/*
|
/*
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
@ -1047,6 +1047,9 @@ namespace glTF2
|
||||||
{
|
{
|
||||||
bool KHR_materials_pbrSpecularGlossiness;
|
bool KHR_materials_pbrSpecularGlossiness;
|
||||||
bool KHR_materials_unlit;
|
bool KHR_materials_unlit;
|
||||||
|
//T3D_CHANGE_BEGIN
|
||||||
|
bool KHR_draco_mesh_compression;
|
||||||
|
//T3D_CHANGE_END
|
||||||
|
|
||||||
} extensionsUsed;
|
} extensionsUsed;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1360,6 +1360,14 @@ inline void Asset::Load(const std::string& pFile, bool isBinary)
|
||||||
// Load the metadata
|
// Load the metadata
|
||||||
asset.Read(doc);
|
asset.Read(doc);
|
||||||
ReadExtensionsUsed(doc);
|
ReadExtensionsUsed(doc);
|
||||||
|
|
||||||
|
//T3D_CHANGE_BEGIN
|
||||||
|
if (extensionsUsed.KHR_draco_mesh_compression)
|
||||||
|
{
|
||||||
|
ASSIMP_LOG_ERROR("GLTF: Draco mesh compression is not supported by Torque3D.");
|
||||||
|
throw DeadlyImportError("GLTF: Draco mesh compression is not supported by Torque3D.");
|
||||||
|
}
|
||||||
|
//T3D_CHANGE_END
|
||||||
|
|
||||||
// Prepare the dictionaries
|
// Prepare the dictionaries
|
||||||
for (size_t i = 0; i < mDicts.size(); ++i) {
|
for (size_t i = 0; i < mDicts.size(); ++i) {
|
||||||
|
|
@ -1425,6 +1433,9 @@ inline void Asset::ReadExtensionsUsed(Document& doc)
|
||||||
|
|
||||||
CHECK_EXT(KHR_materials_pbrSpecularGlossiness);
|
CHECK_EXT(KHR_materials_pbrSpecularGlossiness);
|
||||||
CHECK_EXT(KHR_materials_unlit);
|
CHECK_EXT(KHR_materials_unlit);
|
||||||
|
//T3D_CHANGE_BEGIN
|
||||||
|
CHECK_EXT(KHR_draco_mesh_compression);
|
||||||
|
//T3D_CHANGE_END
|
||||||
|
|
||||||
#undef CHECK_EXT
|
#undef CHECK_EXT
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue