[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39899] trunk/blender/source/blender/ collada/MeshImporter.cpp: Fix [#28322] COLLADA imports messed up UVs

Nathan Letwory nathan at letworyinteractive.com
Sun Sep 4 03:13:46 CEST 2011


Revision: 39899
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39899
Author:   jesterking
Date:     2011-09-04 01:13:44 +0000 (Sun, 04 Sep 2011)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/collada/MeshImporter.cpp

Modified: trunk/blender/source/blender/collada/MeshImporter.cpp
===================================================================
--- trunk/blender/source/blender/collada/MeshImporter.cpp	2011-09-04 00:15:59 UTC (rev 39898)
+++ trunk/blender/source/blender/collada/MeshImporter.cpp	2011-09-04 01:13:44 UTC (rev 39899)
@@ -220,8 +220,8 @@
 
 	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 @@
 				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 @@
 					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
 




More information about the Bf-blender-cvs mailing list