Changeset View
Changeset View
Standalone View
Standalone View
source/blender/modifiers/intern/MOD_particleinstance.c
| Show First 20 Lines • Show All 505 Lines • ▼ Show 20 Lines | for (k = 0; k < totpoly; k++) { | ||||
| DM_copy_loop_data(dm, result, inMP->loopstart, mp->loopstart, j); | DM_copy_loop_data(dm, result, inMP->loopstart, mp->loopstart, j); | ||||
| for (; j; j--, ml++, inML++) { | for (; j; j--, ml++, inML++) { | ||||
| ml->v = inML->v + (p_skip * totvert); | ml->v = inML->v + (p_skip * totvert); | ||||
| ml->e = inML->e + (p_skip * totedge); | ml->e = inML->e + (p_skip * totedge); | ||||
| const int ml_index = (ml - mloop); | const int ml_index = (ml - mloop); | ||||
| if (mloopcols_index != NULL) { | if (mloopcols_index != NULL) { | ||||
| const int part_index = vert_part_index[ml->v]; | 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) { | if (mloopcols_value != NULL) { | ||||
| const float part_value = vert_part_value[ml->v]; | const float part_value = vert_part_value[ml->v]; | ||||
| store_float_in_vcol(&mloopcols_value[ml_index], part_value); | store_float_in_vcol(&mloopcols_value[ml_index], part_value); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 47 Lines • Show Last 20 Lines | |||||