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:
Diffstat (limited to 'source/blender/blenkernel/intern/particle_system.c')
-rw-r--r--source/blender/blenkernel/intern/particle_system.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index 88fc8c6a440..8d6991ff9f4 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -4150,7 +4150,7 @@ void psys_check_boid_data(ParticleSystem *psys)
}
}
-static void fluid_default_settings(ParticleSettings *part)
+void BKE_particlesettings_fluid_default_settings(ParticleSettings *part)
{
SPHFluidSettings *fluid = part->fluid;
@@ -4182,24 +4182,12 @@ static void psys_prepare_physics(ParticleSimulationData *sim)
sim->psys->flag &= ~PSYS_KEYED;
}
- if (part->phystype == PART_PHYS_BOIDS && part->boids == NULL) {
- BoidState *state;
-
- part->boids = MEM_callocN(sizeof(BoidSettings), "Boid Settings");
- boid_default_settings(part->boids);
-
- state = boid_new_state(part->boids);
- BLI_addtail(&state->rules, boid_new_rule(eBoidRuleType_Separate));
- BLI_addtail(&state->rules, boid_new_rule(eBoidRuleType_Flock));
-
- ((BoidRule*)state->rules.first)->flag |= BOIDRULE_CURRENT;
-
- state->flag |= BOIDSTATE_CURRENT;
- BLI_addtail(&part->boids->states, state);
+ /* RNA Update must ensure this is true. */
+ if (part->phystype == PART_PHYS_BOIDS) {
+ BLI_assert(part->boids != NULL);
}
- else if (part->phystype == PART_PHYS_FLUID && part->fluid == NULL) {
- part->fluid = MEM_callocN(sizeof(SPHFluidSettings), "SPH Fluid Settings");
- fluid_default_settings(part);
+ else if (part->phystype == PART_PHYS_FLUID) {
+ BLI_assert(part->fluid != NULL);
}
psys_check_boid_data(sim->psys);
@@ -4229,6 +4217,18 @@ void particle_system_update(struct Depsgraph *depsgraph, Scene *scene, Object *o
if (!psys_check_enabled(ob, psys, use_render_params))
return;
+ if (DEG_is_active(depsgraph)) {
+ if (psys->orig_psys != NULL && psys->orig_psys->edit != NULL) {
+ psys_cache_edit_paths(
+ depsgraph,
+ (Scene *)DEG_get_original_id(&scene->id),
+ DEG_get_original_object(ob),
+ psys->orig_psys->edit,
+ DEG_get_ctime(depsgraph),
+ DEG_get_mode(depsgraph) == DAG_EVAL_RENDER);
+ }
+ }
+
cfra = DEG_get_ctime(depsgraph);
sim.depsgraph = depsgraph;