diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-12-07 15:53:03 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-12-07 15:53:03 +0300 |
commit | 1c7cfa025c87e8f31790b48cbb189949f7949ad1 (patch) | |
tree | 3869d475a9d10c005b0bb8006eb77bf55f1903d3 /source/blender/modifiers | |
parent | 46f518e92790a04885f4e047bb59b11019d73aa3 (diff) | |
parent | 2e2e6e3bdb694e56fcd161f06b6751e953cd2fa1 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r-- | source/blender/modifiers/intern/MOD_array.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/modifiers/intern/MOD_array.c b/source/blender/modifiers/intern/MOD_array.c index 81ace75f2b1..cd19020d375 100644 --- a/source/blender/modifiers/intern/MOD_array.c +++ b/source/blender/modifiers/intern/MOD_array.c @@ -608,6 +608,26 @@ static DerivedMesh *arrayModifier_doArray( } } + /* handle UVs */ + if (chunk_nloops > 0 && is_zero_v2(amd->uv_offset) == false) { + const int totuv = CustomData_number_of_layers(&result->loopData, CD_MLOOPUV); + for (i = 0; i < totuv; i++) { + MLoopUV *dmloopuv = CustomData_get_layer_n(&result->loopData, CD_MLOOPUV, i); + dmloopuv += chunk_nloops; + for (c = 1; c < count; c++) { + const float uv_offset[2] = { + amd->uv_offset[0] * (float)c, + amd->uv_offset[1] * (float)c, + }; + int l_index = chunk_nloops; + for (; l_index-- != 0; dmloopuv++) { + dmloopuv->uv[0] += uv_offset[0]; + dmloopuv->uv[1] += uv_offset[1]; + } + } + } + } + last_chunk_start = (count - 1) * chunk_nverts; last_chunk_nverts = chunk_nverts; |