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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2012-03-19 22:14:24 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-03-19 22:14:24 +0400
commitd7b072f450d122f31d28d1fc0aa216da8dee38fc (patch)
treeb90cba58f72352e3e5d5b13ec5edc1a61d6444e6
parent8e0493b290edd7a5b4dca4b84a4e13be9c021e6b (diff)
Fix #30456: transforming object with a hair particle system, on a frame after
the cache end frame would reset to the previous state on confirm. Was an issue with object animation being evaluated unnecessarily, now make check more precise.
-rw-r--r--source/blender/blenkernel/intern/particle_system.c11
-rw-r--r--source/blender/makesdna/DNA_particle_types.h3
2 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index c3e7e4531b9..50c960d6c56 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -1814,6 +1814,8 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime,
}
ob = sim->ob;
where_is_object_time(sim->scene, ob, pa->time);
+
+ psys->flag |= PSYS_OB_ANIM_RESTORE;
}
psys_get_birth_coordinates(sim, pa, &pa->state, dtime, cfra);
@@ -4438,6 +4440,9 @@ void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys)
/* execute drivers only, as animation has already been done */
BKE_animsys_evaluate_animdata(scene, &part->id, part->adt, cfra, ADT_RECALC_DRIVERS);
+ /* to verify if we need to restore object afterwards */
+ psys->flag &= ~PSYS_OB_ANIM_RESTORE;
+
if(psys->recalc & PSYS_RECALC_TYPE)
psys_changed_type(&sim);
@@ -4550,14 +4555,16 @@ void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys)
}
}
- if(psys->cfra < cfra) {
- /* make sure emitter is left at correct time (particle emission can change this) */
+ /* make sure emitter is left at correct time (particle emission can change this) */
+ if(psys->flag & PSYS_OB_ANIM_RESTORE) {
while(ob) {
BKE_animsys_evaluate_animdata(scene, &ob->id, ob->adt, cfra, ADT_RECALC_ANIM);
ob = ob->parent;
}
ob = sim.ob;
where_is_object_time(scene, ob, cfra);
+
+ psys->flag &= ~PSYS_OB_ANIM_RESTORE;
}
psys->cfra = cfra;
diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h
index 5bb4d1009e9..547a91e7852 100644
--- a/source/blender/makesdna/DNA_particle_types.h
+++ b/source/blender/makesdna/DNA_particle_types.h
@@ -498,7 +498,8 @@ typedef struct ParticleSystem
#define PSYS_KEYED 1024
#define PSYS_EDITED 2048
//#define PSYS_PROTECT_CACHE 4096 /* deprecated */
-#define PSYS_DISABLED 8192
+#define PSYS_DISABLED 8192
+#define PSYS_OB_ANIM_RESTORE 16384 /* runtime flag */
/* pars->flag */
#define PARS_UNEXIST 1