소스 검색

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
ulfjorensen 14 년 전
부모
커밋
2de55ee880
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      code/XFileParser.cpp

+ 4 - 1
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();