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-06-30 17:56:47 +0400
committerJoshua Leung <aligorith@gmail.com>2011-06-30 17:56:47 +0400
commita6270b0204b2a9424eaa51d475aa761d77f43a69 (patch)
tree92467389c658f50240228583f4d708a68467a243 /source/blender/editors/include
parent2a85eff40cba602cb07aeb43c1af672ce2945bbb (diff)
Animation Channels Filtering Refactor - Part 5
Channels can now be used as "animation containers" to be filtered further to obtain a set of subsidiary channels (i.e. F-Curves associated with some summary channel). The main use of this is that object and scene summary channels can now be defined without defining the filtering logic in three different places - once for channel filtering, once for drawing keyframes in action editor, and once for editing these keyframes. An indirect consequence of this, is that the "Only selected channels" option in Timeline will now result in only the keyframes for a selected bones getting shown (when enabled), instead of all keyframes for the active object. This was requested by Lee during Durian, and is something which has only become possible as a result of this commit.
Diffstat (limited to 'source/blender/editors/include')
-rw-r--r--source/blender/editors/include/ED_anim_api.h10
-rw-r--r--source/blender/editors/include/ED_keyframes_edit.h5
2 files changed, 9 insertions, 6 deletions
diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h
index c149102a6a7..8454f058238 100644
--- a/source/blender/editors/include/ED_anim_api.h
+++ b/source/blender/editors/include/ED_anim_api.h
@@ -77,6 +77,8 @@ typedef struct bAnimContext {
struct SpaceLink *sl; /* editor data */
struct ARegion *ar; /* region within editor */
+ struct bDopeSheet *ads; /* dopesheet data for editor (or which is being used) */
+
struct Scene *scene; /* active scene */
struct Object *obact; /* active object */
ListBase *markers; /* active set of markers */
@@ -85,7 +87,6 @@ typedef struct bAnimContext {
} bAnimContext;
/* Main Data container types */
-// XXX was ACTCONT_*
typedef enum eAnimCont_Types {
ANIMCONT_NONE = 0, /* invalid or no data */
ANIMCONT_ACTION, /* action (bAction) */
@@ -94,7 +95,8 @@ typedef enum eAnimCont_Types {
ANIMCONT_DOPESHEET, /* dopesheet (bDopesheet) */
ANIMCONT_FCURVES, /* animation F-Curves (bDopesheet) */
ANIMCONT_DRIVERS, /* drivers (bDopesheet) */
- ANIMCONT_NLA /* nla (bDopesheet) */
+ ANIMCONT_NLA, /* nla (bDopesheet) */
+ ANIMCONT_CHANNEL /* animation channel (bAnimListElem) */
} eAnimCont_Types;
/* --------------- Channels -------------------- */
@@ -256,8 +258,8 @@ typedef enum eAnimFilter_Flags {
/* Action Channel Group */
#define EDITABLE_AGRP(agrp) ((agrp->flag & AGRP_PROTECTED)==0)
#define EXPANDED_AGRP(ac, agrp) \
- ( ( ((ac)->spacetype == SPACE_IPO) && (agrp->flag & AGRP_EXPANDED_G) ) || \
- ( ((ac)->spacetype != SPACE_IPO) && (agrp->flag & AGRP_EXPANDED) ) )
+ ( ((!(ac) || ((ac)->spacetype != SPACE_IPO)) && (agrp->flag & AGRP_EXPANDED)) || \
+ (( (ac) && ((ac)->spacetype == SPACE_IPO)) && (agrp->flag & AGRP_EXPANDED_G)) )
#define SEL_AGRP(agrp) ((agrp->flag & AGRP_SELECTED) || (agrp->flag & AGRP_ACTIVE))
/* F-Curve Channels */
#define EDITABLE_FCU(fcu) ((fcu->flag & FCURVE_PROTECTED)==0)
diff --git a/source/blender/editors/include/ED_keyframes_edit.h b/source/blender/editors/include/ED_keyframes_edit.h
index e6fe7efbaba..d9e7317fc66 100644
--- a/source/blender/editors/include/ED_keyframes_edit.h
+++ b/source/blender/editors/include/ED_keyframes_edit.h
@@ -35,6 +35,7 @@
struct bAnimContext;
struct bAnimListElem;
+struct bDopeSheet;
struct FCurve;
struct BezTriple;
struct Scene;
@@ -187,11 +188,11 @@ short ANIM_fcurve_keyframes_loop(KeyframeEditData *ked, struct FCurve *fcu, Keyf
/* function for working with any type (i.e. one of the known types) of animation channel
* - filterflag is bDopeSheet->flag (DOPESHEET_FILTERFLAG)
*/
-short ANIM_animchannel_keyframes_loop(KeyframeEditData *ked, struct bAnimListElem *ale, KeyframeEditFunc key_ok, KeyframeEditFunc key_cb, FcuEditFunc fcu_cb, int filterflag);
+short ANIM_animchannel_keyframes_loop(KeyframeEditData *ked, struct bDopeSheet *ads, struct bAnimListElem *ale, KeyframeEditFunc key_ok, KeyframeEditFunc key_cb, FcuEditFunc fcu_cb);
/* same as above, except bAnimListElem wrapper is not needed...
* - keytype is eAnim_KeyType
*/
-short ANIM_animchanneldata_keyframes_loop(KeyframeEditData *ked, void *data, int keytype, KeyframeEditFunc key_ok, KeyframeEditFunc key_cb, FcuEditFunc fcu_cb, int filterflag);
+short ANIM_animchanneldata_keyframes_loop(KeyframeEditData *ked, struct bDopeSheet *ads, void *data, int keytype, KeyframeEditFunc key_ok, KeyframeEditFunc key_cb, FcuEditFunc fcu_cb);
/* functions for making sure all keyframes are in good order */
void ANIM_editkeyframes_refresh(struct bAnimContext *ac);