Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Srwiseman 6272 fix #6305

Merged
merged 12 commits into from
Mar 8, 2018
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Change Log

##### Fixes :wrench:
* Fixed support of glTF-supplied tangent vectors. [#6302](https://github.com/AnalyticalGraphicsInc/cesium/pull/6302)
* Fixed improper zoom during model load failure. [#6305](https://github.com/AnalyticalGraphicsInc/cesium/pull/6305)

### 1.43 - 2018-03-01

Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
* [Nacho Carnicero](https://github.com/nacho-carnicero)
* [Y.Selim Abidin](https://github.com/SelimAbidin)
* [Tamar Cohen](https://github.com/tamarmot)
* [Stephen Wiseman](https://github.com/srwiseman)
17 changes: 10 additions & 7 deletions Source/DataSources/ModelVisualizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,6 @@ define([
incrementallyLoadTextures : Property.getValueOrDefault(modelGraphics._incrementallyLoadTextures, time, defaultIncrementallyLoadTextures),
scene : this._scene
});

model.readyPromise.otherwise(onModelError);

model.id = entity;
primitives.add(model);

Expand All @@ -137,9 +134,12 @@ define([
url : resource.url,
animationsRunning : false,
nodeTransformationsScratch : {},
originalNodeMatrixHash : {}
originalNodeMatrixHash : {},
loadFail : false
};
modelHash[entity.id] = modelData;

checkModelLoad(model, entity, modelHash);
}

model.show = true;
Expand Down Expand Up @@ -250,7 +250,7 @@ define([
//>>includeEnd('debug');

var modelData = this._modelHash[entity.id];
if (!defined(modelData)) {
if (!defined(modelData) || modelData.loadFail) {
return BoundingSphereState.FAILED;
}

Expand Down Expand Up @@ -324,8 +324,11 @@ define([
}
}

function onModelError(error) {
console.error(error);
function checkModelLoad(model, entity, modelHash){
model.readyPromise.otherwise(function(error){
console.error(error);
modelHash[entity.id].loadFail = true;
});
}

return ModelVisualizer;
Expand Down