copyMeshes( pScene );
copyCameras( pScene );
copyLights( pScene );
+ copyMaterials( pScene );
resolveReferences();
createNodeTree( pScene );
}
}
//------------------------------------------------------------------------------------------------
+void OpenGEXImporter::copyMaterials( aiScene *pScene ) {
+ ai_assert( nullptr != pScene );
+
+ if ( m_materialCache.empty() ) {
+ return;
+ }
+
+ pScene->mNumMaterials = static_cast<unsigned int>(m_materialCache.size());
+ pScene->mMaterials = new aiMaterial*[ pScene->mNumMaterials ];
+ std::copy( m_materialCache.begin(), m_materialCache.end(), pScene->mMaterials );
+}
+
+//------------------------------------------------------------------------------------------------
void OpenGEXImporter::resolveReferences() {
if( m_unresolvedRefStack.empty() ) {
return;
void copyMeshes( aiScene *pScene );
void copyCameras( aiScene *pScene );
void copyLights( aiScene *pScene );
+ void copyMaterials( aiScene *pScene );
void resolveReferences();
void pushNode( aiNode *node, aiScene *pScene );
aiNode *popNode();