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:
authorGaia Clary <gaia.clary@machinimatrix.org>2018-11-28 17:27:11 +0300
committerGaia Clary <gaia.clary@machinimatrix.org>2018-11-28 17:36:09 +0300
commitdd102a47574d2806da52747b997e85dd7f1e5f62 (patch)
tree9170f7716aa227808edf95857f838414497dd081 /source/blender/collada
parent3ed0d5b4d4c06a0c88832525a7c55d21a04d86ff (diff)
fix:T58093 Collada Exporter does not create bind_vertex_input and texcoord attribute
The Collada exporter used MTFACE layers (deprecated) instead of CD_MLOOPUV layers. In 2.8 the exporter could no longer find the UVMaps reliably.
Diffstat (limited to 'source/blender/collada')
-rw-r--r--source/blender/collada/InstanceWriter.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/collada/InstanceWriter.cpp b/source/blender/collada/InstanceWriter.cpp
index 68842596550..0c0b1a15653 100644
--- a/source/blender/collada/InstanceWriter.cpp
+++ b/source/blender/collada/InstanceWriter.cpp
@@ -57,13 +57,14 @@ void InstanceWriter::add_material_bindings(COLLADASW::BindMaterial& bind_materia
// create <bind_vertex_input> for each uv map
Mesh *me = (Mesh *)ob->data;
- int totlayer = CustomData_number_of_layers(&me->fdata, CD_MTFACE);
+
+ int num_layers = CustomData_number_of_layers(&me->ldata, CD_MLOOPUV);
int map_index = 0;
- int active_uv_index = CustomData_get_active_layer_index(&me->fdata, CD_MTFACE) -1;
- for (int b = 0; b < totlayer; b++) {
+ int active_uv_index = CustomData_get_active_layer_index(&me->ldata, CD_MLOOPUV);
+ for (int b = 0; b < num_layers; b++) {
if (!active_uv_only || b == active_uv_index) {
- char *name = bc_CustomData_get_layer_name(&me->fdata, CD_MTFACE, b);
+ char *name = bc_CustomData_get_layer_name(&me->ldata, CD_MLOOPUV, b);
im.push_back(COLLADASW::BindVertexInput(name, "TEXCOORD", map_index++));
}
}