mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 01:48:59 +02:00
NetworkGeometry: Fix crash for empty geometry/bad FBX versions
Interpret empty geometry as an error.
This commit is contained in:
parent
c3c7d3d776
commit
6e872edcae
1 changed files with 5 additions and 1 deletions
|
@ -72,11 +72,15 @@ void GeometryReader::run() {
|
|||
const bool grabLightmaps = true;
|
||||
const float lightmapLevel = 1.0f;
|
||||
fbxgeo = readFBX(_data, _mapping, _url.path(), grabLightmaps, lightmapLevel);
|
||||
if (fbxgeo->meshes.size() == 0 && fbxgeo->joints.size() == 0) {
|
||||
// empty fbx geometry, indicates error
|
||||
throw QString("empty geometry, possibly due to an unsupported FBX version");
|
||||
}
|
||||
} else if (_url.path().toLower().endsWith(".obj")) {
|
||||
fbxgeo = OBJReader().readOBJ(_data, _mapping, _url);
|
||||
} else {
|
||||
QString errorStr("unsupported format");
|
||||
emit onError(NetworkGeometry::ModelParseError, errorStr);
|
||||
throw errorStr;
|
||||
}
|
||||
emit onSuccess(fbxgeo);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue