[Bf-blender-cvs] [9529a96fd0] fracture_modifier: fix attempt for disappearing fm debris particles after baking

Martin Felke noreply at git.blender.org
Sun Jan 29 19:09:09 CET 2017


Commit: 9529a96fd0eda76c2463d9b240d21bb2ce5e1d8e
Author: Martin Felke
Date:   Sun Jan 29 19:08:38 2017 +0100
Branches: fracture_modifier
https://developer.blender.org/rB9529a96fd0eda76c2463d9b240d21bb2ce5e1d8e

fix attempt for disappearing fm debris particles after baking

===================================================================

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 e882391569..8e9bd1d701 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -3882,7 +3882,7 @@ static void system_step(ParticleSimulationData *sim, float cfra, const bool use_
 	PTCacheID ptcacheid, *pid = NULL;
 	PARTICLE_P;
 	float disp, cache_cfra = cfra; /*, *vg_vel= 0, *vg_tan= 0, *vg_rot= 0, *vg_size= 0; */
-	int startframe = 0, endframe = 100, oldtotpart = 0, emitcount = 0;
+	int startframe = 0, endframe = 100, oldtotpart = 0, emitcount = 0, cache_check = 0;
 
 	/* cache shouldn't be used for hair or "continue physics" */
 	if (part->type != PART_HAIR) {
@@ -3910,7 +3910,12 @@ static void system_step(ParticleSimulationData *sim, float cfra, const bool use_
 /* 1. emit particles and redo particles if needed */
 	oldtotpart = psys->totpart;
 	emitcount = emit_particles(sim, pid, cfra, part);
-	if (emitcount || psys->recalc & PSYS_RECALC_RESET) {
+	if (pid) {
+		cache_check = BKE_ptcache_read(pid, cache_cfra, true);
+	}
+	if ((emitcount && !ELEM(cache_check, PTCACHE_READ_EXACT, PTCACHE_READ_INTERPOLATED)) ||
+	    psys->recalc & PSYS_RECALC_RESET)
+	{
 		if (distribute_particles(sim, part->from) || part->distr == PART_DISTR_GRID) {
 			initialize_all_particles(sim);
 			/* reset only just created particles (on startframe all particles are recreated) */




More information about the Bf-blender-cvs mailing list