ColladaParser: add warning when empty semantic will be parsed.

pull/907/head
Kim Kulling 2016-06-04 17:53:51 +02:00
parent f6ee819a42
commit 0a1dda22b2
1 changed files with 14 additions and 9 deletions

View File

@ -3117,24 +3117,29 @@ aiMatrix4x4 ColladaParser::CalculateResultTransform( const std::vector<Transform
// ------------------------------------------------------------------------------------------------
// Determines the input data type for the given semantic string
Collada::InputType ColladaParser::GetTypeForSemantic( const std::string& pSemantic)
Collada::InputType ColladaParser::GetTypeForSemantic( const std::string& semantic)
{
if( pSemantic == "POSITION")
if ( semantic.empty() ) {
DefaultLogger::get()->warn( format() << "Vertex input type is empty." );
return IT_Invalid;
}
if( semantic == "POSITION")
return IT_Position;
else if( pSemantic == "TEXCOORD")
else if( semantic == "TEXCOORD")
return IT_Texcoord;
else if( pSemantic == "NORMAL")
else if( semantic == "NORMAL")
return IT_Normal;
else if( pSemantic == "COLOR")
else if( semantic == "COLOR")
return IT_Color;
else if( pSemantic == "VERTEX")
else if( semantic == "VERTEX")
return IT_Vertex;
else if( pSemantic == "BINORMAL" || pSemantic == "TEXBINORMAL")
else if( semantic == "BINORMAL" || semantic == "TEXBINORMAL")
return IT_Bitangent;
else if( pSemantic == "TANGENT" || pSemantic == "TEXTANGENT")
else if( semantic == "TANGENT" || semantic == "TEXTANGENT")
return IT_Tangent;
DefaultLogger::get()->warn( format() << "Unknown vertex input type \"" << pSemantic << "\". Ignoring." );
DefaultLogger::get()->warn( format() << "Unknown vertex input type \"" << semantic << "\". Ignoring." );
return IT_Invalid;
}