diff --git a/code/glTF2/glTF2Importer.cpp b/code/glTF2/glTF2Importer.cpp index 8c33674e1..56645b737 100644 --- a/code/glTF2/glTF2Importer.cpp +++ b/code/glTF2/glTF2Importer.cpp @@ -953,8 +953,8 @@ aiNode *ImportNode(aiScene *pScene, glTF2::Asset &r, std::vector & void glTF2Importer::ImportNodes(glTF2::Asset &r) { if (!r.scene) { - return; - } + throw DeadlyImportError("GLTF: No scene"); + } std::vector> rootNodes = r.scene->nodes; @@ -971,6 +971,8 @@ void glTF2Importer::ImportNodes(glTF2::Asset &r) { root->mChildren[root->mNumChildren++] = node; } mScene->mRootNode = root; + } else { + mScene->mRootNode = new aiNode("ROOT"); } }