diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-06-21 12:49:43 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-06-21 13:09:45 +0300 |
commit | 7070e4c15e6c57da2bd46534e654ed5f9a1e6600 (patch) | |
tree | 221ceb5195fd6d98d4485db40e78d16a379107c5 /source/blender/blenkernel/intern/particle_distribute.c | |
parent | 964e319a39abfe3808fded71dcacd296401ec04d (diff) |
Revert "Particle system: Move runtime data to runtime field"
This reverts commit 36faf739a71624b6ca10cec7233779f9eeace0bd.
Somewhat annoying but this change had some unforeseen consequences,
which lead to an actual bug.
Since this change was not sufficient to get original report fixed
is easier to simply revert for now.
Fixes T65842: Hair disappears when clicking on particle system name
Diffstat (limited to 'source/blender/blenkernel/intern/particle_distribute.c')
-rw-r--r-- | source/blender/blenkernel/intern/particle_distribute.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/particle_distribute.c b/source/blender/blenkernel/intern/particle_distribute.c index 7bb2daeab23..070c3c7a566 100644 --- a/source/blender/blenkernel/intern/particle_distribute.c +++ b/source/blender/blenkernel/intern/particle_distribute.c @@ -878,7 +878,7 @@ static int psys_thread_context_init_distribute(ParticleThreadContext *ctx, int from) { Scene *scene = sim->scene; - Mesh *final_mesh = BKE_particle_modifier_mesh_final_get(sim->psmd); + Mesh *final_mesh = sim->psmd->mesh_final; Object *ob = sim->ob; ParticleSystem *psys = sim->psys; ParticleData *pa = 0, *tpars = 0; @@ -926,8 +926,8 @@ static int psys_thread_context_init_distribute(ParticleThreadContext *ctx, if (from == PART_FROM_CHILD) { /* Simple children */ if (part->childtype != PART_CHILD_FACES) { - Mesh *mesh_original = BKE_particle_modifier_mesh_original_get(sim->psmd); - distribute_simple_children(scene, ob, final_mesh, mesh_original, psys, use_render_params); + distribute_simple_children( + scene, ob, final_mesh, sim->psmd->mesh_original, psys, use_render_params); return 0; } } @@ -1318,7 +1318,7 @@ static void distribute_particles_on_dm(ParticleSimulationData *sim, int from) TaskPool *task_pool; ParticleThreadContext ctx; ParticleTask *tasks; - Mesh *final_mesh = BKE_particle_modifier_mesh_final_get(sim->psmd); + Mesh *final_mesh = sim->psmd->mesh_final; int i, totpart, numtasks; /* create a task pool for distribution tasks */ @@ -1346,8 +1346,7 @@ static void distribute_particles_on_dm(ParticleSimulationData *sim, int from) BLI_task_pool_free(task_pool); - Mesh *mesh_original = BKE_particle_modifier_mesh_original_get(sim->psmd); - psys_calc_dmcache(sim->ob, final_mesh, mesh_original, sim->psys); + psys_calc_dmcache(sim->ob, final_mesh, sim->psmd->mesh_original, sim->psys); if (ctx.mesh != final_mesh) { BKE_id_free(NULL, ctx.mesh); @@ -1372,8 +1371,7 @@ void distribute_particles(ParticleSimulationData *sim, int from) int distr_error = 0; if (psmd) { - Mesh *mesh_final = BKE_particle_modifier_mesh_final_get(psmd); - if (mesh_final) { + if (psmd->mesh_final) { distribute_particles_on_dm(sim, from); } else { |