Fix T51774: Children particles hair interpolation not correct with textures or dp.

Children where always getting at least one segment of fixed length...

Now fully hidden ones (zero length) get no segment at all.

Note that even very short ones keep getting one 'unit' length segment - would
rather avoid changing that at this point, given how complex children
particles 'length' can get with all kind of modifiers... Think we can
live with that for now anyway.
This commit is contained in:
Bastien Montagne 2017-06-18 23:54:52 +02:00
parent f158a206f2
commit 3190eaf109
Notes: blender-bot 2023-02-14 06:53:23 +01:00
Referenced by issue #51774, Children particles hair interpolation not correct with textures or dp
1 changed files with 6 additions and 2 deletions

View File

@ -355,9 +355,13 @@ void psys_apply_child_modifiers(ParticleThreadContext *ctx, struct ListBase *mod
{
const float step_length = 1.0f / (float)(totkeys - 1);
float cur_length = 0.0f;
if (max_length <= 0.0f) {
keys->segments = -1;
totkeys = 0;
}
/* we have to correct velocity because of kink & clump */
for (k = 0, key = keys; k < totkeys; ++k, ++key) {
if (k >= 2) {