Fix T57994: Particle Instance modifiers 'Index Layer' off by one

better have this vertex color layer cover the whole 0-1 range

thx @sergey for checking

Maniphest Tasks: T57994

Differential Revision: https://developer.blender.org/D3976
This commit is contained in:
Philipp Oeser 2018-11-22 11:52:38 +01:00
parent 3b1f90ed84
commit 0eb61c799d
Notes: blender-bot 2023-02-14 04:58:54 +01:00
Referenced by issue #57994, Non-expected values in vertex color layer for vertex index (Particle Instance modifier)
1 changed files with 1 additions and 1 deletions

View File

@ -511,7 +511,7 @@ static DerivedMesh *applyModifier(
const int ml_index = (ml - mloop);
if (mloopcols_index != NULL) {
const int part_index = vert_part_index[ml->v];
store_float_in_vcol(&mloopcols_index[ml_index], (float)part_index / psys->totpart);
store_float_in_vcol(&mloopcols_index[ml_index], (float)part_index / (float)(psys->totpart-1));
}
if (mloopcols_value != NULL) {
const float part_value = vert_part_value[ml->v];