Page MenuHome

Handle cache correctly in rna_Particle_uv_on_emitter
ClosedPublic

Authored by Robert Guetzkow (rjg) on Jan 11 2021, 2:33 PM.

Details

Summary

This patch fixes T84588. The function rna_Particle_uv_on_emitter did not handle the case where particle->num_dmcache was DMCACHE_ISCHILD. This resulted in an incorrect offset for the mtface pointer. The patch checks for the case and sets the offset accordingly, similar to existing code in e.g. particle_calculate_parent_uvs.

Diff Detail

Repository
rB Blender
Branch
2021-01-11-uv-on-emitter (branched from master)
Build Status
Buildable 12097
Build 12097: arc lint + arc unit

Event Timeline

Robert Guetzkow (rjg) requested review of this revision.Jan 11 2021, 2:33 PM
Robert Guetzkow (rjg) created this revision.
Robert Guetzkow (rjg) edited the summary of this revision. (Show Details)Jan 11 2021, 2:34 PM
Robert Guetzkow (rjg) edited the summary of this revision. (Show Details)

Looks good, can you extend the comment of ParticleData.num_dmcache? It should say that DMCACHE_NOTFOUND and DMCACHE_ISCHILD are valid values as well.

This revision is now accepted and ready to land.Jan 11 2021, 3:15 PM

@Jacques Lucke (JacquesLucke) Do you mean in the typedef of ParticleData in DNA_particle_types.h?

@Jacques Lucke (JacquesLucke) Do you mean in the typedef of ParticleData in DNA_particle_types.h?

yes

Thanks for the quick response. I was trying to make particles respect shader displacement.

  • Add comment that num_dmcache can also be negative

@Jacques Lucke (JacquesLucke) If you have a improvement suggestions for the comment, e.g. explaining what DMCACHE_NOTFOUND and DMCACHE_ISCHILD mean, then please let me know. This is just the bare minimum because I wanted to avoid stating anything technically inaccurate that would cause more confusion than it helps.