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:
authorgaiaclary <gaia.clary@machinimatrix.org>2014-02-08 16:14:58 +0400
committergaiaclary <gaia.clary@machinimatrix.org>2014-02-08 16:14:58 +0400
commit6952bf2728c11be9e3f3910c4ca3c752561cdd08 (patch)
tree8fa6f54bd4f61880961e810572ffa4d3246bb8b8 /source/blender/collada/MeshImporter.cpp
parent43933989a994ed9d2e67d6989d74b26f7c046a62 (diff)
T38482: Fixed the Crashing. If the same UV Layer is referenced multiple times, then the last imported data set for this UV Layer wins.
Diffstat (limited to 'source/blender/collada/MeshImporter.cpp')
-rw-r--r--source/blender/collada/MeshImporter.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/collada/MeshImporter.cpp b/source/blender/collada/MeshImporter.cpp
index fefd24a56c2..d631a43676f 100644
--- a/source/blender/collada/MeshImporter.cpp
+++ b/source/blender/collada/MeshImporter.cpp
@@ -620,8 +620,14 @@ void MeshImporter::read_polys(COLLADAFW::Mesh *collada_mesh, Mesh *me)
for (unsigned int uvset_index = 0; uvset_index < index_list_array.getCount(); uvset_index++) {
// 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, start_index, *index_list_array[uvset_index], vcount);
+ COLLADAFW::IndexList& index_list = *index_list_array[uvset_index];
+ MLoopUV *mloopuv = (MLoopUV *)CustomData_get_layer_named(&me->ldata, CD_MLOOPUV, index_list.getName().c_str());
+ if (mloopuv == NULL) {
+ fprintf(stderr, "Collada import: Mesh [%s] : Unknown reference to TEXCOORD [#%s].", me->id.name, index_list.getName().c_str() );
+ }
+ else {
+ set_face_uv(mloopuv+loop_index, uvs, start_index, *index_list_array[uvset_index], vcount);
+ }
}
if (mp_has_normals) {