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:
authorBrecht Van Lommel <brecht@blender.org>2022-11-09 22:30:41 +0300
committerBrecht Van Lommel <brecht@blender.org>2022-11-09 22:37:55 +0300
commit7f6521f8dc95f175eb09c77c26f5a3eb3dc7a3c0 (patch)
treebcdd384f03c54c8ba8cd0441aca44f2097950d47 /source/blender/draw/intern/draw_cache_impl_particles.c
parent8232cf5287445d21b7d6effb3f0e1ffb6df09adf (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/draw/intern/draw_cache_impl_particles.c')
-rw-r--r--source/blender/draw/intern/draw_cache_impl_particles.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl_particles.c b/source/blender/draw/intern/draw_cache_impl_particles.c
index 8facea4333f..cddab74c46f 100644
--- a/source/blender/draw/intern/draw_cache_impl_particles.c
+++ b/source/blender/draw/intern/draw_cache_impl_particles.c
@@ -1346,7 +1346,7 @@ static void particle_batch_cache_ensure_pos(Object *object,
sim.ob = object;
sim.psys = psys;
sim.psmd = psys_get_modifier(object, psys);
- sim.psys->lattice_deform_data = psys_create_lattice_deform_data(&sim);
+ psys_sim_data_init(&sim);
GPU_VERTBUF_DISCARD_SAFE(point_cache->pos);
@@ -1392,6 +1392,8 @@ static void particle_batch_cache_ensure_pos(Object *object,
if (curr_point != psys->totpart) {
GPU_vertbuf_data_resize(point_cache->pos, curr_point);
}
+
+ psys_sim_data_free(&sim);
}
static void drw_particle_update_ptcache_edit(Object *object_eval,