Merge branch 'master' into fixTexcoord
This commit is contained in:
@@ -55,6 +55,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <assimp/scene.h>
|
||||
#include <assimp/DefaultLogger.hpp>
|
||||
#include <assimp/Importer.hpp>
|
||||
#include <assimp/commonMetaData.h>
|
||||
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
@@ -1302,6 +1303,24 @@ void glTF2Importer::ImportEmbeddedTextures(glTF2::Asset &r) {
|
||||
}
|
||||
}
|
||||
|
||||
void glTF2Importer::ImportCommonMetadata(glTF2::Asset& a) {
|
||||
ai_assert(mScene->mMetaData == nullptr);
|
||||
const bool hasVersion = !a.asset.version.empty();
|
||||
const bool hasGenerator = !a.asset.generator.empty();
|
||||
if (hasVersion || hasGenerator)
|
||||
{
|
||||
mScene->mMetaData = new aiMetadata;
|
||||
if (hasVersion)
|
||||
{
|
||||
mScene->mMetaData->Add(AI_METADATA_SOURCE_FORMAT_VERSION, aiString(a.asset.version));
|
||||
}
|
||||
if (hasGenerator)
|
||||
{
|
||||
mScene->mMetaData->Add(AI_METADATA_SOURCE_GENERATOR, aiString(a.asset.generator));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void glTF2Importer::InternReadFile(const std::string &pFile, aiScene *pScene, IOSystem *pIOHandler) {
|
||||
// clean all member arrays
|
||||
meshOffsets.clear();
|
||||
@@ -1329,6 +1348,8 @@ void glTF2Importer::InternReadFile(const std::string &pFile, aiScene *pScene, IO
|
||||
|
||||
ImportAnimations(asset);
|
||||
|
||||
ImportCommonMetadata(asset);
|
||||
|
||||
if (pScene->mNumMeshes == 0) {
|
||||
pScene->mFlags |= AI_SCENE_FLAGS_INCOMPLETE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user