Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2019-08-12 12:44:44 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2019-08-12 12:47:08 +0300
commit35a9a85b27087f253100e7c66e8878a3ab015449 (patch)
tree9610a41ac7e01a917d246d21c933847d126a13d0
parent2b5575cc35403f8fae904b86e7a2dc9d7e243bcf (diff)
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...
-rw-r--r--source/blender/makesrna/intern/rna_particle.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c
index 4c50e0c19ae..86ce0ade96b 100644
--- a/source/blender/makesrna/intern/rna_particle.c
+++ b/source/blender/makesrna/intern/rna_particle.c
@@ -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) {