[Bf-blender-cvs] [cb1777d] blender-v2.75-release: Fix T45253: Particle emitter volume mode and grid mode broken in 2.75.x
Sergey Sharybin
noreply at git.blender.org
Wed Jul 1 10:34:45 CEST 2015
Commit: cb1777d3b6b37670c3522791d7b36c58029cf58d
Author: Sergey Sharybin
Date: Wed Jul 1 10:32:30 2015 +0200
Branches: blender-v2.75-release
https://developer.blender.org/rBcb1777d3b6b37670c3522791d7b36c58029cf58d
Fix T45253: Particle emitter volume mode and grid mode broken in 2.75.x
This is a regression since dced56f and root of the issue comes to the fact
that grid distribution sets UNEXIST flag during distribution, which is then
being reset in initialize_all_particles().
This commit solves the issue, but it's not really nice and some smart guy
might want to revisit it.
===================================================================
M source/blender/blenkernel/intern/particle_system.c
===================================================================
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index 3a19ca7..1495e91 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -558,10 +558,24 @@ void initialize_particle(ParticleSimulationData *sim, ParticleData *pa)
static void initialize_all_particles(ParticleSimulationData *sim)
{
ParticleSystem *psys = sim->psys;
+ ParticleSettings *part = psys->part;
+ /* Grid distributionsets UNEXIST flag, need to take care of
+ * it here because later this flag is being reset.
+ *
+ * We can't do it for any distribution, because it'll then
+ * conflict with texture influence, which does not free
+ * unexisting particles and only sets flag.
+ *
+ * It's not so bad, because only grid distribution sets
+ * UNEXIST flag.
+ */
+ const bool emit_from_volume_grid = (part->distr == PART_DISTR_GRID) &&
+ (!ELEM(part->from, PART_FROM_VERT, PART_FROM_CHILD));
PARTICLE_P;
-
LOOP_PARTICLES {
- initialize_particle(sim, pa);
+ if (!(emit_from_volume_grid && (pa->flag & PARS_UNEXIST) != 0)) {
+ initialize_particle(sim, pa);
+ }
}
}
More information about the Bf-blender-cvs
mailing list