Bugfix: apply transformation as well when filtering out empty proxy nodes in XFile imports. Thanks to Magnus Norddahl for the patch

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1028 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
pull/1/head
ulfjorensen 2011-06-08 12:25:03 +00:00
parent 323b9d8400
commit 2de55ee880
1 changed files with 4 additions and 1 deletions

View File

@ -1441,7 +1441,7 @@ void XFileParser::FilterHierarchy( XFile::Node* pNode)
// if the node has just a single unnamed child containing a mesh, remove
// the anonymous node inbetween. The 3DSMax kwXport plugin seems to produce this
// mess in some cases
if( pNode->mChildren.size() == 1)
if( pNode->mChildren.size() == 1 && pNode->mMeshes.empty() )
{
XFile::Node* child = pNode->mChildren.front();
if( child->mName.length() == 0 && child->mMeshes.size() > 0)
@ -1451,6 +1451,9 @@ void XFileParser::FilterHierarchy( XFile::Node* pNode)
pNode->mMeshes.push_back( child->mMeshes[a]);
child->mMeshes.clear();
// transfer the transform as well
pNode->mTrafoMatrix = pNode->mTrafoMatrix * child->mTrafoMatrix;
// then kill it
delete child;
pNode->mChildren.clear();