ColladaLoader now assigns individual materials to submeshes as needed
Optional assignment of individual materials to submeshes, addresses #3606pull/3607/head
parent
28c9bccbef
commit
338abded12
|
@ -557,7 +557,12 @@ void ColladaLoader::BuildMeshesForNode(const ColladaParser &pParser, const Colla
|
||||||
faceStart += submesh.mNumFaces;
|
faceStart += submesh.mNumFaces;
|
||||||
|
|
||||||
// assign the material index
|
// assign the material index
|
||||||
dstMesh->mMaterialIndex = matIdx;
|
std::map<std::string, size_t>::const_iterator matIt = mMaterialIndexByName.find(submesh.mMaterial);
|
||||||
|
if (matIt != mMaterialIndexByName.end()) {
|
||||||
|
dstMesh->mMaterialIndex = matIt->second;
|
||||||
|
} else {
|
||||||
|
dstMesh->mMaterialIndex = matIdx;
|
||||||
|
}
|
||||||
if (dstMesh->mName.length == 0) {
|
if (dstMesh->mName.length == 0) {
|
||||||
dstMesh->mName = mid.mMeshOrController;
|
dstMesh->mName = mid.mMeshOrController;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue