4
$\begingroup$

I wonder if there is possibility to get uv_on_emitter for all particles including child particles? My loop over particles look like this:

for pindex in range(0, num_parents + num_children): 
    p_uv = partSystem.uv_on_emitter(mod, partSystem.particles[pindex])

When there are children enabled I got index out of range because partSystem.particles returns only parents, not the children.

$\endgroup$
2
  • 1
    $\begingroup$ children are in particle_systems['ParticleSystem'].child_particles.items()[x][1] which is a ChildParticle not sure where their location is. $\endgroup$ – sambler Aug 6 '15 at 14:29
  • $\begingroup$ The problem is that ChildParticle won't help me much as uv_on_emitter is expecting Particle type. $\endgroup$ – Grzegorz Rakoczy Aug 7 '15 at 8:18
1
$\begingroup$

Heres what you do:

if pindex >= num_parents:
   particle = psys.particles[(pindex - num_parents) % num_parents]
else:
   particle = psys.particles[pindex]
st = psys.uv_on_emitter(psys_modifier, particle, pindex)
$\endgroup$
1
  • 1
    $\begingroup$ interesting, but could you please elaborate by editing your answer what and why you do here? $\endgroup$ – aliasguru Sep 30 '16 at 5:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.