Add StepExporter.cpp(stp) Export
Fix XFile
This commit is contained in:
@@ -319,8 +319,8 @@ void XFileExporter::WriteNode( aiNode* pNode)
|
||||
WriteMesh(mScene->mMeshes[pNode->mMeshes[i]]);
|
||||
|
||||
// recursive call the Nodes
|
||||
for (size_t a = 0; a < pNode->mNumChildren; a++)
|
||||
WriteNode( mScene->mRootNode->mChildren[a]);
|
||||
for (size_t i = 0; i < pNode->mNumChildren; ++i)
|
||||
WriteNode( mScene->mRootNode->mChildren[i]);
|
||||
|
||||
PopTag();
|
||||
|
||||
@@ -507,12 +507,16 @@ void XFileExporter::WriteMesh(aiMesh* mesh)
|
||||
|
||||
std::string XFileExporter::toXFileString(aiString &name)
|
||||
{
|
||||
std::string str = std::string(name.C_Str());
|
||||
std::replace(str.begin(), str.end(), '<', '_');
|
||||
std::replace(str.begin(), str.end(), '>', '_');
|
||||
std::replace(str.begin(), str.end(), '{', '_');
|
||||
std::replace(str.begin(), str.end(), '}', '_');
|
||||
std::replace(str.begin(), str.end(), '$', '_');
|
||||
std::string pref = "NN_"; // node name prefix to prevent unexpected start of string
|
||||
std::string str = pref + std::string(name.C_Str());
|
||||
for (int i=0; i<str.length(); ++i)
|
||||
{
|
||||
if ((str[i] >= 48 && str[i] <= 57) || // 0-9
|
||||
(str[i] >= 65 && str[i] <= 90) || // A-Z
|
||||
(str[i] >= 97 && str[i] <= 122)) // a-z
|
||||
continue;
|
||||
str[i] = '_';
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user