first pass at collada metadata
parent
2a3626577f
commit
d66166675a
|
@ -207,6 +207,12 @@ void ColladaLoader::InternReadFile( const std::string& pFile, aiScene* pScene, I
|
|||
0, 0, 0, 1);
|
||||
}
|
||||
|
||||
// Store scene metadata
|
||||
for (auto it = parser.mAssetMetaData.cbegin(); it != parser.mAssetMetaData.cend(); ++it)
|
||||
{
|
||||
pScene->mMetaData->Add((*it).first, (*it).second);
|
||||
}
|
||||
|
||||
// store all meshes
|
||||
StoreSceneMeshes( pScene);
|
||||
|
||||
|
|
|
@ -264,9 +264,22 @@ void ColladaParser::ReadAssetInfo()
|
|||
|
||||
// check element end
|
||||
TestClosing( "up_axis");
|
||||
} else
|
||||
}
|
||||
else if(IsElement("contributor"))
|
||||
{
|
||||
SkipElement();
|
||||
// This has no data of its own, will get children next time through
|
||||
}
|
||||
else
|
||||
{
|
||||
const char* metadata_key = mReader->getNodeName();
|
||||
const char* metadata_value = TestTextContent();
|
||||
if (metadata_key != nullptr && metadata_value != nullptr)
|
||||
{
|
||||
aiString aistr;
|
||||
aistr.Set(metadata_value);
|
||||
mAssetMetaData.emplace(metadata_key, aistr);
|
||||
}
|
||||
//SkipElement();
|
||||
}
|
||||
}
|
||||
else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
|
||||
|
|
|
@ -343,6 +343,9 @@ namespace Assimp
|
|||
/** Which is the up vector */
|
||||
enum { UP_X, UP_Y, UP_Z } mUpDirection;
|
||||
|
||||
typedef std::map<std::string, aiString> AssetMetaData;
|
||||
AssetMetaData mAssetMetaData;
|
||||
|
||||
/** Collada file format version */
|
||||
Collada::FormatVersion mFormat;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue