diff options
author | Brecht Van Lommel <brecht@blender.org> | 2022-11-09 22:30:41 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-11-09 22:37:55 +0300 |
commit | 7f6521f8dc95f175eb09c77c26f5a3eb3dc7a3c0 (patch) | |
tree | bcdd384f03c54c8ba8cd0441aca44f2097950d47 /source/blender/modifiers/intern/MOD_particleinstance.c | |
parent | 8232cf5287445d21b7d6effb3f0e1ffb6df09adf (diff) |
Fix T100883: crash with particle instancing and clumping
Properly initialize clump curve mapping tables for duplis and other cases
where this was missed by making a generic init/free function instead of
duplicating the same logic in multiple places. Also fold lattice deform
init into this.
Diffstat (limited to 'source/blender/modifiers/intern/MOD_particleinstance.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_particleinstance.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/source/blender/modifiers/intern/MOD_particleinstance.c b/source/blender/modifiers/intern/MOD_particleinstance.c index f65f8bc4fb3..46e14dd6bfb 100644 --- a/source/blender/modifiers/intern/MOD_particleinstance.c +++ b/source/blender/modifiers/intern/MOD_particleinstance.c @@ -303,7 +303,7 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * maxedge += totedge; } - psys->lattice_deform_data = psys_create_lattice_deform_data(&sim); + psys_sim_data_init(&sim); if (psys->flag & (PSYS_HAIR_DONE | PSYS_KEYED) || psys->pointcache->flag & PTCACHE_BAKED) { float min[3], max[3]; @@ -514,10 +514,7 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * p_skip++; } - if (psys->lattice_deform_data) { - BKE_lattice_deform_data_destroy(psys->lattice_deform_data); - psys->lattice_deform_data = NULL; - } + psys_sim_data_free(&sim); if (size) { MEM_freeN(size); |