[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60242] trunk/blender/source/blender/ collada/MeshImporter.cpp: Ensure positions can be read for sources that have stride
Nathan Letwory
nathan at letworyinteractive.com
Thu Sep 19 23:59:23 CEST 2013
Revision: 60242
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60242
Author: jesterking
Date: 2013-09-19 21:59:22 +0000 (Thu, 19 Sep 2013)
Log Message:
-----------
Ensure positions can be read for sources that have stride
defined as 2 (2D 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-09-19 20:27:26 UTC (rev 60241)
+++ trunk/blender/source/blender/collada/MeshImporter.cpp 2013-09-19 21:59:22 UTC (rev 60242)
@@ -665,7 +665,11 @@
v[0] = (*values)[i++];
v[1] = (*values)[i++];
- v[2] = (*values)[i];
+ if(stride>=3) {
+ v[2] = (*values)[i];
+ } else {
+ v[2] = 0.0f;
+ }
}
break;
@@ -676,13 +680,18 @@
v[0] = (float)(*values)[i++];
v[1] = (float)(*values)[i++];
- v[2] = (float)(*values)[i];
+ if(stride>=3) {
+ v[2] = (float)(*values)[i];
+ } else {
+ v[2] = 0.0f;
+ }
}
break;
default:
break;
}
}
+
bool MeshImporter::is_flat_face(unsigned int *nind, COLLADAFW::MeshVertexData& nor, int count)
{
float a[3], b[3];
More information about the Bf-blender-cvs
mailing list