From 59b48fb9607e3119fc918b1f9e7cb23f5ed0a1e7 Mon Sep 17 00:00:00 2001 From: aoowweenn Date: Fri, 24 Mar 2017 14:39:34 +0800 Subject: [PATCH] finish skin controller --- code/ColladaExporter.cpp | 21 +++++---------------- code/ColladaExporter.h | 2 +- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/code/ColladaExporter.cpp b/code/ColladaExporter.cpp index 330981f00..937604815 100644 --- a/code/ColladaExporter.cpp +++ b/code/ColladaExporter.cpp @@ -1224,13 +1224,9 @@ void ColladaExporter::WriteSceneLibrary() mOutput << startstr << "" << endstr; PushTag(); - // start write armature at the root node - for( size_t a = 0; a < mScene->mRootNode->mNumChildren; ++a ) - WriteNode( mScene, mScene->mRootNode->mChildren[a], true); - // start recursive write at the root node for( size_t a = 0; a < mScene->mRootNode->mNumChildren; ++a ) - WriteNode( mScene, mScene->mRootNode->mChildren[a], false); + WriteNode( mScene, mScene->mRootNode->mChildren[a]); PopTag(); mOutput << startstr << "" << endstr; @@ -1255,7 +1251,7 @@ aiBone* findBone( const aiScene* scene, const char * name) { // ------------------------------------------------------------------------------------------------ // Recursively writes the given node -void ColladaExporter::WriteNode( const aiScene* pScene, aiNode* pNode, bool need_output_joint) +void ColladaExporter::WriteNode( const aiScene* pScene, aiNode* pNode) { // the node must have a name if (pNode->mName.length == 0) @@ -1279,19 +1275,12 @@ void ColladaExporter::WriteNode( const aiScene* pScene, aiNode* pNode, bool need is_skeleton_root = true; } - if(need_output_joint ^ is_joint) - return; - const std::string node_name_escaped = XMLEscape(pNode->mName.data); mOutput << startstr << "" << endstr; @@ -1376,7 +1365,7 @@ void ColladaExporter::WriteNode( const aiScene* pScene, aiNode* pNode, bool need // recurse into subnodes for( size_t a = 0; a < pNode->mNumChildren; ++a ) - WriteNode( pScene, pNode->mChildren[a], need_output_joint); + WriteNode( pScene, pNode->mChildren[a]); PopTag(); mOutput << startstr << "" << endstr; diff --git a/code/ColladaExporter.h b/code/ColladaExporter.h index b3c08f8c4..695b00bfd 100644 --- a/code/ColladaExporter.h +++ b/code/ColladaExporter.h @@ -122,7 +122,7 @@ protected: void WriteSceneLibrary(); /// Recursively writes the given node - void WriteNode( const aiScene* scene, aiNode* pNode, bool need_output_joint); + void WriteNode( const aiScene* scene, aiNode* pNode); /// Enters a new xml element, which increases the indentation void PushTag() { startstr.append( " "); }