From fc11700628b56d77cfd57c35c04e07e00d46b10e Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 11 Sep 2009 00:49:54 +0000 Subject: [PATCH] 2.5 - Bugfix for curve-following animation not working Optimisation for not working with AnimData when there were no actions meant that the special hack to set this value didn't get set. --- source/blender/blenkernel/intern/anim_sys.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 0e8450025da..2d6a97c48ae 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -1450,7 +1450,6 @@ void BKE_animsys_evaluate_animdata (ID *id, AnimData *adt, float ctime, short re * 'local' (i.e. belonging in the nearest ID-block that setting is related to, not a * standard 'root') block are overridden by a larger 'user' */ -// FIXME?: we currently go over entire 'main' database... void BKE_animsys_evaluate_all_animation (Main *main, float ctime) { ID *id; @@ -1474,8 +1473,11 @@ void BKE_animsys_evaluate_all_animation (Main *main, float ctime) * when there are no actions, don't go over database and loop over heaps of datablocks, * which should ultimately be empty, since it is not possible for now to have any animation * without some actions, and drivers wouldn't get affected by any state changes + * + * however, if there are some curves, we will need to make sure that their 'ctime' property gets + * set correctly, so this optimisation must be skipped in that case... */ - if (main->action.first == NULL) { + if ((main->action.first == NULL) && (main->curve.first == NULL)) { if (G.f & G_DEBUG) printf("\tNo Actions, so no animation needs to be evaluated...\n"); @@ -1509,6 +1511,7 @@ void BKE_animsys_evaluate_all_animation (Main *main, float ctime) * value of the curve gets set in case there's no animation for that * - it needs to be set before animation is evaluated just so that * animation can successfully override... + * - it shouldn't get set when calculating drivers... */ for (id= main->curve.first; id; id= id->next) { AnimData *adt= BKE_animdata_from_id(id);