[Bf-blender-cvs] [0d2b977c3b1] master: Particles: Fixes for synchronization to original

Sergey Sharybin noreply at git.blender.org
Thu Jan 31 15:42:54 CET 2019


Commit: 0d2b977c3b1d0c382a9ba09bead5289d387bda33
Author: Sergey Sharybin
Date:   Thu Jan 31 14:57:58 2019 +0100
Branches: master
https://developer.blender.org/rB0d2b977c3b1d0c382a9ba09bead5289d387bda33

Particles: Fixes for synchronization to original

Was missing synchronization of current frame to the original one,
which is one of the issues why point cache does not properly reset
on edits.

Also clear recalc flag on original particle system.

Ideally we need to get rid of recalc on a particle system, since
that is not really covered by tagging system of dependency graph.

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

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 9d04960e77d..458aec77379 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -4365,6 +4365,9 @@ void particle_system_update(struct Depsgraph *depsgraph, Scene *scene, Object *o
 		psys_orig->edit->flags |= PT_CACHE_EDIT_UPDATE_PARTICLE_FROM_EVAL;
 	}
 
+	psys->cfra = cfra;
+	psys->recalc = 0;
+
 	if (DEG_is_active(depsgraph)) {
 		if (psys_orig != psys) {
 			if (psys_orig->edit != NULL &&
@@ -4374,12 +4377,11 @@ void particle_system_update(struct Depsgraph *depsgraph, Scene *scene, Object *o
 				psys_orig->edit->psmd_eval = psmd;
 			}
 			psys_orig->flag = (psys->flag & ~PSYS_SHARED_CACHES);
+			psys_orig->cfra = psys->cfra;
+			psys_orig->recalc = psys->recalc;
 		}
 	}
 
-	psys->cfra = cfra;
-	psys->recalc = 0;
-
 	/* save matrix for duplicators, at rendertime the actual dupliobject's matrix is used so don't update! */
 	invert_m4_m4(psys->imat, ob->obmat);



More information about the Bf-blender-cvs mailing list