From 87a7662bee8378ce9afc84bdec242cd3ae9ba212 Mon Sep 17 00:00:00 2001 From: Malcolm Tyrrell Date: Mon, 18 May 2020 11:45:00 +0100 Subject: [PATCH] More thinks using VERBOSE_DEBUG --- code/AssetLib/3MF/D3MFOpcPackage.cpp | 2 +- code/AssetLib/Ogre/OgreBinarySerializer.cpp | 18 +++++------ code/AssetLib/Ogre/OgreMaterial.cpp | 18 +++++------ code/AssetLib/Ogre/OgreXmlSerializer.cpp | 34 ++++++++++----------- code/AssetLib/Ply/PlyParser.cpp | 28 ++++++++--------- code/PostProcessing/TriangulateProcess.cpp | 2 +- 6 files changed, 51 insertions(+), 51 deletions(-) diff --git a/code/AssetLib/3MF/D3MFOpcPackage.cpp b/code/AssetLib/3MF/D3MFOpcPackage.cpp index 565790656..64300ed83 100644 --- a/code/AssetLib/3MF/D3MFOpcPackage.cpp +++ b/code/AssetLib/3MF/D3MFOpcPackage.cpp @@ -147,7 +147,7 @@ D3MFOpcPackage::D3MFOpcPackage(IOSystem* pIOHandler, const std::string& rFile) } } - ASSIMP_LOG_DEBUG(rootFile); + ASSIMP_LOG_VERBOSE_DEBUG(rootFile); mZipArchive->Close(fileStream); diff --git a/code/AssetLib/Ogre/OgreBinarySerializer.cpp b/code/AssetLib/Ogre/OgreBinarySerializer.cpp index ce412d791..360da898f 100644 --- a/code/AssetLib/Ogre/OgreBinarySerializer.cpp +++ b/code/AssetLib/Ogre/OgreBinarySerializer.cpp @@ -475,7 +475,7 @@ void OgreBinarySerializer::ReadSubMeshNames(Mesh *mesh) { } submesh->name = ReadLine(); - ASSIMP_LOG_DEBUG_F(" - SubMesh ", submesh->index, " name '", submesh->name, "'"); + ASSIMP_LOG_VERBOSE_DEBUG_F(" - SubMesh ", submesh->index, " name '", submesh->name, "'"); if (!AtEnd()) id = ReadHeader(); @@ -488,7 +488,7 @@ void OgreBinarySerializer::ReadSubMeshNames(Mesh *mesh) { void OgreBinarySerializer::ReadGeometry(VertexData *dest) { dest->count = Read(); - ASSIMP_LOG_DEBUG_F(" - Reading geometry of ", dest->count, " vertices"); + ASSIMP_LOG_VERBOSE_DEBUG_F(" - Reading geometry of ", dest->count, " vertices"); if (!AtEnd()) { uint16_t id = ReadHeader(); @@ -536,7 +536,7 @@ void OgreBinarySerializer::ReadGeometryVertexElement(VertexData *dest) { element.offset = Read(); element.index = Read(); - ASSIMP_LOG_DEBUG_F(" - Vertex element ", element.SemanticToString(), " of type ", + ASSIMP_LOG_VERBOSE_DEBUG_F(" - Vertex element ", element.SemanticToString(), " of type ", element.TypeToString(), " index=", element.index, " source=", element.source); dest->vertexElements.push_back(element); @@ -557,7 +557,7 @@ void OgreBinarySerializer::ReadGeometryVertexBuffer(VertexData *dest) { uint8_t *vertexBuffer = ReadBytes(numBytes); dest->vertexBindings[bindIndex] = MemoryStreamPtr(new Assimp::MemoryIOStream(vertexBuffer, numBytes, true)); - ASSIMP_LOG_DEBUG_F(" - Read vertex buffer for source ", bindIndex, " of ", numBytes, " bytes"); + ASSIMP_LOG_VERBOSE_DEBUG_F(" - Read vertex buffer for source ", bindIndex, " of ", numBytes, " bytes"); } void OgreBinarySerializer::ReadEdgeList(Mesh * /*mesh*/) { @@ -807,7 +807,7 @@ void OgreBinarySerializer::ReadSkeleton(Skeleton *skeleton) { << " Supported versions: " << SKELETON_VERSION_1_8 << " and " << SKELETON_VERSION_1_1); } - ASSIMP_LOG_DEBUG("Reading Skeleton"); + ASSIMP_LOG_VERBOSE_DEBUG("Reading Skeleton"); bool firstBone = true; bool firstAnim = true; @@ -821,7 +821,7 @@ void OgreBinarySerializer::ReadSkeleton(Skeleton *skeleton) { } case SKELETON_BONE: { if (firstBone) { - ASSIMP_LOG_DEBUG(" - Bones"); + ASSIMP_LOG_VERBOSE_DEBUG(" - Bones"); firstBone = false; } @@ -834,7 +834,7 @@ void OgreBinarySerializer::ReadSkeleton(Skeleton *skeleton) { } case SKELETON_ANIMATION: { if (firstAnim) { - ASSIMP_LOG_DEBUG(" - Animations"); + ASSIMP_LOG_VERBOSE_DEBUG(" - Animations"); firstAnim = false; } @@ -874,7 +874,7 @@ void OgreBinarySerializer::ReadBone(Skeleton *skeleton) { throw DeadlyImportError(Formatter::format() << "Ogre Skeleton bone indexes not contiguous. Error at bone index " << bone->id); } - ASSIMP_LOG_DEBUG_F(" ", bone->id, " ", bone->name); + ASSIMP_LOG_VERBOSE_DEBUG_F(" ", bone->id, " ", bone->name); skeleton->bones.push_back(bone); } @@ -919,7 +919,7 @@ void OgreBinarySerializer::ReadSkeletonAnimation(Skeleton *skeleton) { skeleton->animations.push_back(anim); - ASSIMP_LOG_DEBUG_F(" ", anim->name, " (", anim->length, " sec, ", anim->tracks.size(), " tracks)"); + ASSIMP_LOG_VERBOSE_DEBUG_F(" ", anim->name, " (", anim->length, " sec, ", anim->tracks.size(), " tracks)"); } void OgreBinarySerializer::ReadSkeletonAnimationTrack(Skeleton * /*skeleton*/, Animation *dest) { diff --git a/code/AssetLib/Ogre/OgreMaterial.cpp b/code/AssetLib/Ogre/OgreMaterial.cpp index f79206406..74e5eb760 100644 --- a/code/AssetLib/Ogre/OgreMaterial.cpp +++ b/code/AssetLib/Ogre/OgreMaterial.cpp @@ -175,7 +175,7 @@ aiMaterial* OgreImporter::ReadMaterial(const std::string &pFile, Assimp::IOSyste if (materialFile) { break; } - ASSIMP_LOG_DEBUG_F( "Source file for material '", materialName, "' ", potentialFiles[i], " does not exist"); + ASSIMP_LOG_VERBOSE_DEBUG_F( "Source file for material '", materialName, "' ", potentialFiles[i], " does not exist"); } if (!materialFile) { @@ -201,7 +201,7 @@ aiMaterial* OgreImporter::ReadMaterial(const std::string &pFile, Assimp::IOSyste ss << &data[0]; } - ASSIMP_LOG_DEBUG_F("Reading material '", materialName, "'"); + ASSIMP_LOG_VERBOSE_DEBUG_F("Reading material '", materialName, "'"); aiMaterial *material = new aiMaterial(); m_textures.clear(); @@ -245,7 +245,7 @@ aiMaterial* OgreImporter::ReadMaterial(const std::string &pFile, Assimp::IOSyste return material; } - ASSIMP_LOG_DEBUG_F("material '", materialName, "'"); + ASSIMP_LOG_VERBOSE_DEBUG_F("material '", materialName, "'"); while(linePart != partBlockEnd) { @@ -353,7 +353,7 @@ bool OgreImporter::ReadTechnique(const std::string &techniqueName, stringstream return false; } - ASSIMP_LOG_DEBUG_F(" technique '", techniqueName, "'"); + ASSIMP_LOG_VERBOSE_DEBUG_F(" technique '", techniqueName, "'"); const string partPass = "pass"; @@ -389,7 +389,7 @@ bool OgreImporter::ReadPass(const std::string &passName, stringstream &ss, aiMat return false; } - ASSIMP_LOG_DEBUG_F(" pass '", passName, "'"); + ASSIMP_LOG_VERBOSE_DEBUG_F(" pass '", passName, "'"); const string partAmbient = "ambient"; const string partDiffuse = "diffuse"; @@ -416,7 +416,7 @@ bool OgreImporter::ReadPass(const std::string &passName, stringstream &ss, aiMat ss >> r >> g >> b; const aiColor3D color(r, g, b); - ASSIMP_LOG_DEBUG_F( " ", linePart, " ", r, " ", g, " ", b); + ASSIMP_LOG_VERBOSE_DEBUG_F( " ", linePart, " ", r, " ", g, " ", b); if (linePart == partAmbient) { @@ -455,7 +455,7 @@ bool OgreImporter::ReadTextureUnit(const std::string &textureUnitName, stringstr return false; } - ASSIMP_LOG_DEBUG_F(" texture_unit '", textureUnitName, "'"); + ASSIMP_LOG_VERBOSE_DEBUG_F(" texture_unit '", textureUnitName, "'"); const string partTexture = "texture"; const string partTextCoordSet = "tex_coord_set"; @@ -490,7 +490,7 @@ bool OgreImporter::ReadTextureUnit(const std::string &textureUnitName, stringstr if (posSuffix != string::npos && posUnderscore != string::npos && posSuffix > posUnderscore) { string identifier = Ogre::ToLower(textureRef.substr(posUnderscore, posSuffix - posUnderscore)); - ASSIMP_LOG_DEBUG_F( "Detecting texture type from filename postfix '", identifier, "'"); + ASSIMP_LOG_VERBOSE_DEBUG_F( "Detecting texture type from filename postfix '", identifier, "'"); if (identifier == "_n" || identifier == "_nrm" || identifier == "_nrml" || identifier == "_normal" || identifier == "_normals" || identifier == "_normalmap") { @@ -580,7 +580,7 @@ bool OgreImporter::ReadTextureUnit(const std::string &textureUnitName, stringstr unsigned int textureTypeIndex = m_textures[textureType]; m_textures[textureType]++; - ASSIMP_LOG_DEBUG_F( " texture '", textureRef, "' type ", textureType, + ASSIMP_LOG_VERBOSE_DEBUG_F( " texture '", textureRef, "' type ", textureType, " index ", textureTypeIndex, " UV ", uvCoord); aiString assimpTextureRef(textureRef); diff --git a/code/AssetLib/Ogre/OgreXmlSerializer.cpp b/code/AssetLib/Ogre/OgreXmlSerializer.cpp index 406220a9d..31c2ee74e 100644 --- a/code/AssetLib/Ogre/OgreXmlSerializer.cpp +++ b/code/AssetLib/Ogre/OgreXmlSerializer.cpp @@ -268,7 +268,7 @@ void OgreXmlSerializer::ReadMesh(MeshXml *mesh) { throw DeadlyImportError("Root node is <" + m_currentNodeName + "> expecting "); } - ASSIMP_LOG_DEBUG("Reading Mesh"); + ASSIMP_LOG_VERBOSE_DEBUG("Reading Mesh"); NextNode(); @@ -294,7 +294,7 @@ void OgreXmlSerializer::ReadMesh(MeshXml *mesh) { ReadBoneAssignments(mesh->sharedVertexData); } else if (m_currentNodeName == nnSkeletonLink) { mesh->skeletonRef = ReadAttribute("name"); - ASSIMP_LOG_DEBUG_F("Read skeleton link ", mesh->skeletonRef); + ASSIMP_LOG_VERBOSE_DEBUG_F("Read skeleton link ", mesh->skeletonRef); NextNode(); } // Assimp incompatible/ignored nodes @@ -305,7 +305,7 @@ void OgreXmlSerializer::ReadMesh(MeshXml *mesh) { void OgreXmlSerializer::ReadGeometry(VertexDataXml *dest) { dest->count = ReadAttribute("vertexcount"); - ASSIMP_LOG_DEBUG_F(" - Reading geometry of ", dest->count, " vertices"); + ASSIMP_LOG_VERBOSE_DEBUG_F(" - Reading geometry of ", dest->count, " vertices"); NextNode(); while (m_currentNodeName == nnVertexBuffer) { @@ -325,19 +325,19 @@ void OgreXmlSerializer::ReadGeometryVertexBuffer(VertexDataXml *dest) { } if (positions) { - ASSIMP_LOG_DEBUG(" - Contains positions"); + ASSIMP_LOG_VERBOSE_DEBUG(" - Contains positions"); dest->positions.reserve(dest->count); } if (normals) { - ASSIMP_LOG_DEBUG(" - Contains normals"); + ASSIMP_LOG_VERBOSE_DEBUG(" - Contains normals"); dest->normals.reserve(dest->count); } if (tangents) { - ASSIMP_LOG_DEBUG(" - Contains tangents"); + ASSIMP_LOG_VERBOSE_DEBUG(" - Contains tangents"); dest->tangents.reserve(dest->count); } if (uvs > 0) { - ASSIMP_LOG_DEBUG_F(" - Contains ", uvs, " texture coords"); + ASSIMP_LOG_VERBOSE_DEBUG_F(" - Contains ", uvs, " texture coords"); dest->uvs.resize(uvs); for (size_t i = 0, len = dest->uvs.size(); i < len; ++i) { dest->uvs[i].reserve(dest->count); @@ -464,9 +464,9 @@ void OgreXmlSerializer::ReadSubMesh(MeshXml *mesh) { submesh->usesSharedVertexData = ReadAttribute(anUseSharedVertices); } - ASSIMP_LOG_DEBUG_F("Reading SubMesh ", mesh->subMeshes.size()); - ASSIMP_LOG_DEBUG_F(" - Material: '", submesh->materialRef, "'"); - ASSIMP_LOG_DEBUG_F(" - Uses shared geometry: ", (submesh->usesSharedVertexData ? "true" : "false")); + ASSIMP_LOG_VERBOSE_DEBUG_F("Reading SubMesh ", mesh->subMeshes.size()); + ASSIMP_LOG_VERBOSE_DEBUG_F(" - Material: '", submesh->materialRef, "'"); + ASSIMP_LOG_VERBOSE_DEBUG_F(" - Uses shared geometry: ", (submesh->usesSharedVertexData ? "true" : "false")); // TODO: maybe we have always just 1 faces and 1 geometry and always in this order. this loop will only work correct, when the order // of faces and geometry changed, and not if we have more than one of one @@ -505,7 +505,7 @@ void OgreXmlSerializer::ReadSubMesh(MeshXml *mesh) { } if (submesh->indexData->faces.size() == submesh->indexData->faceCount) { - ASSIMP_LOG_DEBUG_F(" - Faces ", submesh->indexData->faceCount); + ASSIMP_LOG_VERBOSE_DEBUG_F(" - Faces ", submesh->indexData->faceCount); } else { throw DeadlyImportError(Formatter::format() << "Read only " << submesh->indexData->faces.size() << " faces when should have read " << submesh->indexData->faceCount); } @@ -571,7 +571,7 @@ void OgreXmlSerializer::ReadBoneAssignments(VertexDataXml *dest) { } } - ASSIMP_LOG_DEBUG_F(" - ", dest->boneAssignments.size(), " bone assignments"); + ASSIMP_LOG_VERBOSE_DEBUG_F(" - ", dest->boneAssignments.size(), " bone assignments"); } // Skeleton @@ -648,7 +648,7 @@ void OgreXmlSerializer::ReadSkeleton(Skeleton *skeleton) { throw DeadlyImportError("Root node is <" + m_currentNodeName + "> expecting "); } - ASSIMP_LOG_DEBUG("Reading Skeleton"); + ASSIMP_LOG_VERBOSE_DEBUG("Reading Skeleton"); // Optional blend mode from root node if (HasAttribute("blendmode")) { @@ -678,7 +678,7 @@ void OgreXmlSerializer::ReadAnimations(Skeleton *skeleton) { throw DeadlyImportError("Cannot read for a Skeleton without bones"); } - ASSIMP_LOG_DEBUG(" - Animations"); + ASSIMP_LOG_VERBOSE_DEBUG(" - Animations"); NextNode(); while (m_currentNodeName == nnAnimation) { @@ -693,7 +693,7 @@ void OgreXmlSerializer::ReadAnimations(Skeleton *skeleton) { ReadAnimationTracks(anim); skeleton->animations.push_back(anim); - ASSIMP_LOG_DEBUG_F(" ", anim->name, " (", anim->length, " sec, ", anim->tracks.size(), " tracks)"); + ASSIMP_LOG_VERBOSE_DEBUG_F(" ", anim->name, " (", anim->length, " sec, ", anim->tracks.size(), " tracks)"); } } @@ -793,7 +793,7 @@ static bool BoneCompare(Bone *a, Bone *b) { } void OgreXmlSerializer::ReadBones(Skeleton *skeleton) { - ASSIMP_LOG_DEBUG(" - Bones"); + ASSIMP_LOG_VERBOSE_DEBUG(" - Bones"); NextNode(); while (m_currentNodeName == nnBone) { @@ -851,7 +851,7 @@ void OgreXmlSerializer::ReadBones(Skeleton *skeleton) { as per the Ogre skeleton spec. It might be more that other (later) code in this imported does not break. */ for (size_t i = 0, len = skeleton->bones.size(); i < len; ++i) { Bone *b = skeleton->bones[i]; - ASSIMP_LOG_DEBUG_F(" ", b->id, " ", b->name); + ASSIMP_LOG_VERBOSE_DEBUG_F(" ", b->id, " ", b->name); if (b->id != static_cast(i)) { throw DeadlyImportError(Formatter::format() << "Bone ids are not in sequence starting from 0. Missing index " << i); diff --git a/code/AssetLib/Ply/PlyParser.cpp b/code/AssetLib/Ply/PlyParser.cpp index d47ca5b6f..1b885fb9c 100644 --- a/code/AssetLib/Ply/PlyParser.cpp +++ b/code/AssetLib/Ply/PlyParser.cpp @@ -514,7 +514,7 @@ bool PLY::DOM::SkipComments(std::vector &buffer) // ------------------------------------------------------------------------------------------------ bool PLY::DOM::ParseHeader(IOStreamBuffer &streamBuffer, std::vector &buffer, bool isBinary) { - ASSIMP_LOG_DEBUG("PLY::DOM::ParseHeader() begin"); + ASSIMP_LOG_VERBOSE_DEBUG("PLY::DOM::ParseHeader() begin"); // parse all elements while (!buffer.empty()) @@ -543,14 +543,14 @@ bool PLY::DOM::ParseHeader(IOStreamBuffer &streamBuffer, std::vector if (!isBinary) // it would occur an error, if binary data start with values as space or line end. SkipSpacesAndLineEnd(buffer); - ASSIMP_LOG_DEBUG("PLY::DOM::ParseHeader() succeeded"); + ASSIMP_LOG_VERBOSE_DEBUG("PLY::DOM::ParseHeader() succeeded"); return true; } // ------------------------------------------------------------------------------------------------ bool PLY::DOM::ParseElementInstanceLists(IOStreamBuffer &streamBuffer, std::vector &buffer, PLYImporter* loader) { - ASSIMP_LOG_DEBUG("PLY::DOM::ParseElementInstanceLists() begin"); + ASSIMP_LOG_VERBOSE_DEBUG("PLY::DOM::ParseElementInstanceLists() begin"); alElementData.resize(alElements.size()); std::vector::const_iterator i = alElements.begin(); @@ -571,7 +571,7 @@ bool PLY::DOM::ParseElementInstanceLists(IOStreamBuffer &streamBuffer, std } } - ASSIMP_LOG_DEBUG("PLY::DOM::ParseElementInstanceLists() succeeded"); + ASSIMP_LOG_VERBOSE_DEBUG("PLY::DOM::ParseElementInstanceLists() succeeded"); return true; } @@ -582,7 +582,7 @@ bool PLY::DOM::ParseElementInstanceListsBinary(IOStreamBuffer &streamBuffe PLYImporter* loader, bool p_bBE) { - ASSIMP_LOG_DEBUG("PLY::DOM::ParseElementInstanceListsBinary() begin"); + ASSIMP_LOG_VERBOSE_DEBUG("PLY::DOM::ParseElementInstanceListsBinary() begin"); alElementData.resize(alElements.size()); std::vector::const_iterator i = alElements.begin(); @@ -602,7 +602,7 @@ bool PLY::DOM::ParseElementInstanceListsBinary(IOStreamBuffer &streamBuffe } } - ASSIMP_LOG_DEBUG("PLY::DOM::ParseElementInstanceListsBinary() succeeded"); + ASSIMP_LOG_VERBOSE_DEBUG("PLY::DOM::ParseElementInstanceListsBinary() succeeded"); return true; } @@ -615,11 +615,11 @@ bool PLY::DOM::ParseInstanceBinary(IOStreamBuffer &streamBuffer, DOM* p_pc std::vector buffer; streamBuffer.getNextLine(buffer); - ASSIMP_LOG_DEBUG("PLY::DOM::ParseInstanceBinary() begin"); + ASSIMP_LOG_VERBOSE_DEBUG("PLY::DOM::ParseInstanceBinary() begin"); if (!p_pcOut->ParseHeader(streamBuffer, buffer, true)) { - ASSIMP_LOG_DEBUG("PLY::DOM::ParseInstanceBinary() failure"); + ASSIMP_LOG_VERBOSE_DEBUG("PLY::DOM::ParseInstanceBinary() failure"); return false; } @@ -628,10 +628,10 @@ bool PLY::DOM::ParseInstanceBinary(IOStreamBuffer &streamBuffer, DOM* p_pc const char* pCur = (char*)&buffer[0]; if (!p_pcOut->ParseElementInstanceListsBinary(streamBuffer, buffer, pCur, bufferSize, loader, p_bBE)) { - ASSIMP_LOG_DEBUG("PLY::DOM::ParseInstanceBinary() failure"); + ASSIMP_LOG_VERBOSE_DEBUG("PLY::DOM::ParseInstanceBinary() failure"); return false; } - ASSIMP_LOG_DEBUG("PLY::DOM::ParseInstanceBinary() succeeded"); + ASSIMP_LOG_VERBOSE_DEBUG("PLY::DOM::ParseInstanceBinary() succeeded"); return true; } @@ -644,11 +644,11 @@ bool PLY::DOM::ParseInstance(IOStreamBuffer &streamBuffer, DOM* p_pcOut, P std::vector buffer; streamBuffer.getNextLine(buffer); - ASSIMP_LOG_DEBUG("PLY::DOM::ParseInstance() begin"); + ASSIMP_LOG_VERBOSE_DEBUG("PLY::DOM::ParseInstance() begin"); if (!p_pcOut->ParseHeader(streamBuffer, buffer, false)) { - ASSIMP_LOG_DEBUG("PLY::DOM::ParseInstance() failure"); + ASSIMP_LOG_VERBOSE_DEBUG("PLY::DOM::ParseInstance() failure"); return false; } @@ -656,10 +656,10 @@ bool PLY::DOM::ParseInstance(IOStreamBuffer &streamBuffer, DOM* p_pcOut, P streamBuffer.getNextLine(buffer); if (!p_pcOut->ParseElementInstanceLists(streamBuffer, buffer, loader)) { - ASSIMP_LOG_DEBUG("PLY::DOM::ParseInstance() failure"); + ASSIMP_LOG_VERBOSE_DEBUG("PLY::DOM::ParseInstance() failure"); return false; } - ASSIMP_LOG_DEBUG("PLY::DOM::ParseInstance() succeeded"); + ASSIMP_LOG_VERBOSE_DEBUG("PLY::DOM::ParseInstance() succeeded"); return true; } diff --git a/code/PostProcessing/TriangulateProcess.cpp b/code/PostProcessing/TriangulateProcess.cpp index 3fd7eea21..cd9be0d21 100644 --- a/code/PostProcessing/TriangulateProcess.cpp +++ b/code/PostProcessing/TriangulateProcess.cpp @@ -490,7 +490,7 @@ bool TriangulateProcess::TriangulateMesh( aiMesh* pMesh) // drop dumb 0-area triangles - deactivated for now: //FindDegenerates post processing step can do the same thing //if (std::fabs(GetArea2D(temp_verts[i[0]],temp_verts[i[1]],temp_verts[i[2]])) < 1e-5f) { - // ASSIMP_LOG_DEBUG("Dropping triangle with area 0"); + // ASSIMP_LOG_VERBOSE_DEBUG("Dropping triangle with area 0"); // --curOut; // delete[] f->mIndices;