From 63ef19d9ad1b5a6404fb2520209bb7c0f1e05005 Mon Sep 17 00:00:00 2001
From: Daniel Hritzkiv <daniel.hritzkiv@gmail.com>
Date: Fri, 1 Sep 2017 17:56:30 -0400
Subject: [PATCH] Export extensions

---
 code/glTF2Exporter.cpp | 18 ------------------
 code/glTF2Exporter.h   |  1 -
 code/glTF2Importer.cpp |  7 -------
 3 files changed, 26 deletions(-)

diff --git a/code/glTF2Exporter.cpp b/code/glTF2Exporter.cpp
index 7daedd4a3..9a2c1cd75 100644
--- a/code/glTF2Exporter.cpp
+++ b/code/glTF2Exporter.cpp
@@ -107,10 +107,6 @@ glTF2Exporter::glTF2Exporter(const char* filename, IOSystem* pIOSystem, const ai
 
     ExportMetadata();
 
-    if (mScene->mRootNode) {
-        ExportExtensions(mScene->mRootNode);
-    }
-
     ExportMaterials();
 
     if (mScene->mRootNode) {
@@ -789,20 +785,6 @@ void glTF2Exporter::ExportMetadata()
     asset.generator = buffer;
 }
 
-void glTF2Exporter::ExportExtensions(const aiNode* n)
-{
-    aiMetadata* mMetaData = n->mMetaData;
-
-    if (mMetaData != nullptr) {
-        bool pbrSpecularGlossiness;
-
-        if (mMetaData->Get("extensionsUsed.pbrSpecularGlossiness", pbrSpecularGlossiness)) {
-            mAsset->extensionsUsed.KHR_materials_pbrSpecularGlossiness = pbrSpecularGlossiness;
-        }
-    }
-
-}
-
 inline void ExtractAnimationData(Asset& mAsset, std::string& animId, Ref<Animation>& animRef, Ref<Buffer>& buffer, const aiNodeAnim* nodeChannel, float ticksPerSecond)
 {
     // Loop over the data and check to see if it exactly matches an existing buffer.
diff --git a/code/glTF2Exporter.h b/code/glTF2Exporter.h
index 827189f29..4b9fe0ce0 100644
--- a/code/glTF2Exporter.h
+++ b/code/glTF2Exporter.h
@@ -118,7 +118,6 @@ namespace Assimp
         void GetMatColor(const aiMaterial* mat, glTF2::vec4& prop, const char* propName, int type, int idx);
         void GetMatColor(const aiMaterial* mat, glTF2::vec3& prop, const char* propName, int type, int idx);
         void ExportMetadata();
-        void ExportExtensions(const aiNode* n);
         void ExportMaterials();
         void ExportMeshes();
         unsigned int ExportNodeHierarchy(const aiNode* n);
diff --git a/code/glTF2Importer.cpp b/code/glTF2Importer.cpp
index 90ae849bd..36fe8b70e 100644
--- a/code/glTF2Importer.cpp
+++ b/code/glTF2Importer.cpp
@@ -546,13 +546,6 @@ void glTF2Importer::ImportNodes(glTF2::Asset& r)
     //if (!mScene->mRootNode) {
     //  mScene->mRootNode = new aiNode("EMPTY");
     //}
-
-    //initialize mMetaData;
-    aiMetadata* mMetaData = new aiMetadata();
-
-    //store used glTF extensions on the root node, for a lack of a better place.
-    mMetaData->Add("extensionsUsed.pbrSpecularGlossiness", r.extensionsUsed.KHR_materials_pbrSpecularGlossiness);
-    mScene->mRootNode->mMetaData = mMetaData;
 }
 
 void glTF2Importer::ImportEmbeddedTextures(glTF2::Asset& r)