- ColladaExporter filters empty meshes which fooled certain loaders - specifically Assimp's Collada Loader :-)
- Bugfix: ColladaExporter now writes proper URLs when referencing materials in meshes git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1170 67173fc5-114c-0410-ac8e-9d2fd5bffc1fpull/5/head
parent
08fe2e7d20
commit
f41e106efc
|
@ -298,6 +298,9 @@ void ColladaExporter::WriteGeometry( size_t pIndex)
|
||||||
const aiMesh* mesh = mScene->mMeshes[pIndex];
|
const aiMesh* mesh = mScene->mMeshes[pIndex];
|
||||||
std::string idstr = GetMeshId( pIndex);
|
std::string idstr = GetMeshId( pIndex);
|
||||||
|
|
||||||
|
if( mesh->mNumFaces == 0 || mesh->mNumVertices == 0 )
|
||||||
|
return;
|
||||||
|
|
||||||
// opening tag
|
// opening tag
|
||||||
mOutput << startstr << "<geometry id=\"" << idstr << "\" name=\"" << idstr << "_name\" >" << endstr;
|
mOutput << startstr << "<geometry id=\"" << idstr << "\" name=\"" << idstr << "_name\" >" << endstr;
|
||||||
PushTag();
|
PushTag();
|
||||||
|
@ -503,14 +506,18 @@ void ColladaExporter::WriteNode( const aiNode* pNode)
|
||||||
// instance every geometry
|
// instance every geometry
|
||||||
for( size_t a = 0; a < pNode->mNumMeshes; ++a )
|
for( size_t a = 0; a < pNode->mNumMeshes; ++a )
|
||||||
{
|
{
|
||||||
// const aiMesh* mesh = mScene->mMeshes[pNode->mMeshes[a]];
|
const aiMesh* mesh = mScene->mMeshes[pNode->mMeshes[a]];
|
||||||
|
// do not instanciate mesh if empty. I wonder how this could happen
|
||||||
|
if( mesh->mNumFaces == 0 || mesh->mNumVertices == 0 )
|
||||||
|
continue;
|
||||||
|
|
||||||
mOutput << startstr << "<instance_geometry url=\"#" << GetMeshId( pNode->mMeshes[a]) << "\">" << endstr;
|
mOutput << startstr << "<instance_geometry url=\"#" << GetMeshId( pNode->mMeshes[a]) << "\">" << endstr;
|
||||||
PushTag();
|
PushTag();
|
||||||
mOutput << startstr << "<bind_material>" << endstr;
|
mOutput << startstr << "<bind_material>" << endstr;
|
||||||
PushTag();
|
PushTag();
|
||||||
mOutput << startstr << "<technique_common>" << endstr;
|
mOutput << startstr << "<technique_common>" << endstr;
|
||||||
PushTag();
|
PushTag();
|
||||||
mOutput << startstr << "<instance_material symbol=\"theresonlyone\" target=\"" << materials[mScene->mMeshes[pNode->mMeshes[a]]->mMaterialIndex].name << "\" />" << endstr;
|
mOutput << startstr << "<instance_material symbol=\"theresonlyone\" target=\"#" << materials[mesh->mMaterialIndex].name << "\" />" << endstr;
|
||||||
PopTag();
|
PopTag();
|
||||||
mOutput << startstr << "</technique_common>" << endstr;
|
mOutput << startstr << "</technique_common>" << endstr;
|
||||||
PopTag();
|
PopTag();
|
||||||
|
|
Loading…
Reference in New Issue