[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [56153] trunk/blender/source/blender/ collada/MeshImporter.cpp: Fix #35014: collada import crash with UV coordinates.

Brecht Van Lommel brechtvanlommel at pandora.be
Thu Apr 18 23:40:06 CEST 2013


Revision: 56153
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=56153
Author:   blendix
Date:     2013-04-18 21:40:06 +0000 (Thu, 18 Apr 2013)
Log Message:
-----------
Fix #35014: collada import crash with UV coordinates.

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

Modified: trunk/blender/source/blender/collada/MeshImporter.cpp
===================================================================
--- trunk/blender/source/blender/collada/MeshImporter.cpp	2013-04-18 21:00:29 UTC (rev 56152)
+++ trunk/blender/source/blender/collada/MeshImporter.cpp	2013-04-18 21:40:06 UTC (rev 56153)
@@ -602,6 +602,8 @@
 			collada_meshtype == COLLADAFW::MeshPrimitive::POLYGONS ||
 			collada_meshtype == COLLADAFW::MeshPrimitive::TRIANGLES) {
 			COLLADAFW::Polygons *mpvc = (COLLADAFW::Polygons *)mp;
+			unsigned int start_index = 0;
+
 			for (unsigned int j = 0; j < prim_totpoly; j++) {
 				
 				// Vertices in polygon:
@@ -615,7 +617,7 @@
 					// get mtface by face index and uv set index
 					MLoopUV  *mloopuv = (MLoopUV  *)CustomData_get_layer_n(&me->ldata, CD_MLOOPUV, uvset_index);
 
-					set_face_uv(mloopuv+loop_index, uvs, loop_index, *index_list_array[l], vcount);
+					set_face_uv(mloopuv+loop_index, uvs, start_index, *index_list_array[l], vcount);
 				}
 
 				if (mp_has_normals) {
@@ -626,6 +628,7 @@
 				mpoly++;
 				mloop += vcount;
 				loop_index += vcount;
+				start_index += vcount;
 				prim.totpoly++;
 
 				if (mp_has_normals)




More information about the Bf-blender-cvs mailing list