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.
Details
Details
- Reviewers
Jacques Lucke (JacquesLucke) - Maniphest Tasks
- T84588: uv_on_emitter crash
- Commits
- rBf5c0ef52cf2f: Fix T84588: Cache access in rna_Particle_uv_on_emitter
Diff Detail
Diff Detail
- Repository
- rB Blender
- Branch
- 2021-01-11-uv-on-emitter (branched from master)
- Build Status
Buildable 12126 Build 12126: arc lint + arc unit
Event Timeline
Comment Actions
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.
Comment Actions
@Jacques Lucke (JacquesLucke) Do you mean in the typedef of ParticleData in DNA_particle_types.h?
Comment Actions
Thanks for the quick response. I was trying to make particles respect shader displacement.
Comment Actions
@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.