[Bf-blender-cvs] [cc0819aee11] master: Fix (unreported) wrong hair vertex colors
Philipp Oeser
noreply at git.blender.org
Mon Apr 6 12:29:22 CEST 2020
Commit: cc0819aee119ad7a9dc9c383ec6895208ea1a184
Author: Philipp Oeser
Date: Thu Apr 2 11:28:03 2020 +0200
Branches: master
https://developer.blender.org/rBcc0819aee119ad7a9dc9c383ec6895208ea1a184
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
===================================================================
M source/blender/draw/intern/draw_cache_impl_particles.c
===================================================================
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]);
}
}
More information about the Bf-blender-cvs
mailing list