+ // load all meshes
+ for(unsigned int i=0; i<aiscn->mNumMeshes; i++) {
+ aiMesh *aimesh = aiscn->mMeshes[i];
+ Mesh *mesh;
+
+ switch(aimesh->mPrimitiveTypes) {
+ case aiPrimitiveType_TRIANGLE:
+ if((mesh = load_mesh(this, aiscn, flags, aimesh))) {
+ ldata->mesh_by_aimesh[aimesh] = mesh;
+ meshes.push_back(mesh);
+ }
+ break;
+
+ default:
+ error_log("unsupported primitive type: %u\n", aimesh->mPrimitiveTypes);
+ break;
+ }
+ }
+
+ // load all the nodes recursively
+ for(unsigned int i=0; i<aiscn->mRootNode->mNumChildren; i++) {
+ SceneNode *node = load_node(this, aiscn, flags, aiscn->mRootNode->mChildren[i]);
+ if(node) {
+ nodes->add_child(node);
+ }
+ }
+
+ info_log("loaded scene file: %s, %d meshes\n", fname, (int)meshes.size());