Add parsing of texture nodes of OpenGEX-format importer.

pull/575/head
Kim Kulling 2015-05-29 20:45:31 +02:00
parent 696407f6c5
commit 5e1fc39448
1 changed files with 17 additions and 0 deletions

View File

@ -83,6 +83,7 @@ namespace Grammar {
static const std::string DiffuseColorToken = "diffuse";
static const std::string SpecularColorToken = "specular";
static const std::string EmissionColorToken = "emission";
static const std::string DiffuseTextureToken = "diffuse";
static const char *TextureType = "Texture";
@ -808,7 +809,23 @@ void OpenGEXImporter::handleColorNode( ODDLParser::DDLNode *node, aiScene *pScen
//------------------------------------------------------------------------------------------------
void OpenGEXImporter::handleTextureNode( ODDLParser::DDLNode *node, aiScene *pScene ) {
if( NULL == node ) {
return;
}
Property *prop = node->findPropertyByName( "attrib" );
if( NULL != prop ) {
if( NULL != prop->m_value ) {
if( prop->m_value->getString() == Grammar::DiffuseTextureToken ) {
aiString tex;
Value *val( node->getValue() );
if( NULL != val ) {
tex.Set( val->getString() );
m_currentMaterial->AddProperty( &tex, AI_MATKEY_TEXTURE_DIFFUSE( 0 ) );
}
}
}
}
}
//------------------------------------------------------------------------------------------------