ColladaParser: add warning when empty semantic will be parsed.
parent
f6ee819a42
commit
0a1dda22b2
|
@ -3117,24 +3117,29 @@ aiMatrix4x4 ColladaParser::CalculateResultTransform( const std::vector<Transform
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Determines the input data type for the given semantic string
|
// 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;
|
return IT_Position;
|
||||||
else if( pSemantic == "TEXCOORD")
|
else if( semantic == "TEXCOORD")
|
||||||
return IT_Texcoord;
|
return IT_Texcoord;
|
||||||
else if( pSemantic == "NORMAL")
|
else if( semantic == "NORMAL")
|
||||||
return IT_Normal;
|
return IT_Normal;
|
||||||
else if( pSemantic == "COLOR")
|
else if( semantic == "COLOR")
|
||||||
return IT_Color;
|
return IT_Color;
|
||||||
else if( pSemantic == "VERTEX")
|
else if( semantic == "VERTEX")
|
||||||
return IT_Vertex;
|
return IT_Vertex;
|
||||||
else if( pSemantic == "BINORMAL" || pSemantic == "TEXBINORMAL")
|
else if( semantic == "BINORMAL" || semantic == "TEXBINORMAL")
|
||||||
return IT_Bitangent;
|
return IT_Bitangent;
|
||||||
else if( pSemantic == "TANGENT" || pSemantic == "TEXTANGENT")
|
else if( semantic == "TANGENT" || semantic == "TEXTANGENT")
|
||||||
return IT_Tangent;
|
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;
|
return IT_Invalid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue