Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Letwory <nathan@letworyinteractive.com>2011-09-04 05:13:44 +0400
committerNathan Letwory <nathan@letworyinteractive.com>2011-09-04 05:13:44 +0400
commitcbc812b757068c65effd90bdd4b08d7f4e25c342 (patch)
tree3297cc53a196534280648072503332406eedcc8a /source/blender/collada
parent1764f2135d3c1780c4ead12fae3eb97ac2de5a7d (diff)
Fix [#28322] COLLADA imports messed up UVs
Reported by Chad Gleason Imported index order could put mface->v4==0. We already know amount of verts, so use that instead.
Diffstat (limited to 'source/blender/collada')
-rw-r--r--source/blender/collada/MeshImporter.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/collada/MeshImporter.cpp b/source/blender/collada/MeshImporter.cpp
index 6032109b809..e9086f05628 100644
--- a/source/blender/collada/MeshImporter.cpp
+++ b/source/blender/collada/MeshImporter.cpp
@@ -220,8 +220,8 @@ void MeshImporter::set_face_uv(MTFace *mtface, UVDataWrapper &uvs,
if (quad) uvs.getUV(indices[index + 3], mtface->uv[3]);
-#ifdef COLLADA_DEBUG
- /*if (quad) {
+#if 1 // #ifdef COLLADA_DEBUG
+ if (quad) {
fprintf(stderr, "face uv:\n"
"((%d, %d, %d, %d))\n"
"((%.1f, %.1f), (%.1f, %.1f), (%.1f, %.1f), (%.1f, %.1f))\n",
@@ -248,7 +248,7 @@ void MeshImporter::set_face_uv(MTFace *mtface, UVDataWrapper &uvs,
mtface->uv[0][0], mtface->uv[0][1],
mtface->uv[1][0], mtface->uv[1][1],
mtface->uv[2][0], mtface->uv[2][1]);
- }*/
+ }
#endif
}
@@ -587,7 +587,7 @@ void MeshImporter::read_faces(COLLADAFW::Mesh *mesh, Mesh *me, int new_tris) //T
for (k = 0; k < index_list_array.getCount(); k++) {
// get mtface by face index and uv set index
MTFace *mtface = (MTFace*)CustomData_get_layer_n(&me->fdata, CD_MTFACE, k);
- set_face_uv(&mtface[face_index], uvs, *index_list_array[k], index, mface->v4 != 0);
+ set_face_uv(&mtface[face_index], uvs, *index_list_array[k], index, vcount == 4);
}
#endif