bugfix: add obj-material handling for <color> 0 instead of <color> r g b.

Signed-off-by: Kim Kulling <kim.kulling@googlemail.com>
pull/334/head
Kim Kulling 2014-08-16 11:39:28 +02:00
parent 3d6b1932f9
commit 5e265610fb
1 changed files with 8 additions and 6 deletions

View File

@ -223,15 +223,17 @@ void ObjFileMtlImporter::getColorRGBA( aiColor3D *pColor )
{
ai_assert( NULL != pColor );
float r, g, b;
float r( 0.0f ), g( 0.0f ), b( 0.0f );
m_DataIt = getFloat<DataArrayIt>( m_DataIt, m_DataItEnd, r );
pColor->r = r;
m_DataIt = getFloat<DataArrayIt>( m_DataIt, m_DataItEnd, g );
pColor->g = g;
m_DataIt = getFloat<DataArrayIt>( m_DataIt, m_DataItEnd, b );
pColor->b = b;
// we have to check if color is default 0 with only one token
if( !isNewLine( *m_DataIt ) ) {
m_DataIt = getFloat<DataArrayIt>( m_DataIt, m_DataItEnd, g );
m_DataIt = getFloat<DataArrayIt>( m_DataIt, m_DataItEnd, b );
}
pColor->g = g;
pColor->b = b;
}
// -------------------------------------------------------------------