diff options
author | Alexander Romanov <a.romanov@blend4web.com> | 2016-05-24 17:43:57 +0300 |
---|---|---|
committer | Alexander Romanov <a.romanov@blend4web.com> | 2016-05-24 17:43:57 +0300 |
commit | 5494ea1d084ab327a08145a39ef8621ccbe0c1f7 (patch) | |
tree | 4d2890c0cffa07b30074392344d0626639459afd /source/blender | |
parent | 42b26206c66581f10a03a0908ee777f8d205b2fa (diff) |
Fix own mistake in D1120: wrong indexing of UV maps during tangent calculation
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/DerivedMesh.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 423b8fade39..a3e7e5f1ac4 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -3269,17 +3269,18 @@ void DM_calc_loop_tangents_step_0( bool *rcalc_act, bool *rcalc_ren, int *ract_uv_n, int *rren_uv_n, char *ract_uv_name, char *rren_uv_name, char *rtangent_mask) { /* Active uv in viewport */ + int layer_index = CustomData_get_layer_index(loopData, CD_MLOOPUV); *ract_uv_n = CustomData_get_active_layer(loopData, CD_MLOOPUV); ract_uv_name[0] = 0; if (*ract_uv_n != -1) { - strcpy(ract_uv_name, loopData->layers[*ract_uv_n].name); + strcpy(ract_uv_name, loopData->layers[*ract_uv_n + layer_index].name); } /* Active tangent in render */ *rren_uv_n = CustomData_get_render_layer(loopData, CD_MLOOPUV); rren_uv_name[0] = 0; if (*rren_uv_n != -1) { - strcpy(rren_uv_name, loopData->layers[*rren_uv_n].name); + strcpy(rren_uv_name, loopData->layers[*rren_uv_n + layer_index].name); } /* If active tangent not in tangent_names we take it into account */ |