Fix T68542: ParticleSystem.uv_on_emitter returns always 0,0 while Particle.uv_on_emitter returns a value.

'cached' particles (for paths actually) are only generated for some kind
(hair, keyed, and baked system afaik), not for all.

Note that we could probably just use directly `totpart` and `totchild`,
but keeping code as close to what it was as possible, for now...
This commit is contained in:
Bastien Montagne 2019-08-12 11:44:44 +02:00
parent 2b5575cc35
commit 35a9a85b27
Notes: blender-bot 2023-02-14 09:43:37 +01:00
Referenced by issue #68542, Keyboard "A" to deselect all vertices only works inconsistently
Referenced by issue #68442, ParticleSystem.uv_on_emitter returns always 0,0 while Particle.uv_on_emitter returns a value
1 changed files with 4 additions and 2 deletions

View File

@ -449,8 +449,10 @@ static int rna_ParticleSystem_tessfaceidx_on_emitter(ParticleSystem *particlesys
}
part = particlesystem->part;
totpart = particlesystem->totcached;
totchild = particlesystem->totchildcache;
/* Note: only hair, keyed and baked particles may have cached items... */
totpart = particlesystem->totcached != 0 ? particlesystem->totcached : particlesystem->totpart;
totchild = particlesystem->totchildcache != 0 ? particlesystem->totchildcache :
particlesystem->totchild;
/* can happen for disconnected/global hair */
if (part->type == PART_HAIR && !particlesystem->childcache) {