== Action Editor ==
Small Action Editor feature to hopefully make keyframing quicker. Just press the IKEY in the Action Editor. Feedback on the (annoyance factor of the) popups welcome.
This commit is contained in:
parent
57a91d7659
commit
2d8dd194cc
@ -92,6 +92,7 @@ void snap_keys_to_frame(int snap_mode);
|
||||
void mirror_action_keys(short mirror_mode);
|
||||
void clean_shapekeys(struct Key *key);
|
||||
void clean_actionchannels(struct bAction *act);
|
||||
void insertkey_action(void);
|
||||
|
||||
/* Marker Operations */
|
||||
void column_select_shapekeys(struct Key *key, int mode);
|
||||
|
@ -2568,6 +2568,9 @@ void snap_keys_to_frame(int snap_mode)
|
||||
else if (key) {
|
||||
set_snap_meshchannels(key, snap_mode);
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
|
||||
BIF_undo_push(str);
|
||||
allspace(REMAKEIPO, 0);
|
||||
@ -2670,6 +2673,9 @@ void mirror_action_keys(short mirror_mode)
|
||||
else if (key) {
|
||||
mirror_meshchannels(key, mirror_mode);
|
||||
}
|
||||
else {
|
||||
return;
|
||||
}
|
||||
|
||||
BIF_undo_push(str);
|
||||
allspace(REMAKEIPO, 0);
|
||||
@ -2678,6 +2684,75 @@ void mirror_action_keys(short mirror_mode)
|
||||
allqueue(REDRAWNLA, 0);
|
||||
}
|
||||
|
||||
/* This function allows the user to insert keyframes on the current
|
||||
* frame from the Action Editor, using the current values of the channels
|
||||
* to be keyframed.
|
||||
*/
|
||||
void insertkey_action(void)
|
||||
{
|
||||
bAction *act;
|
||||
Key *key;
|
||||
IpoCurve *icu;
|
||||
short mode;
|
||||
float cfra, val;
|
||||
|
||||
/* get data */
|
||||
act = G.saction->action;
|
||||
key = get_action_mesh_key();
|
||||
cfra = frame_to_float(CFRA);
|
||||
|
||||
if (act) {
|
||||
bActionChannel *achan;
|
||||
bConstraintChannel *conchan;
|
||||
|
||||
/* ask user what to keyframe */
|
||||
mode = pupmenu("Insert Key%t|All Channels%x1|Only Selected Channels%x2");
|
||||
if (mode == 0) return;
|
||||
|
||||
for (achan= act->chanbase.first; achan; achan=achan->next) {
|
||||
if (EDITABLE_ACHAN(achan)) {
|
||||
if (achan->ipo && (SEL_ACHAN(achan) || (mode == 1))) {
|
||||
for (icu= achan->ipo->curve.first; icu; icu=icu->next) {
|
||||
val = icu->curval;
|
||||
insert_vert_ipo(icu, cfra, val);
|
||||
}
|
||||
}
|
||||
|
||||
if (EXPANDED_ACHAN(achan) && FILTER_CON_ACHAN(achan)) {
|
||||
for (conchan=achan->constraintChannels.first; conchan; conchan=conchan->next) {
|
||||
if (EDITABLE_CONCHAN(conchan)) {
|
||||
if (conchan->ipo && (SEL_ACHAN(conchan) || (mode == 1))) {
|
||||
for (icu= conchan->ipo->curve.first; icu; icu=icu->next) {
|
||||
val = icu->curval;
|
||||
insert_vert_ipo(icu, cfra, val);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (key) {
|
||||
/* ask user if they want to insert a keyframe */
|
||||
mode = okee("Insert Keyframe?");
|
||||
if (mode == 0) return;
|
||||
|
||||
if (key->ipo) {
|
||||
for (icu= key->ipo->curve.first; icu; icu=icu->next) {
|
||||
val = icu->curval;
|
||||
insert_vert_ipo(icu, cfra, val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BIF_undo_push("Insert Key");
|
||||
allspace(REMAKEIPO, 0);
|
||||
allqueue(REDRAWACTION, 0);
|
||||
allqueue(REDRAWIPO, 0);
|
||||
allqueue(REDRAWNLA, 0);
|
||||
}
|
||||
|
||||
static void select_all_keys_frames(bAction *act, short *mval,
|
||||
short *mvalo, int selectmode)
|
||||
{
|
||||
@ -2886,7 +2961,7 @@ static void borderselect_function(void (*select_func)(bAction *act,
|
||||
select_func(act, mval, mvalo, SELECT_SUBTRACT);
|
||||
}
|
||||
|
||||
BIF_undo_push("Border select Action");
|
||||
BIF_undo_push("Border Select Action");
|
||||
}
|
||||
|
||||
static void clever_keyblock_names(Key *key, short* mval){
|
||||
@ -3255,7 +3330,7 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case KKEY:
|
||||
if (G.qual & LR_CTRLKEY) {
|
||||
markers_selectkeys_between();
|
||||
@ -3278,8 +3353,10 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
case MKEY:
|
||||
if (G.qual & LR_SHIFTKEY) {
|
||||
/* mirror keyframes */
|
||||
val = pupmenu("Mirror Keys Over%t|Current Frame%x1|Vertical Axis%x2|Horizontal Axis %x3|Selected Marker %x4");
|
||||
mirror_action_keys(val);
|
||||
if (act || key) {
|
||||
val = pupmenu("Mirror Keys Over%t|Current Frame%x1|Vertical Axis%x2|Horizontal Axis %x3|Selected Marker %x4");
|
||||
mirror_action_keys(val);
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* marker operations */
|
||||
@ -3329,8 +3406,10 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
case SKEY:
|
||||
if (mval[0]>=ACTWIDTH) {
|
||||
if(G.qual & LR_SHIFTKEY) {
|
||||
val = pupmenu("Snap Keys To%t|Nearest Frame%x1|Current Frame%x2|Nearest Marker %x3");
|
||||
snap_keys_to_frame(val);
|
||||
if (act || key) {
|
||||
val = pupmenu("Snap Keys To%t|Nearest Frame%x1|Current Frame%x2|Nearest Marker %x3");
|
||||
snap_keys_to_frame(val);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (act)
|
||||
|
@ -2426,6 +2426,9 @@ void common_insertkey(void)
|
||||
if(curarea->spacetype==SPACE_IPO) {
|
||||
insertkey_editipo();
|
||||
}
|
||||
else if(curarea->spacetype==SPACE_ACTION) {
|
||||
insertkey_action();
|
||||
}
|
||||
else if(curarea->spacetype==SPACE_BUTS) {
|
||||
if(G.buts->mainb==CONTEXT_SHADING) {
|
||||
int tab= G.buts->tab[CONTEXT_SHADING];
|
||||
|
Loading…
Reference in New Issue
Block a user