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:
authorSergey Sharybin <sergey.vfx@gmail.com>2019-06-05 13:39:40 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2019-06-13 12:34:01 +0300
commit36faf739a71624b6ca10cec7233779f9eeace0bd (patch)
treead57fbc75b6bce4bdc590384a3fdf4eeb5fdbaf0 /source/blender/blenkernel/intern/particle_distribute.c
parent27537daee1b62aab0fb0d01b89b7d2c044e796cd (diff)
Particle system: Move runtime data to runtime field
Allows it to be preserved during copy-on-write update when on-geometry related update is needed. This is a required part for T63537, where we need to preserve the entire evaluation data when object is tagged for only RECALC_COPY_ON_WRITE. Reviewers: brecht Reviewed By: brecht Differential Revision: https://developer.blender.org/D5023
Diffstat (limited to 'source/blender/blenkernel/intern/particle_distribute.c')
-rw-r--r--source/blender/blenkernel/intern/particle_distribute.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/particle_distribute.c b/source/blender/blenkernel/intern/particle_distribute.c
index 070c3c7a566..7bb2daeab23 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 = sim->psmd->mesh_final;
+ Mesh *final_mesh = BKE_particle_modifier_mesh_final_get(sim->psmd);
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) {
- distribute_simple_children(
- scene, ob, final_mesh, sim->psmd->mesh_original, psys, use_render_params);
+ Mesh *mesh_original = BKE_particle_modifier_mesh_original_get(sim->psmd);
+ distribute_simple_children(scene, ob, final_mesh, 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 = sim->psmd->mesh_final;
+ Mesh *final_mesh = BKE_particle_modifier_mesh_final_get(sim->psmd);
int i, totpart, numtasks;
/* create a task pool for distribution tasks */
@@ -1346,7 +1346,8 @@ static void distribute_particles_on_dm(ParticleSimulationData *sim, int from)
BLI_task_pool_free(task_pool);
- psys_calc_dmcache(sim->ob, final_mesh, sim->psmd->mesh_original, sim->psys);
+ Mesh *mesh_original = BKE_particle_modifier_mesh_original_get(sim->psmd);
+ psys_calc_dmcache(sim->ob, final_mesh, mesh_original, sim->psys);
if (ctx.mesh != final_mesh) {
BKE_id_free(NULL, ctx.mesh);
@@ -1371,7 +1372,8 @@ void distribute_particles(ParticleSimulationData *sim, int from)
int distr_error = 0;
if (psmd) {
- if (psmd->mesh_final) {
+ Mesh *mesh_final = BKE_particle_modifier_mesh_final_get(psmd);
+ if (mesh_final) {
distribute_particles_on_dm(sim, from);
}
else {