finish skin controller
parent
968612fea1
commit
59b48fb960
|
@ -1224,13 +1224,9 @@ void ColladaExporter::WriteSceneLibrary()
|
||||||
mOutput << startstr << "<visual_scene id=\"" + scene_name_escaped + "\" name=\"" + scene_name_escaped + "\">" << endstr;
|
mOutput << startstr << "<visual_scene id=\"" + scene_name_escaped + "\" name=\"" + scene_name_escaped + "\">" << endstr;
|
||||||
PushTag();
|
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
|
// start recursive write at the root node
|
||||||
for( size_t a = 0; a < mScene->mRootNode->mNumChildren; ++a )
|
for( size_t a = 0; a < mScene->mRootNode->mNumChildren; ++a )
|
||||||
WriteNode( mScene, mScene->mRootNode->mChildren[a], false);
|
WriteNode( mScene, mScene->mRootNode->mChildren[a]);
|
||||||
|
|
||||||
PopTag();
|
PopTag();
|
||||||
mOutput << startstr << "</visual_scene>" << endstr;
|
mOutput << startstr << "</visual_scene>" << endstr;
|
||||||
|
@ -1255,7 +1251,7 @@ aiBone* findBone( const aiScene* scene, const char * name) {
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Recursively writes the given node
|
// 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
|
// the node must have a name
|
||||||
if (pNode->mName.length == 0)
|
if (pNode->mName.length == 0)
|
||||||
|
@ -1279,19 +1275,12 @@ void ColladaExporter::WriteNode( const aiScene* pScene, aiNode* pNode, bool need
|
||||||
is_skeleton_root = true;
|
is_skeleton_root = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(need_output_joint ^ is_joint)
|
|
||||||
return;
|
|
||||||
|
|
||||||
const std::string node_name_escaped = XMLEscape(pNode->mName.data);
|
const std::string node_name_escaped = XMLEscape(pNode->mName.data);
|
||||||
mOutput << startstr
|
mOutput << startstr
|
||||||
<< "<node ";
|
<< "<node ";
|
||||||
if(is_skeleton_root)
|
if(is_skeleton_root)
|
||||||
mOutput << "id=\"" << "skeleton_root"; // For now, only support one skeleton in a scene.
|
mOutput << "id=\"" << "skeleton_root" << "\" "; // For now, only support one skeleton in a scene.
|
||||||
else
|
mOutput << (is_joint ? "s" : "") << "id=\"" << node_name_escaped;
|
||||||
mOutput << "id=\"" << node_name_escaped;
|
|
||||||
if(is_joint)
|
|
||||||
mOutput << "\" sid=\"" << node_name_escaped;
|
|
||||||
//mOutput << (is_joint ? "s" : "") << "id=\"" << node_name_escaped
|
|
||||||
mOutput << "\" name=\"" << node_name_escaped
|
mOutput << "\" name=\"" << node_name_escaped
|
||||||
<< "\" type=\"" << node_type
|
<< "\" type=\"" << node_type
|
||||||
<< "\">" << endstr;
|
<< "\">" << endstr;
|
||||||
|
@ -1376,7 +1365,7 @@ void ColladaExporter::WriteNode( const aiScene* pScene, aiNode* pNode, bool need
|
||||||
|
|
||||||
// recurse into subnodes
|
// recurse into subnodes
|
||||||
for( size_t a = 0; a < pNode->mNumChildren; ++a )
|
for( size_t a = 0; a < pNode->mNumChildren; ++a )
|
||||||
WriteNode( pScene, pNode->mChildren[a], need_output_joint);
|
WriteNode( pScene, pNode->mChildren[a]);
|
||||||
|
|
||||||
PopTag();
|
PopTag();
|
||||||
mOutput << startstr << "</node>" << endstr;
|
mOutput << startstr << "</node>" << endstr;
|
||||||
|
|
|
@ -122,7 +122,7 @@ protected:
|
||||||
void WriteSceneLibrary();
|
void WriteSceneLibrary();
|
||||||
|
|
||||||
/// Recursively writes the given node
|
/// 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
|
/// Enters a new xml element, which increases the indentation
|
||||||
void PushTag() { startstr.append( " "); }
|
void PushTag() { startstr.append( " "); }
|
||||||
|
|
Loading…
Reference in New Issue