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/editors/include/ED_keyframing.h | |
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/editors/include/ED_keyframing.h')
-rw-r--r-- | source/blender/editors/include/ED_keyframing.h | 82 |
1 files changed, 67 insertions, 15 deletions
diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h index 98a44d3ef2b..fbb469f8d43 100644 --- a/source/blender/editors/include/ED_keyframing.h +++ b/source/blender/editors/include/ED_keyframing.h @@ -33,13 +33,30 @@ struct ID; struct KeyingSet; +struct bAction; struct FCurve; struct BezTriple; +struct bPoseChannel; +struct bConstraint; + +struct bContext; struct wmOperatorType; /* ************ Keyframing Management **************** */ +/* Get (or add relevant data to be able to do so) the Active Action for the given + * Animation Data block, given an ID block where the Animation Data should reside. + */ +struct bAction *verify_adt_action(struct ID *id, short add); + +/* Get (or add relevant data to be able to do so) F-Curve from the given Action. + * This assumes that all the destinations are valid. + */ +struct FCurve *verify_fcurve(struct bAction *act, const char group[], const char rna_path[], const int array_index, short add); + +/* -------- */ + /* Lesser Keyframing API call: * Use this when validation of necessary animation data isn't necessary as it already * exists, and there is a beztriple that can be directly copied into the array. @@ -58,26 +75,14 @@ void insert_vert_fcurve(struct FCurve *fcu, float x, float y, short flag); * Use this to create any necessary animation data, and then insert a keyframe * using the current value being keyframed, in the relevant place. Returns success. */ -short insertkey(struct ID *id, const char group[], const char rna_path[], int array_index, float cfra, short flag); +short insert_keyframe(struct ID *id, struct bAction *act, const char group[], const char rna_path[], int array_index, float cfra, short flag); /* Main Keyframing API call: * Use this to delete keyframe on current frame for relevant channel. Will perform checks just in case. */ -short deletekey(struct ID *id, const char group[], const char rna_path[], int array_index, float cfra, short flag); - - -/* Generate menu of KeyingSets */ -char *ANIM_build_keyingsets_menu(struct ListBase *list, short for_edit); - -/* Initialise builtin KeyingSets on startup */ -void init_builtin_keyingsets(void); +short delete_keyframe(struct ID *id, struct bAction *act, const char group[], const char rna_path[], int array_index, float cfra, short flag); -/* KeyingSet Editing Operators: - * These can add a new KeyingSet and/or add 'destinations' to the KeyingSets, - * acting as a means by which they can be added outside the Outliner. - */ -void ANIM_OT_keyingset_add_new(struct wmOperatorType *ot); -void ANIM_OT_keyingset_add_destination(struct wmOperatorType *ot); +/* -------- */ /* Main Keyframe Management operators: * These handle keyframes management from various spaces. They only make use of @@ -98,6 +103,53 @@ void ANIM_OT_delete_keyframe_old(struct wmOperatorType *ot); // xxx rename and k void ANIM_OT_insert_keyframe_button(struct wmOperatorType *ot); void ANIM_OT_delete_keyframe_button(struct wmOperatorType *ot); +/* ************ Keying Sets ********************** */ + +/* temporary struct to gather data combos to keyframe + * (is used by modify_keyframes for 'relative' KeyingSets, provided via the dsources arg) + */ +typedef struct bCommonKeySrc { + struct bCommonKeySrc *next, *prev; + + /* general data/destination-source settings */ + struct ID *id; /* id-block this comes from */ + + /* specific cases */ + struct bPoseChannel *pchan; + struct bConstraint *con; +} bCommonKeySrc; + +/* -------- */ + +/* mode for modify_keyframes */ +enum { + MODIFYKEY_MODE_INSERT = 0, + MODIFYKEY_MODE_DELETE, +} eModifyKey_Modes; + +/* Keyframing Helper Call - use the provided Keying Set to Add/Remove Keyframes */ +int modify_keyframes(struct bContext *C, struct ListBase *dsources, struct bAction *act, struct KeyingSet *ks, short mode, float cfra); + +/* -------- */ + +/* Generate menu of KeyingSets */ +char *ANIM_build_keyingsets_menu(struct ListBase *list, short for_edit); + +/* Get the first builtin KeyingSet with the given name, which occurs after the given one (or start of list if none given) */ +struct KeyingSet *ANIM_builtin_keyingset_get_named(struct KeyingSet *prevKS, char name[]); + +/* Initialise builtin KeyingSets on startup */ +void init_builtin_keyingsets(void); + +/* -------- */ + +/* KeyingSet Editing Operators: + * These can add a new KeyingSet and/or add 'destinations' to the KeyingSets, + * acting as a means by which they can be added outside the Outliner. + */ +void ANIM_OT_keyingset_add_new(struct wmOperatorType *ot); +void ANIM_OT_keyingset_add_destination(struct wmOperatorType *ot); + /* ************ Drivers ********************** */ /* Main Driver Management API calls: |