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:
authorJacques Lucke <jacques@blender.org>2020-07-09 16:40:27 +0300
committerJacques Lucke <jacques@blender.org>2020-07-09 16:40:27 +0300
commit580d50091cfb0467cbde165058a6e78ef4898045 (patch)
treef123808f3397df3a273f991e9e3239e603d68ce0 /source/blender/blenkernel/intern/pointcache.c
parent31ad43a3c7dde771cb6d92b6d20bf7b2e3f2bed6 (diff)
Particles: Create a simulation state for every Particle Simulation node
Every Particle Simulation node has a name (or a path when it is in a node group). This name has to be used in the Simulation modifier on a point cloud to see the particles. Caching has been disabled for now, because it was holding back development a bit. To reset the simulation, go back to frame 1. Currently, there is no way to influence the simulation. There are just some randomly moving points. Changing that is the next step.
Diffstat (limited to 'source/blender/blenkernel/intern/pointcache.c')
-rw-r--r--source/blender/blenkernel/intern/pointcache.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index dbd6d99c7fe..ce5402551b6 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -1898,19 +1898,13 @@ static void ptcache_sim_particle_read(
PTCACHE_DATA_TO(data, BPHYS_DATA_LOCATION, 0, positions + (index * 3));
}
-void BKE_ptcache_id_from_sim_particles(PTCacheID *pid, ParticleSimulationState *state)
+void BKE_ptcache_id_from_sim_particles(PTCacheID *pid,
+ ParticleSimulationState *state_orig,
+ ParticleSimulationState *state_cow)
{
memset(pid, 0, sizeof(PTCacheID));
- ParticleSimulationState *state_orig;
- if (state->head.orig_state != NULL) {
- state_orig = (ParticleSimulationState *)state->head.orig_state;
- }
- else {
- state_orig = state;
- }
-
- pid->calldata = state;
+ pid->calldata = state_cow;
pid->type = PTCACHE_TYPE_SIM_PARTICLES;
pid->cache = state_orig->point_cache;
pid->cache_ptr = &state_orig->point_cache;
@@ -2050,11 +2044,7 @@ static bool foreach_object_modifier_ptcache(Object *object,
LISTBASE_FOREACH (SimulationState *, state, &smd->simulation->states) {
switch ((eSimulationStateType)state->type) {
case SIM_STATE_TYPE_PARTICLES: {
- ParticleSimulationState *particle_state = (ParticleSimulationState *)state;
- BKE_ptcache_id_from_sim_particles(&pid, particle_state);
- if (!callback(&pid, callback_user_data)) {
- return false;
- }
+ /* TODO(jacques) */
break;
}
}