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:
authorPhilipp Oeser <info@graphics-engineer.com>2020-04-02 12:28:03 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2020-04-06 13:19:02 +0300
commitcc0819aee119ad7a9dc9c383ec6895208ea1a184 (patch)
treed855e65e3a93076d8270e8d5de31eea2e7cdd45d /source/blender/draw/intern/draw_cache_impl_particles.c
parentccaf6c74044d30bc2de9db033a703319d79127a7 (diff)
Fix (unreported) wrong hair vertex colors
This was already fixed in rB985f33719ce9 once. But resurfaced after rB7070e4c15e6c [which just reverted a bit too much ;)]. Spotted while looking into T75263. Differential Revision: https://developer.blender.org/D7308
Diffstat (limited to 'source/blender/draw/intern/draw_cache_impl_particles.c')
-rw-r--r--source/blender/draw/intern/draw_cache_impl_particles.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_particles.c b/source/blender/draw/intern/draw_cache_impl_particles.c
index dca4f8e01e6..331a1f80bec 100644
--- a/source/blender/draw/intern/draw_cache_impl_particles.c
+++ b/source/blender/draw/intern/draw_cache_impl_particles.c
@@ -339,7 +339,8 @@ static void particle_calculate_parent_mcol(ParticleSystem *psys,
if (num != DMCACHE_NOTFOUND && num != DMCACHE_ISCHILD) {
MFace *mface = &psmd->mesh_final->mface[num];
for (int j = 0; j < num_col_layers; j++) {
- psys_interpolate_mcol(mcols[j] + num, mface->v4, particle->fuv, &r_mcol[j]);
+ /* CustomDataLayer CD_MCOL has 4 structs per face. */
+ psys_interpolate_mcol(mcols[j] + num * 4, mface->v4, particle->fuv, &r_mcol[j]);
}
}
}
@@ -388,6 +389,7 @@ static void particle_interpolate_children_mcol(ParticleSystem *psys,
if (num != DMCACHE_NOTFOUND) {
MFace *mface = &psmd->mesh_final->mface[num];
for (int j = 0; j < num_col_layers; j++) {
+ /* CustomDataLayer CD_MCOL has 4 structs per face. */
psys_interpolate_mcol(mcols[j] + num * 4, mface->v4, particle->fuv, &r_mcol[j]);
}
}