- applied patch by peteredc to make the Collada loader write mesh names

- applied patch by asmaloney for better error messages in the Collada parser

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1301 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
pull/6/merge
ulfjorensen 2012-09-21 08:44:37 +00:00
parent e22bb03f80
commit 62b0284100
2 changed files with 9 additions and 9 deletions

View File

@ -504,7 +504,8 @@ void ColladaLoader::BuildMeshesForNode( const ColladaParser& pParser, const Coll
// assign the material index // assign the material index
dstMesh->mMaterialIndex = matIdx; dstMesh->mMaterialIndex = matIdx;
} dstMesh->mName = mid.mMeshOrController;
}
} }
} }

View File

@ -1795,14 +1795,13 @@ void ColladaParser::ReadAccessor( const std::string& pID)
SkipElement(); SkipElement();
} else } else
{ {
ThrowException( "Unexpected sub element in tag \"accessor\"."); ThrowException( boost::str( boost::format( "Unexpected sub element <%s> in tag <accessor>") % mReader->getNodeName()));
} }
} }
else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
{ {
if( strcmp( mReader->getNodeName(), "accessor") != 0) if( strcmp( mReader->getNodeName(), "accessor") != 0)
ThrowException( "Expected end of \"accessor\" element."); ThrowException( "Expected end of <accessor> element.");
break; break;
} }
} }
@ -1826,13 +1825,13 @@ void ColladaParser::ReadVertexData( Mesh* pMesh)
ReadInputChannel( pMesh->mPerVertexData); ReadInputChannel( pMesh->mPerVertexData);
} else } else
{ {
ThrowException( "Unexpected sub element in tag \"vertices\"."); ThrowException( boost::str( boost::format( "Unexpected sub element <%s> in tag <vertices>") % mReader->getNodeName()));
} }
} }
else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
{ {
if( strcmp( mReader->getNodeName(), "vertices") != 0) if( strcmp( mReader->getNodeName(), "vertices") != 0)
ThrowException( "Expected end of \"vertices\" element."); ThrowException( "Expected end of <vertices> element.");
break; break;
} }
@ -1919,13 +1918,13 @@ void ColladaParser::ReadIndexData( Mesh* pMesh)
} }
} else } else
{ {
ThrowException( "Unexpected sub element in tag \"vertices\"."); ThrowException( boost::str( boost::format( "Unexpected sub element <%s> in tag <%s>") % mReader->getNodeName() % elementName));
} }
} }
else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END) else if( mReader->getNodeType() == irr::io::EXN_ELEMENT_END)
{ {
if( mReader->getNodeName() != elementName) if( mReader->getNodeName() != elementName)
ThrowException( boost::str( boost::format( "Expected end of \"%s\" element.") % elementName)); ThrowException( boost::str( boost::format( "Expected end of <%s> element.") % elementName));
break; break;
} }
@ -2063,7 +2062,7 @@ void ColladaParser::ReadPrimitives( Mesh* pMesh, std::vector<InputChannel>& pPer
{ {
// warn if the vertex channel does not refer to the <vertices> element in the same mesh // warn if the vertex channel does not refer to the <vertices> element in the same mesh
if( input.mAccessor != pMesh->mVertexID) if( input.mAccessor != pMesh->mVertexID)
ThrowException( "Unsupported vertex referencing scheme. I fucking hate Collada."); ThrowException( "Unsupported vertex referencing scheme.");
continue; continue;
} }