Merge branch 'master' of https://github.com/assimp/assimp
commit
85db7d234e
|
@ -322,6 +322,8 @@ struct Mesh
|
||||||
mNumUVComponents[i] = 2;
|
mNumUVComponents[i] = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string mName;
|
||||||
|
|
||||||
// just to check if there's some sophisticated addressing involved...
|
// just to check if there's some sophisticated addressing involved...
|
||||||
// which we don't support, and therefore should warn about.
|
// which we don't support, and therefore should warn about.
|
||||||
std::string mVertexID;
|
std::string mVertexID;
|
||||||
|
|
|
@ -521,10 +521,13 @@ void ColladaLoader::BuildMeshesForNode( const ColladaParser& pParser, const Coll
|
||||||
|
|
||||||
// assign the material index
|
// assign the material index
|
||||||
dstMesh->mMaterialIndex = matIdx;
|
dstMesh->mMaterialIndex = matIdx;
|
||||||
|
if(dstMesh->mName.length == 0)
|
||||||
|
{
|
||||||
dstMesh->mName = mid.mMeshOrController;
|
dstMesh->mName = mid.mMeshOrController;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// now place all mesh references we gathered in the target node
|
// now place all mesh references we gathered in the target node
|
||||||
pTarget->mNumMeshes = newMeshRefs.size();
|
pTarget->mNumMeshes = newMeshRefs.size();
|
||||||
|
@ -542,6 +545,8 @@ aiMesh* ColladaLoader::CreateMesh( const ColladaParser& pParser, const Collada::
|
||||||
{
|
{
|
||||||
aiMesh* dstMesh = new aiMesh;
|
aiMesh* dstMesh = new aiMesh;
|
||||||
|
|
||||||
|
dstMesh->mName = pSrcMesh->mName;
|
||||||
|
|
||||||
// count the vertices addressed by its faces
|
// count the vertices addressed by its faces
|
||||||
const size_t numVertices = std::accumulate( pSrcMesh->mFaceSize.begin() + pStartFace,
|
const size_t numVertices = std::accumulate( pSrcMesh->mFaceSize.begin() + pStartFace,
|
||||||
pSrcMesh->mFaceSize.begin() + pStartFace + pSubMesh.mNumFaces, 0);
|
pSrcMesh->mFaceSize.begin() + pStartFace + pSubMesh.mNumFaces, 0);
|
||||||
|
|
|
@ -1493,6 +1493,13 @@ void ColladaParser::ReadGeometryLibrary()
|
||||||
Mesh* mesh = new Mesh;
|
Mesh* mesh = new Mesh;
|
||||||
mMeshLibrary[id] = mesh;
|
mMeshLibrary[id] = mesh;
|
||||||
|
|
||||||
|
// read the mesh name if it exists
|
||||||
|
const int nameIndex = TestAttribute("name");
|
||||||
|
if(nameIndex != -1)
|
||||||
|
{
|
||||||
|
mesh->mName = mReader->getAttributeValue(nameIndex);
|
||||||
|
}
|
||||||
|
|
||||||
// read on from there
|
// read on from there
|
||||||
ReadGeometry( mesh);
|
ReadGeometry( mesh);
|
||||||
} else
|
} else
|
||||||
|
|
Loading…
Reference in New Issue