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:
authorHans Goudey <h.goudey@me.com>2022-08-17 20:59:10 +0300
committerHans Goudey <h.goudey@me.com>2022-08-17 20:59:10 +0300
commit37eea2253295602fbff4ba255fdb2ee8f1826df3 (patch)
treeee939acc8d0f5a395064692a2e65a289f4210a31 /source/blender/io/collada/MeshImporter.cpp
parentf08ea76db591a1ca60715f19f3465da57b26f64e (diff)
Initial patch from Martijn Versteegh
Diffstat (limited to 'source/blender/io/collada/MeshImporter.cpp')
-rw-r--r--source/blender/io/collada/MeshImporter.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/io/collada/MeshImporter.cpp b/source/blender/io/collada/MeshImporter.cpp
index fa0348fbcf2..ea5ec2ee8f9 100644
--- a/source/blender/io/collada/MeshImporter.cpp
+++ b/source/blender/io/collada/MeshImporter.cpp
@@ -237,7 +237,7 @@ void MeshImporter::set_vcol(MLoopCol *mloopcol,
}
}
-void MeshImporter::set_face_uv(MLoopUV *mloopuv,
+void MeshImporter::set_face_uv(float (*mloopuv)[2],
UVDataWrapper &uvs,
int start_index,
COLLADAFW::IndexList &index_list,
@@ -248,7 +248,7 @@ void MeshImporter::set_face_uv(MLoopUV *mloopuv,
for (int index = 0; index < count; index++) {
int uv_index = indices[index + start_index];
- uvs.getUV(uv_index, mloopuv[index].uv);
+ uvs.getUV(uv_index, mloopuv[index]);
}
}
@@ -468,10 +468,10 @@ void MeshImporter::allocate_poly_data(COLLADAFW::Mesh *collada_mesh, Mesh *me)
COLLADAFW::String &uvname = info->mName;
/* Allocate space for UV_data */
CustomData_add_layer_named(
- &me->ldata, CD_MLOOPUV, CD_DEFAULT, nullptr, me->totloop, uvname.c_str());
+ &me->ldata, CD_PROP_FLOAT2, CD_DEFAULT, nullptr, me->totloop, uvname.c_str());
}
/* activate the first uv map */
- me->mloopuv = (MLoopUV *)CustomData_get_layer_n(&me->ldata, CD_MLOOPUV, 0);
+ me->mloopuv = (float(*)[2])CustomData_get_layer_n(&me->ldata, CD_PROP_FLOAT2, 0);
}
int totcolset = collada_mesh->getColors().getInputInfosArray().getCount();
@@ -703,8 +703,8 @@ void MeshImporter::read_polys(COLLADAFW::Mesh *collada_mesh, Mesh *me)
uvset_index++) {
/* get mtface by face index and uv set index */
COLLADAFW::IndexList &index_list = *index_list_array_uvcoord[uvset_index];
- MLoopUV *mloopuv = (MLoopUV *)CustomData_get_layer_named(
- &me->ldata, CD_MLOOPUV, index_list.getName().c_str());
+ float(*mloopuv)[2] = (float(*)[2])CustomData_get_layer_named(
+ &me->ldata, CD_PROP_FLOAT2, index_list.getName().c_str());
if (mloopuv == nullptr) {
fprintf(stderr,
"Collada import: Mesh [%s] : Unknown reference to TEXCOORD [#%s].\n",