Save/Load Collada 1.4 Root Asset Metadata

Add Collada 1.4 <asset/> metadata to export and import.
Can store in the Scene or the Root Node for export, will be loaded into the Scene during Import
This commit is contained in:
RichardTea
2019-04-09 16:28:15 +01:00
parent 49459435df
commit 1f55bdd9a7
4 changed files with 128 additions and 20 deletions

View File

@@ -208,9 +208,14 @@ void ColladaLoader::InternReadFile( const std::string& pFile, aiScene* pScene, I
}
// Store scene metadata
for (auto it = parser.mAssetMetaData.cbegin(); it != parser.mAssetMetaData.cend(); ++it)
{
pScene->mMetaData->Add((*it).first, (*it).second);
if (!parser.mAssetMetaData.empty()) {
const size_t numMeta(parser.mAssetMetaData.size());
pScene->mMetaData = aiMetadata::Alloc(static_cast<unsigned int>(numMeta));
size_t i = 0;
for (auto it = parser.mAssetMetaData.cbegin(); it != parser.mAssetMetaData.cend(); ++it, ++i)
{
pScene->mMetaData->Set(static_cast<unsigned int>(i), (*it).first, (*it).second);
}
}
// store all meshes