diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-07-08 14:35:55 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-07-08 19:09:52 +0300 |
commit | 1715c396e450d41550e70c665211354c303a7275 (patch) | |
tree | 1b70c44f77328919f7741988bdc132a5e8f3b468 /source/blender/draw/intern/draw_cache_impl_particles.c | |
parent | 8a7c2c4192aff7f34e50dac83bd793e0247fc604 (diff) |
Fix T65534 Eevee don't respect active UVmap
Diffstat (limited to 'source/blender/draw/intern/draw_cache_impl_particles.c')
-rw-r--r-- | source/blender/draw/intern/draw_cache_impl_particles.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_particles.c b/source/blender/draw/intern/draw_cache_impl_particles.c index c66a737d684..9e25c5168cc 100644 --- a/source/blender/draw/intern/draw_cache_impl_particles.c +++ b/source/blender/draw/intern/draw_cache_impl_particles.c @@ -835,7 +835,9 @@ static void particle_batch_cache_ensure_procedural_strand_data(PTCacheEdit *edit ParticleHairCache *cache) { int active_uv = 0; + int render_uv = 0; int active_col = 0; + int render_col = 0; ParticleSystemModifierData *psmd = (ParticleSystemModifierData *)md; @@ -843,10 +845,12 @@ static void particle_batch_cache_ensure_procedural_strand_data(PTCacheEdit *edit if (CustomData_has_layer(&psmd->mesh_final->ldata, CD_MLOOPUV)) { cache->num_uv_layers = CustomData_number_of_layers(&psmd->mesh_final->ldata, CD_MLOOPUV); active_uv = CustomData_get_active_layer(&psmd->mesh_final->ldata, CD_MLOOPUV); + render_uv = CustomData_get_render_layer(&psmd->mesh_final->ldata, CD_MLOOPUV); } if (CustomData_has_layer(&psmd->mesh_final->ldata, CD_MLOOPCOL)) { cache->num_col_layers = CustomData_number_of_layers(&psmd->mesh_final->ldata, CD_MLOOPCOL); active_col = CustomData_get_active_layer(&psmd->mesh_final->ldata, CD_MLOOPCOL); + render_col = CustomData_get_render_layer(&psmd->mesh_final->ldata, CD_MLOOPCOL); } } @@ -897,7 +901,10 @@ static void particle_batch_cache_ensure_procedural_strand_data(PTCacheEdit *edit BLI_snprintf(cache->uv_layer_names[i][n++], MAX_LAYER_NAME_LEN, "a%u", hash); if (i == active_uv) { - BLI_strncpy(cache->uv_layer_names[i][n], "u", MAX_LAYER_NAME_LEN); + BLI_strncpy(cache->uv_layer_names[i][n++], "au", MAX_LAYER_NAME_LEN); + } + if (i == render_uv) { + BLI_strncpy(cache->uv_layer_names[i][n++], "u", MAX_LAYER_NAME_LEN); } } /* Vertex colors */ @@ -917,7 +924,10 @@ static void particle_batch_cache_ensure_procedural_strand_data(PTCacheEdit *edit } if (i == active_col) { - BLI_strncpy(cache->col_layer_names[i][n], "c", MAX_LAYER_NAME_LEN); + BLI_strncpy(cache->col_layer_names[i][n++], "ac", MAX_LAYER_NAME_LEN); + } + if (i == render_col) { + BLI_strncpy(cache->col_layer_names[i][n++], "c", MAX_LAYER_NAME_LEN); } } |