Changeset View
Changeset View
Standalone View
Standalone View
source/blender/alembic/intern/abc_customdata.cc
| Show First 20 Lines • Show All 229 Lines • ▼ Show 20 Lines | |||||
| static void read_uvs(const CDStreamConfig &config, void *data, | static void read_uvs(const CDStreamConfig &config, void *data, | ||||
| const Alembic::AbcGeom::V2fArraySamplePtr &uvs, | const Alembic::AbcGeom::V2fArraySamplePtr &uvs, | ||||
| const Alembic::AbcGeom::UInt32ArraySamplePtr &indices) | const Alembic::AbcGeom::UInt32ArraySamplePtr &indices) | ||||
| { | { | ||||
| MPoly *mpolys = config.mpoly; | MPoly *mpolys = config.mpoly; | ||||
| MLoopUV *mloopuvs = static_cast<MLoopUV *>(data); | MLoopUV *mloopuvs = static_cast<MLoopUV *>(data); | ||||
| unsigned int uv_index, loop_index; | unsigned int uv_index, loop_index, rev_loop_index; | ||||
| for (int i = 0; i < config.totpoly; ++i) { | for (int i = 0; i < config.totpoly; ++i) { | ||||
| MPoly &poly = mpolys[i]; | MPoly &poly = mpolys[i]; | ||||
| unsigned int rev_loop_offset = poly.loopstart + poly.totloop - 1; | |||||
| for (int f = 0; f < poly.totloop; ++f) { | for (int f = 0; f < poly.totloop; ++f) { | ||||
| loop_index = poly.loopstart + f; | loop_index = poly.loopstart + f; | ||||
| rev_loop_index = rev_loop_offset - f; | |||||
| uv_index = (*indices)[loop_index]; | uv_index = (*indices)[loop_index]; | ||||
| const Imath::V2f &uv = (*uvs)[uv_index]; | const Imath::V2f &uv = (*uvs)[uv_index]; | ||||
| MLoopUV &loopuv = mloopuvs[loop_index]; | MLoopUV &loopuv = mloopuvs[rev_loop_index]; | ||||
| loopuv.uv[0] = uv[0]; | loopuv.uv[0] = uv[0]; | ||||
| loopuv.uv[1] = uv[1]; | loopuv.uv[1] = uv[1]; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static size_t mcols_out_of_bounds_check( | static size_t mcols_out_of_bounds_check( | ||||
| const size_t color_index, | const size_t color_index, | ||||
| ▲ Show 20 Lines • Show All 177 Lines • Show Last 20 Lines | |||||