diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-04-15 05:10:36 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-04-15 05:10:36 +0400 |
commit | 2dbf73f6a032ab44539cfd8c05f5743fbaf33902 (patch) | |
tree | 2a3093dfa8b561213db1c58bf2583cb05f6b2ed5 /source/blender/blenkernel/intern | |
parent | 5b3d7bfdf6305e880f89d58cbe852a8d2ba7b241 (diff) |
2.5 PoseLib - First steps to get PoseLib to work in 2.5
* Cleaned up Keyframing API to get eliminate some of the problems faced during the original implementation of PoseLib, thus reducing code redundancy.
* Added new Animato evaluation functions specifically for use by PoseLib.
* Replaced parts of PoseLib code which relied on old animation system to the equivalent code for Animato. Notice the much cleaner + saner + compact code!
Next step is to operatorfy the PoseLib tools (while maintaining possibility for an API to some things) :)
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/anim_sys.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index ebced7837ae..c8b2ff71612 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -504,8 +504,29 @@ static void animsys_evaluate_drivers (PointerRNA *ptr, AnimData *adt, float ctim /* ***************************************** */ /* Actions Evaluation */ +/* Evaluate Action Group */ +void animsys_evaluate_action_group (PointerRNA *ptr, bAction *act, bActionGroup *agrp, AnimMapper *remap, float ctime) +{ + FCurve *fcu; + + /* check if mapper is appropriate for use here (we set to NULL if it's inappropriate) */ + if ELEM(NULL, act, agrp) return; + if ((remap) && (remap->target != act)) remap= NULL; + + /* calculate then execute each curve */ + for (fcu= agrp->channels.first; (fcu) && (fcu->grp == agrp); fcu= fcu->next) + { + /* check if this curve should be skipped */ + if ((fcu->flag & (FCURVE_MUTED|FCURVE_DISABLED)) == 0) + { + calculate_fcurve(fcu, ctime); + animsys_execute_fcurve(ptr, remap, fcu); + } + } +} + /* Evaluate Action (F-Curve Bag) */ -static void animsys_evaluate_action (PointerRNA *ptr, bAction *act, AnimMapper *remap, float ctime) +void animsys_evaluate_action (PointerRNA *ptr, bAction *act, AnimMapper *remap, float ctime) { /* check if mapper is appropriate for use here (we set to NULL if it's inappropriate) */ if (act == NULL) return; @@ -863,7 +884,10 @@ void BKE_animsys_evaluate_all_animation (Main *main, float ctime) // TODO... /* objects */ - EVAL_ANIM_IDS(main->object.first, ADT_RECALC_ANIM); + /* ADT_RECALC_ANIM doesn't need to be supplied here, since object AnimData gets + * this tagged by Depsgraph on framechange + */ + EVAL_ANIM_IDS(main->object.first, /*ADT_RECALC_ANIM*/0); /* worlds */ EVAL_ANIM_IDS(main->world.first, ADT_RECALC_ANIM); |