BlenderDNA.h:

* Fix rethrow that would crash the program.
* QUESTION: am I throwing the right exception here.

COBLoader:
* catch exception by const ref
* fix equality checks using strncmp taht weren't actually checking equality

FBXMaterial: Catch exception by const ref (+ Debug log that it's done so)

FBXConverter: Rename local variables to avoid shadowing parameter

ImageExtractor: Remove duplicated/unreachable code

FBXConverter: Another shadowed variable fix

MD5Loader: 2 shadowed variables

IRRLoader: shadowed parameter

StepFileReader.cpp: Shadowed parameter

IRRLoader: remove empty else statement

STLExporter: Throw error instead of silently ignoring unimplemented option

Misc empty blocks removed or debug logging added
This commit is contained in:
Charlie Gettys
2019-03-30 14:12:13 -04:00
parent 3e19545dc7
commit f15f37634d
12 changed files with 58 additions and 58 deletions

View File

@@ -300,13 +300,10 @@ int ClampSpline(int idx, int size) {
// ------------------------------------------------------------------------------------------------
inline void FindSuitableMultiple(int& angle)
{
if (angle < 3)angle = 3;
if (angle < 3) angle = 3;
else if (angle < 10) angle = 10;
else if (angle < 20) angle = 20;
else if (angle < 30) angle = 30;
else
{
}
}
// ------------------------------------------------------------------------------------------------
@@ -317,6 +314,8 @@ void IRRImporter::ComputeAnimations(Node* root, aiNode* real, std::vector<aiNode
// XXX totally WIP - doesn't produce proper results, need to evaluate
// whether there's any use for Irrlicht's proprietary scene format
// outside Irrlicht ...
// This also applies to the above function of FindSuitableMultiple and ClampSpline which are
// solely used in this function
if (root->animators.empty()) {
return;
@@ -674,38 +673,38 @@ void IRRImporter::GenerateGraph(Node* root,aiNode* rootOut ,aiScene* scene,
// Get the loaded mesh from the scene and add it to
// the list of all scenes to be attached to the
// graph we're currently building
aiScene* scene = batch.GetImport(root->id);
if (!scene) {
aiScene* localScene = batch.GetImport(root->id);
if (!localScene) {
ASSIMP_LOG_ERROR("IRR: Unable to load external file: " + root->meshPath);
break;
}
attach.push_back(AttachmentInfo(scene,rootOut));
attach.push_back(AttachmentInfo(localScene,rootOut));
// Now combine the material we've loaded for this mesh
// with the real materials we got from the file. As we
// don't execute any pp-steps on the file, the numbers
// should be equal. If they are not, we can impossibly
// do this ...
if (root->materials.size() != (unsigned int)scene->mNumMaterials) {
if (root->materials.size() != (unsigned int)localScene->mNumMaterials) {
ASSIMP_LOG_WARN("IRR: Failed to match imported materials "
"with the materials found in the IRR scene file");
break;
}
for (unsigned int i = 0; i < scene->mNumMaterials;++i) {
for (unsigned int i = 0; i < localScene->mNumMaterials;++i) {
// Delete the old material, we don't need it anymore
delete scene->mMaterials[i];
delete localScene->mMaterials[i];
std::pair<aiMaterial*, unsigned int>& src = root->materials[i];
scene->mMaterials[i] = src.first;
localScene->mMaterials[i] = src.first;
}
// NOTE: Each mesh should have exactly one material assigned,
// but we do it in a separate loop if this behaviour changes
// in future.
for (unsigned int i = 0; i < scene->mNumMeshes;++i) {
for (unsigned int i = 0; i < localScene->mNumMeshes;++i) {
// Process material flags
aiMesh* mesh = scene->mMeshes[i];
aiMesh* mesh = localScene->mMeshes[i];
// If "trans_vertex_alpha" mode is enabled, search all vertex colors