33714 If the gltf2 asset has no scene, it is corrupt.

This commit is contained in:
K. S. Ernest (iFire) Lee 2019-11-20 10:49:24 -08:00
parent 73323a2838
commit 3b44866bf2

View file

@ -229,6 +229,7 @@ Error EditorSceneImporterGLTF::_parse_scenes(GLTFState &state) {
ERR_FAIL_COND_V(!state.json.has("scenes"), ERR_FILE_CORRUPT); ERR_FAIL_COND_V(!state.json.has("scenes"), ERR_FILE_CORRUPT);
const Array &scenes = state.json["scenes"]; const Array &scenes = state.json["scenes"];
ERR_FAIL_COND_V(!scenes.size(), ERR_FILE_CORRUPT);
for (int i = 0; i < 1; i++) { //only first scene is imported for (int i = 0; i < 1; i++) { //only first scene is imported
const Dictionary &s = scenes[i]; const Dictionary &s = scenes[i];
ERR_FAIL_COND_V(!s.has("nodes"), ERR_UNAVAILABLE); ERR_FAIL_COND_V(!s.has("nodes"), ERR_UNAVAILABLE);