From 0606829850a169e1be5d268674f77c016f5640eb Mon Sep 17 00:00:00 2001 From: Gaia Clary Date: Sat, 1 Dec 2018 14:18:11 +0100 Subject: fix T58293 Collada: Does not export Texture coordinates when option 'only selected UV Map' is enabled --- source/blender/collada/GeometryExporter.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source/blender/collada') diff --git a/source/blender/collada/GeometryExporter.cpp b/source/blender/collada/GeometryExporter.cpp index a82d07d53dd..bb69c3fc653 100644 --- a/source/blender/collada/GeometryExporter.cpp +++ b/source/blender/collada/GeometryExporter.cpp @@ -349,13 +349,14 @@ void GeometryExporter::createPolylist(short material_index, int num_layers = CustomData_number_of_layers(&me->ldata, CD_MLOOPUV); int active_uv_index = CustomData_get_active_layer_index(&me->ldata, CD_MLOOPUV); for (i = 0; i < num_layers; i++) { - if (!this->export_settings->active_uv_only || i == active_uv_index) { + int layer_index = CustomData_get_layer_index_n(&me->ldata, CD_MLOOPUV, i); + if (!this->export_settings->active_uv_only || layer_index == active_uv_index) { // char *name = CustomData_get_layer_name(&me->ldata, CD_MLOOPUV, i); COLLADASW::Input input3(COLLADASW::InputSemantic::TEXCOORD, makeUrl(makeTexcoordSourceId(geom_id, i, this->export_settings->active_uv_only)), 2, // this is only until we have optimized UV sets - (this->export_settings->active_uv_only) ? 0 : i // only_active_uv exported -> we have only one set + (this->export_settings->active_uv_only) ? 0 : layer_index // only_active_uv exported -> we have only one set ); til.push_back(input3); } -- cgit v1.2.3