Commit: cd14dcbe914662ae950c9178f52a63912809fb53
Author: Nathan Letwory
Date:   Thu May 22 12:34:11 2014 +0300
https://developer.blender.org/rBcd14dcbe914662ae950c9178f52a63912809fb53

Don't write all uv textures, but only active uv layer.

Fix T39922

===================================================================

M       source/blender/collada/EffectExporter.cpp

===================================================================

diff --git a/source/blender/collada/EffectExporter.cpp 
b/source/blender/collada/EffectExporter.cpp
index 6741e92..218f2db 100644
--- a/source/blender/collada/EffectExporter.cpp
+++ b/source/blender/collada/EffectExporter.cpp
@@ -310,12 +310,12 @@ void EffectsExporter::operator()(Material *ma, Object *ob)
                }
        }
 
-
+       int active_uv_layer = -1;
        std::set<Image *> uv_textures;
        if (ob->type == OB_MESH && ob->totcol && 
this->export_settings->include_uv_textures) {
                bool active_uv_only = this->export_settings->active_uv_only;
                Mesh *me     = (Mesh *) ob->data;
-               int active_uv_layer = 
CustomData_get_active_layer_index(&me->pdata, CD_MTEXPOLY);
+               active_uv_layer = CustomData_get_active_layer_index(&me->pdata, 
CD_MTEXPOLY);
 
                BKE_mesh_tessface_ensure(me);
                for (int i = 0; i < me->pdata.totlayer; i++) {
@@ -381,13 +381,16 @@ void EffectsExporter::operator()(Material *ma, Object *ob)
        }
 
        std::set<Image *>::iterator uv_t_iter;
-       for (uv_t_iter = uv_textures.begin(); uv_t_iter != uv_textures.end(); 
uv_t_iter++ ) {
-               Image *ima = *uv_t_iter;
-               std::string key(id_name(ima));
-               key = translate_id(key);
-               int i = im_samp_map[key];
-               COLLADASW::Sampler *sampler = (COLLADASW::Sampler 
*)samp_surf[i][0];
-               ep.setDiffuse(createTexture(ima, active_uv, sampler), false, 
"diffuse");
+       int idx;
+       for (idx = 0, uv_t_iter = uv_textures.begin(); uv_t_iter != 
uv_textures.end(); uv_t_iter++, idx++ ) {
+               if(active_uv_layer>-1 && idx==active_uv_layer) {
+                       Image *ima = *uv_t_iter;
+                       std::string key(id_name(ima));
+                       key = translate_id(key);
+                       int i = im_samp_map[key];
+                       COLLADASW::Sampler *sampler = (COLLADASW::Sampler 
*)samp_surf[i][0];
+                       ep.setDiffuse(createTexture(ima, active_uv, sampler), 
false, "diffuse");
+               }
        }
 
        // performs the actual writing

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to