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:
authorJoshua Leung <aligorith@gmail.com>2011-07-24 08:34:46 +0400
committerJoshua Leung <aligorith@gmail.com>2011-07-24 08:34:46 +0400
commit6a392e8cb505b753a0bac24e42778306007c45b8 (patch)
tree6d34591894fec168b8535fae88455ef8446f0a2a /source/blender/blenkernel/intern/particle_system.c
parentc22f26d2032b7116477e6a378407a10b6d7e3276 (diff)
== RNA Property Updates get called by Animation System now ==
This fixes bug #26764 and several others like it, where modifier properties (and others, but most visibly modifiers) would not do anything when animated or driven, as modifier properties require the RNA update calls to tag the modifiers to get recalculated. While just adding a call to RNA_property_update() could have gotten this working (as per the Campbell's patch attached in the report, and also my own attempt #25881). However, on production rigs, the performance cost of this is untenatable (on my own tests, without these updates, I was getting ~5fps on such a rig, but only 0.9fps or possibly even worse with the updates added). Hence, this commit adds a property-update caching system to the RNA level, which aims to reduce to the number of times that the update functions end up needing to get called. While this is much faster than without the caching, I also added an optimisation for pose bones (which are numerous in production rigs) so that their property updates are skipped, since they are useless to the animsys (they only tag the depsgraph for updating). This gets things moving at a more acceptable framerate.
Diffstat (limited to 'source/blender/blenkernel/intern/particle_system.c')
-rw-r--r--source/blender/blenkernel/intern/particle_system.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index 1423f520b95..f62ba2be193 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -1801,7 +1801,7 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime,
if(part->type!=PART_HAIR && dtime > 0.f && pa->time < cfra && pa->time >= sim->psys->cfra) {
/* we have to force RECALC_ANIM here since where_is_objec_time only does drivers */
while(ob) {
- BKE_animsys_evaluate_animdata(&ob->id, ob->adt, pa->time, ADT_RECALC_ANIM);
+ BKE_animsys_evaluate_animdata(sim->scene, &ob->id, ob->adt, pa->time, ADT_RECALC_ANIM);
ob = ob->parent;
}
ob = sim->ob;
@@ -4253,7 +4253,7 @@ void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys)
return;
/* execute drivers only, as animation has already been done */
- BKE_animsys_evaluate_animdata(&part->id, part->adt, cfra, ADT_RECALC_DRIVERS);
+ BKE_animsys_evaluate_animdata(scene, &part->id, part->adt, cfra, ADT_RECALC_DRIVERS);
if(psys->recalc & PSYS_RECALC_TYPE)
psys_changed_type(&sim);
@@ -4291,7 +4291,7 @@ void particle_system_update(Scene *scene, Object *ob, ParticleSystem *psys)
for(i=0; i<=part->hair_step; i++){
hcfra=100.0f*(float)i/(float)psys->part->hair_step;
if((part->flag & PART_HAIR_REGROW)==0)
- BKE_animsys_evaluate_animdata(&part->id, part->adt, hcfra, ADT_RECALC_ANIM);
+ BKE_animsys_evaluate_animdata(scene, &part->id, part->adt, hcfra, ADT_RECALC_ANIM);
system_step(&sim, hcfra);
psys->cfra = hcfra;
psys->recalc = 0;
@@ -4369,7 +4369,7 @@ 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) */
while(ob) {
- BKE_animsys_evaluate_animdata(&ob->id, ob->adt, cfra, ADT_RECALC_ANIM);
+ BKE_animsys_evaluate_animdata(scene, &ob->id, ob->adt, cfra, ADT_RECALC_ANIM);
ob = ob->parent;
}
ob = sim.ob;