[Bf-blender-cvs] [f76d010b73f] collada: Cleanup: Collada added indentation, changed variable names

Gaia Clary noreply at git.blender.org
Wed Mar 28 21:30:47 CEST 2018


Commit: f76d010b73fbab6c38de7962498dd179be74e2d1
Author: Gaia Clary
Date:   Sat Mar 17 13:45:32 2018 +0100
Branches: collada
https://developer.blender.org/rBf76d010b73fbab6c38de7962498dd179be74e2d1

Cleanup: Collada added indentation, changed variable names

Just for better reading, no functional change here.

===================================================================

M	source/blender/collada/AnimationImporter.cpp
M	source/blender/collada/EffectExporter.cpp
M	source/blender/collada/MeshImporter.cpp

===================================================================

diff --git a/source/blender/collada/AnimationImporter.cpp b/source/blender/collada/AnimationImporter.cpp
index bfa127b695d..af8b68d697c 100644
--- a/source/blender/collada/AnimationImporter.cpp
+++ b/source/blender/collada/AnimationImporter.cpp
@@ -1760,24 +1760,24 @@ bool AnimationImporter::evaluate_animation(COLLADAFW::Transformation *tm, float
 		else if (is_translate)
 			dae_translate_to_v3(tm, vec);
 
-		for (unsigned int j = 0; j < bindings.getCount(); j++) {
-			const COLLADAFW::AnimationList::AnimationBinding& binding = bindings[j];
+		for (unsigned int index = 0; index < bindings.getCount(); index++) {
+			const COLLADAFW::AnimationList::AnimationBinding& binding = bindings[index];
 			std::vector<FCurve *>& curves = curve_map[binding.animation];
 			COLLADAFW::AnimationList::AnimationClass animclass = binding.animationClass;
 			char path[100];
 
 			switch (type) {
 				case COLLADAFW::Transformation::ROTATE:
-					BLI_snprintf(path, sizeof(path), "%s.rotate (binding %u)", node_id, j);
+					BLI_snprintf(path, sizeof(path), "%s.rotate (binding %u)", node_id, index);
 					break;
 				case COLLADAFW::Transformation::SCALE:
-					BLI_snprintf(path, sizeof(path), "%s.scale (binding %u)", node_id, j);
+					BLI_snprintf(path, sizeof(path), "%s.scale (binding %u)", node_id, index);
 					break;
 				case COLLADAFW::Transformation::TRANSLATE:
-					BLI_snprintf(path, sizeof(path), "%s.translate (binding %u)", node_id, j);
+					BLI_snprintf(path, sizeof(path), "%s.translate (binding %u)", node_id, index);
 					break;
 				case COLLADAFW::Transformation::MATRIX:
-					BLI_snprintf(path, sizeof(path), "%s.matrix (binding %u)", node_id, j);
+					BLI_snprintf(path, sizeof(path), "%s.matrix (binding %u)", node_id, index);
 					break;
 				default:
 					break;
diff --git a/source/blender/collada/EffectExporter.cpp b/source/blender/collada/EffectExporter.cpp
index 2bf0859b0f0..005c5e1d9d3 100644
--- a/source/blender/collada/EffectExporter.cpp
+++ b/source/blender/collada/EffectExporter.cpp
@@ -352,7 +352,7 @@ void EffectsExporter::operator()(Material *ma, Object *ob)
 		key = translate_id(key);
 		int i = im_samp_map[key];
 		std::string uvname = strlen(t->uvname) ? t->uvname : active_uv;
-		COLLADASW::Sampler *sampler = (COLLADASW::Sampler *)samp_surf[i];
+		COLLADASW::Sampler *sampler = (COLLADASW::Sampler *)samp_surf[i]; // possibly uninitialised memory ...
 		writeTextures(ep, key, sampler, t, ima, uvname);
 	}
 
diff --git a/source/blender/collada/MeshImporter.cpp b/source/blender/collada/MeshImporter.cpp
index 2e265125a43..8e03af90e24 100644
--- a/source/blender/collada/MeshImporter.cpp
+++ b/source/blender/collada/MeshImporter.cpp
@@ -597,9 +597,9 @@ void MeshImporter::read_lines(COLLADAFW::Mesh *mesh, Mesh *me)
 
 		COLLADAFW::MeshPrimitiveArray& prim_arr = mesh->getMeshPrimitives();
 
-		for (int i = 0; i < prim_arr.getCount(); i++) {
+		for (int index = 0; index < prim_arr.getCount(); index++) {
 			
-			COLLADAFW::MeshPrimitive *mp = prim_arr[i];
+			COLLADAFW::MeshPrimitive *mp = prim_arr[index];
 
 			int type = mp->getPrimitiveType();
 			if (type == COLLADAFW::MeshPrimitive::LINES) {



More information about the Bf-blender-cvs mailing list