diff options
author | Gaia Clary <gaia.clary@machinimatrix.org> | 2012-08-16 02:08:22 +0400 |
---|---|---|
committer | Gaia Clary <gaia.clary@machinimatrix.org> | 2012-08-16 02:08:22 +0400 |
commit | 417e99df22241d05179671d2f7198343c60d118b (patch) | |
tree | d19042686b74706ea03d79bb5088ac1a2f4a4d66 /source/blender/collada/GeometryExporter.cpp | |
parent | 597e6f9bbc7bf08150e81356f734b33c5e05ce68 (diff) |
Collada: fixed export when 'active UV Layer only' was selected
Diffstat (limited to 'source/blender/collada/GeometryExporter.cpp')
-rw-r--r-- | source/blender/collada/GeometryExporter.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/source/blender/collada/GeometryExporter.cpp b/source/blender/collada/GeometryExporter.cpp index 29ffcf53ee9..c7ad2ff3975 100644 --- a/source/blender/collada/GeometryExporter.cpp +++ b/source/blender/collada/GeometryExporter.cpp @@ -279,15 +279,18 @@ void GeometryExporter::createPolylist(short material_index, // if mesh has uv coords writes <input> for TEXCOORD int num_layers = CustomData_number_of_layers(&me->fdata, CD_MTFACE); - + int active_uv_index = CustomData_get_active_layer_index(&me->fdata, CD_MTFACE)-1; for (i = 0; i < num_layers; i++) { - // char *name = CustomData_get_layer_name(&me->fdata, CD_MTFACE, i); - COLLADASW::Input input3(COLLADASW::InputSemantic::TEXCOORD, - makeUrl(makeTexcoordSourceId(geom_id, i)), - 2, // offset always 2, this is only until we have optimized UV sets - i // set number equals UV map index - ); - til.push_back(input3); + if (!this->export_settings->active_uv_only || i == active_uv_index) { + + // char *name = CustomData_get_layer_name(&me->fdata, CD_MTFACE, i); + COLLADASW::Input input3(COLLADASW::InputSemantic::TEXCOORD, + makeUrl(makeTexcoordSourceId(geom_id, i)), + 2, // offset always 2, this is only until we have optimized UV sets + i // set number equals UV map index + ); + til.push_back(input3); + } } if (has_color) { |