== Action Editor - Groups for Action Channels (Peach Request) ==

Now, you can assign Action Channels to named (folder-like) groups, which help to organise the channels (important for more complex rigs). These are collapsible, can be "protected", and show a "summary" of the keyframes in the channels the Group contains. They are drawn as bright-green (active) or a darker shade of green (not active) channels.

* Each Action has its own set of Groups. 
* An Action-Channel can only occur in one Group at a time. It can also not occur in any group.
* Action-Channels can be moved between Groups
* Groups + grouped-channels always occur BEFORE un-grouped channels

Important Hotkeys:
* Shift-G  :  Adds the selected Action-Channels to the Active Group. This will create a new group if need be
* Ctrl-Shift-G : Always adds a new group, and adds the selected Action-Channels to it
* Alt-G : Removes selected Action-Channels from their groups
* Ctrl-Shift-Alt-G : (Note: this will be removed soon) This is a simple debugging-hotkey I added, which just prints a list of the groups, channels, and their addresses...
* NKey / Ctrl-LMB: While hovering over the name of a group, this shows a popup like for other channels, which allows the editing of the channel's name, etc.


Assorted Notes:
* Some tools may not work yet with this (Ctrl Numpad+/- for example)
* Fixed some bugs in various places in Action Editor code
* Added theme colours for group channels
* The nomenclature of these tools may change in future when a better alternative is found
* The ability to auto-assign action-channels to groups when they are keyframed will be coming up shortly
This commit is contained in:
Joshua Leung
2008-01-17 23:02:11 +00:00
parent 65d61c2cb6
commit 44c31bb045
13 changed files with 1204 additions and 292 deletions

View File

@@ -38,6 +38,7 @@ struct Ipo;
struct IpoCurve;
struct gla2DDrawInfo;
struct bAction;
struct bActionGroup;
struct Object;
struct ListBase;
@@ -75,14 +76,16 @@ void draw_cfra_action(void);
/* Channel Drawing */
void draw_icu_channel(struct gla2DDrawInfo *di, struct IpoCurve *icu, float ypos);
void draw_ipo_channel(struct gla2DDrawInfo *di, struct Ipo *ipo, float ypos);
void draw_action_channel(struct gla2DDrawInfo *di, bAction *act, float ypos);
void draw_object_channel(struct gla2DDrawInfo *di, Object *ob, float ypos);
void draw_agroup_channel(struct gla2DDrawInfo *di, struct bActionGroup *agrp, float ypos);
void draw_action_channel(struct gla2DDrawInfo *di, struct bAction *act, float ypos);
void draw_object_channel(struct gla2DDrawInfo *di, struct Object *ob, float ypos);
/* Keydata Generation */
void icu_to_keylist(struct IpoCurve *icu, ListBase *keys, ListBase *blocks);
void ipo_to_keylist(struct Ipo *ipo, ListBase *keys, ListBase *blocks);
void action_to_keylist(bAction *act, ListBase *keys, ListBase *blocks);
void ob_to_keylist(Object *ob, ListBase *keys, ListBase *blocks);
void agroup_to_keylist(struct bActionGroup *agrp, ListBase *keys, ListBase *blocks);
void action_to_keylist(struct bAction *act, ListBase *keys, ListBase *blocks);
void ob_to_keylist(struct Object *ob, ListBase *keys, ListBase *blocks);
#endif /* BDR_DRAWACTION_H */

View File

@@ -43,6 +43,7 @@
/* Some types for easier type-testing */
enum {
ACTTYPE_NONE= 0,
ACTTYPE_GROUP,
ACTTYPE_ACHAN,
ACTTYPE_CONCHAN,
ACTTYPE_ICU,
@@ -53,6 +54,10 @@ enum {
};
/* Macros for easier/more consistant state testing */
#define EDITABLE_AGRP(agrp) ((agrp->flag & AGRP_PROTECTED)==0)
#define EXPANDED_AGRP(agrp) (agrp->flag & AGRP_EXPANDED)
#define SEL_AGRP(agrp) ((agrp->flag & AGRP_SELECTED) || (agrp->flag & AGRP_ACTIVE))
#define VISIBLE_ACHAN(achan) ((achan->flag & ACHAN_HIDDEN)==0)
#define EDITABLE_ACHAN(achan) ((VISIBLE_ACHAN(achan)) && ((achan->flag & ACHAN_PROTECTED)==0))
#define EXPANDED_ACHAN(achan) ((VISIBLE_ACHAN(achan)) && (achan->flag & ACHAN_EXPANDED))
@@ -81,7 +86,6 @@ enum {
/* constants for setting ipo-extrapolation type */
enum {
SET_EXTEND_MENU = 9,
SET_EXTEND_POPUP = 10,
@@ -91,9 +95,19 @@ enum {
SET_EXTEND_CYCLICEXTRAPOLATION
};
/* constants for channel rearranging */
/* WARNING: don't change exising ones without modifying rearrange func accordingly */
enum {
REARRANGE_ACTCHAN_TOP= -2,
REARRANGE_ACTCHAN_UP= -1,
REARRANGE_ACTCHAN_DOWN= 1,
REARRANGE_ACTCHAN_BOTTOM= 2
};
struct bAction;
struct bActionChannel;
struct bActionGroup;
struct bPoseChannel;
struct Object;
struct Ipo;
@@ -125,11 +139,14 @@ void free_actcopybuf(void);
void copy_actdata(void);
void paste_actdata(void);
/* Channel/strip operations */
void up_sel_action(void);
void down_sel_action(void);
void top_sel_action(void);
void bottom_sel_action(void);
/* Group/Channel Operations */
struct bActionGroup *get_active_actiongroup(struct bAction *act);
void set_active_actiongroup(struct bAction *act, struct bActionGroup *agrp, short select);
void action_groups_group(short add_group);
void action_groups_ungroup(void);
/* Channel/Strip Operations */
void rearrange_action_channels(short mode);
void expand_all_action(void);
void openclose_level_action(short mode);

View File

@@ -37,9 +37,12 @@
/* FILTERED ACTION DATA - TYPES */
/* types of keyframe data in ActListElem */
#define ALE_NONE 0
#define ALE_IPO 1
#define ALE_ICU 2
typedef enum ALE_KEYTYPE {
ALE_NONE = 0,
ALE_IPO,
ALE_ICU,
ALE_GROUP
} ALE_KEYTYPE;
/* This struct defines a structure used for quick access */
typedef struct bActListElem {
@@ -53,6 +56,8 @@ typedef struct bActListElem {
void *key_data; /* motion data - ipo or ipo-curve */
short datatype; /* type of motion data to expect */
struct bActionGroup *grp; /* action group that owns the channel */
void *owner; /* will either be an action channel or fake ipo-channel (for keys) */
short ownertype; /* type of owner */
} bActListElem;
@@ -61,17 +66,21 @@ typedef struct bActListElem {
/* FILTER ACTION DATA - METHODS/TYPES */
/* filtering flags - under what circumstances should a channel be added */
#define ACTFILTER_VISIBLE 0x001 /* should channels be visible */
#define ACTFILTER_SEL 0x002 /* should channels be selected */
#define ACTFILTER_FOREDIT 0x004 /* does editable status matter */
#define ACTFILTER_CHANNELS 0x008 /* do we only care that it is a channel */
#define ACTFILTER_IPOKEYS 0x010 /* only channels referencing ipo's */
#define ACTFILTER_ONLYICU 0x020 /* only reference ipo-curves */
#define ACTFILTER_FORDRAWING 0x040 /* make list for interface drawing */
typedef enum ACTFILTER_FLAGS {
ACTFILTER_VISIBLE = (1<<0), /* should channels be visible */
ACTFILTER_SEL = (1<<1), /* should channels be selected */
ACTFILTER_FOREDIT = (1<<2), /* does editable status matter */
ACTFILTER_CHANNELS = (1<<3), /* do we only care that it is a channel */
ACTFILTER_IPOKEYS = (1<<4), /* only channels referencing ipo's */
ACTFILTER_ONLYICU = (1<<5), /* only reference ipo-curves */
ACTFILTER_FORDRAWING = (1<<6) /* make list for interface drawing */
} ACTFILTER_FLAGS;
/* Action Editor - Main Data types */
#define ACTCONT_NONE 0
#define ACTCONT_ACTION 1
#define ACTCONT_SHAPEKEY 2
typedef enum ACTCONT_TYPES {
ACTCONT_NONE = 0,
ACTCONT_ACTION,
ACTCONT_SHAPEKEY
} ACTCONT_TYPES;
#endif