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/ImageExporter.cpp | |
parent | 597e6f9bbc7bf08150e81356f734b33c5e05ce68 (diff) |
Collada: fixed export when 'active UV Layer only' was selected
Diffstat (limited to 'source/blender/collada/ImageExporter.cpp')
-rw-r--r-- | source/blender/collada/ImageExporter.cpp | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/source/blender/collada/ImageExporter.cpp b/source/blender/collada/ImageExporter.cpp index 206dc09fe8b..66dcec7d8e4 100644 --- a/source/blender/collada/ImageExporter.cpp +++ b/source/blender/collada/ImageExporter.cpp @@ -151,25 +151,31 @@ void ImagesExporter::export_UV_Images() { std::set<Image *> uv_textures; LinkNode *node; - bool use_copies = this->export_settings->use_texture_copies; + bool use_texture_copies = this->export_settings->use_texture_copies; + bool active_uv_only = this->export_settings->active_uv_only; + for (node = this->export_settings->export_set; node; node = node->next) { Object *ob = (Object *)node->link; if (ob->type == OB_MESH && ob->totcol) { Mesh *me = (Mesh *) ob->data; BKE_mesh_tessface_ensure(me); + int active_uv_layer = CustomData_get_active_layer_index(&me->pdata, CD_MTEXPOLY); for (int i = 0; i < me->pdata.totlayer; i++) { if (me->pdata.layers[i].type == CD_MTEXPOLY) { - MTexPoly *txface = (MTexPoly *)me->pdata.layers[i].data; - for (int j = 0; j < me->totpoly; j++, txface++) { - - Image *ima = txface->tpage; - if (ima == NULL) - continue; - - bool not_in_list = uv_textures.find(ima) == uv_textures.end(); - if (not_in_list) { - uv_textures.insert(ima); - export_UV_Image(ima, use_copies); + if (!active_uv_only || active_uv_layer == i) + { + MTexPoly *txface = (MTexPoly *)me->pdata.layers[i].data; + for (int j = 0; j < me->totpoly; j++, txface++) { + + Image *ima = txface->tpage; + if (ima == NULL) + continue; + + bool not_in_list = uv_textures.find(ima) == uv_textures.end(); + if (not_in_list) { + uv_textures.insert(ima); + export_UV_Image(ima, use_texture_copies); + } } } } |