From 2de55ee880aca5831e203c232c529a3f9ab7ce66 Mon Sep 17 00:00:00 2001 From: ulfjorensen Date: Wed, 8 Jun 2011 12:25:03 +0000 Subject: [PATCH] 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 --- code/XFileParser.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/XFileParser.cpp b/code/XFileParser.cpp index 2473b945a..8c340283f 100644 --- a/code/XFileParser.cpp +++ b/code/XFileParser.cpp @@ -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();