Action Editor: editing of action-channel keys is impossible if shapekeys are present
for that object.

Also, after toggling the 'swimmer' icon in the IPO editor header,on and then off again, then trying to expand/collapse/select/deselect the 'Shape' action channel, Blender would crash.

Not really a showstopper, but still nice to fix. ;-)
This commit is contained in:
2007-05-10 06:51:08 +00:00
parent 85b0997d90
commit 3c0348589c
3 changed files with 241 additions and 246 deletions

View File

@@ -356,7 +356,7 @@ static void *get_nearest_actionchannel_key (float *selx, short *sel, short *ret_
if(VISIBLE_ACHAN(achan)) { if(VISIBLE_ACHAN(achan)) {
if (clickmax < 0) if (clickmax < 0)
break; break;
if (clickmin <= 0) { if ((clickmin <= 0) && (achan->ipo)) {
/* found level - action channel */ /* found level - action channel */
icu= get_nearest_icu_key(achan->ipo->curve.first, selx, sel, xrange); icu= get_nearest_icu_key(achan->ipo->curve.first, selx, sel, xrange);
@@ -422,7 +422,7 @@ static void *get_nearest_actionchannel_key (float *selx, short *sel, short *ret_
for (conchan= achan->constraintChannels.first; conchan; conchan=conchan->next) { for (conchan= achan->constraintChannels.first; conchan; conchan=conchan->next) {
if (clickmax < 0) if (clickmax < 0)
break; break;
if (clickmin <= 0) { if ((clickmin <= 0) && (conchan->ipo)) {
/* found match - constraint channel */ /* found match - constraint channel */
icu= get_nearest_icu_key(conchan->ipo->curve.first, selx, sel, xrange); icu= get_nearest_icu_key(conchan->ipo->curve.first, selx, sel, xrange);
@@ -1703,7 +1703,7 @@ void deselect_actionchannels (bAction *act, int test)
} }
if (sel) { if (sel) {
if (EXPANDED_ACHAN(achan)) { if (EXPANDED_ACHAN(achan)) {
if (FILTER_IPO_ACHAN(achan)) { if (FILTER_IPO_ACHAN(achan) && (achan->ipo)) {
for (icu=achan->ipo->curve.first; icu; icu=icu->next) { for (icu=achan->ipo->curve.first; icu; icu=icu->next) {
if (SEL_ICU(icu)) { if (SEL_ICU(icu)) {
sel= 0; sel= 0;
@@ -1739,7 +1739,7 @@ void deselect_actionchannels (bAction *act, int test)
achan->flag &= ~ACHAN_SELECTED; achan->flag &= ~ACHAN_SELECTED;
if (EXPANDED_ACHAN(achan)) { if (EXPANDED_ACHAN(achan)) {
if (FILTER_IPO_ACHAN(achan)) { if (FILTER_IPO_ACHAN(achan) && (achan->ipo)) {
for (icu=achan->ipo->curve.first; icu; icu=icu->next) { for (icu=achan->ipo->curve.first; icu; icu=icu->next) {
if (sel) if (sel)
icu->flag |= IPO_SELECT; icu->flag |= IPO_SELECT;
@@ -2578,13 +2578,13 @@ void snap_keys_to_frame(int snap_mode)
} }
/* snap to frame */ /* snap to frame */
if (key) { if (act) {
set_snap_meshchannels(key, snap_mode);
}
else if (act) {
set_snap_actionchannels(act, snap_mode); set_snap_actionchannels(act, snap_mode);
remake_action_ipos (act); remake_action_ipos (act);
} }
else if (key) {
set_snap_meshchannels(key, snap_mode);
}
BIF_undo_push(str); BIF_undo_push(str);
allspace(REMAKEIPO, 0); allspace(REMAKEIPO, 0);
@@ -2680,13 +2680,13 @@ void mirror_action_keys(short mirror_mode)
} }
/* mirror */ /* mirror */
if (key) { if (act) {
mirror_meshchannels(key, mirror_mode);
}
else if (act) {
mirror_actionchannels(act, mirror_mode); mirror_actionchannels(act, mirror_mode);
remake_action_ipos (act); remake_action_ipos (act);
} }
else if (key) {
mirror_meshchannels(key, mirror_mode);
}
BIF_undo_push(str); BIF_undo_push(str);
allspace(REMAKEIPO, 0); allspace(REMAKEIPO, 0);
@@ -3064,17 +3064,20 @@ static void numbuts_action(void)
{ {
/* now called from action window event loop, plus reacts on mouseclick */ /* now called from action window event loop, plus reacts on mouseclick */
/* removed Hos grunts for that reason! :) (ton) */ /* removed Hos grunts for that reason! :) (ton) */
bAction *act;
Key *key; Key *key;
short mval[2]; short mval[2];
key = get_action_mesh_key(); key = get_action_mesh_key();
act = G.saction->action;
getmouseco_areawin (mval); getmouseco_areawin (mval);
if (mval[0] < NAMEWIDTH) { if (mval[0] < NAMEWIDTH) {
if (key) if (act)
clever_keyblock_names(key, mval);
else
clever_achannel_names(mval); clever_achannel_names(mval);
else if (key)
clever_keyblock_names(key, mval);
} }
} }
@@ -3099,6 +3102,8 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
return; return;
act=saction->action; act=saction->action;
key = get_action_mesh_key();
if (val) { if (val) {
if ( uiDoBlocks(&curarea->uiblocks, event)!=UI_NOTHING ) event= 0; if ( uiDoBlocks(&curarea->uiblocks, event)!=UI_NOTHING ) event= 0;
@@ -3115,8 +3120,6 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
getmouseco_areawin(mval); getmouseco_areawin(mval);
key = get_action_mesh_key();
switch(event) { switch(event) {
case UI_BUT_EVENT: case UI_BUT_EVENT:
do_actionbuts(val); // window itself do_actionbuts(val); // window itself
@@ -3127,28 +3130,7 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
break; break;
case AKEY: case AKEY:
if (key) { if (act) {
if (mval[0]<ACTWIDTH){
/* to do ??? */
}
else {
if (G.qual == LR_CTRLKEY) {
deselect_markers(1, 0);
allqueue(REDRAWTIME, 0);
allqueue(REDRAWIPO, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWSOUND, 0);
}
else {
deselect_meshchannel_keys(key, 1, 1);
allqueue (REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue (REDRAWIPO, 0);
}
}
}
else {
if (mval[0]<NAMEWIDTH) { if (mval[0]<NAMEWIDTH) {
deselect_actionchannels (act, 1); deselect_actionchannels (act, 1);
allqueue (REDRAWVIEW3D, 0); allqueue (REDRAWVIEW3D, 0);
@@ -3173,30 +3155,42 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
} }
} }
} }
else if (key) {
if (mval[0]<ACTWIDTH) {
/* to do ??? */
}
else {
if (G.qual == LR_CTRLKEY) {
deselect_markers(1, 0);
allqueue(REDRAWTIME, 0);
allqueue(REDRAWIPO, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue(REDRAWSOUND, 0);
}
else {
deselect_meshchannel_keys(key, 1, 1);
allqueue (REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue (REDRAWIPO, 0);
}
}
}
break; break;
case BKEY: case BKEY:
if (G.qual & LR_CTRLKEY) if (G.qual & LR_CTRLKEY)
borderselect_markers(); borderselect_markers();
else if (key) { else if (act) {
if (mval[0]<ACTWIDTH) {
/* to do?? */
}
else {
borderselect_mesh(key);
}
}
else {
/* If the border select is initiated in the /* If the border select is initiated in the
* part of the action window where the channel * part of the action window where the channel
* names reside, then select the channels * names reside, then select the channels
*/ */
if (mval[0]<NAMEWIDTH){ if (mval[0]<NAMEWIDTH) {
borderselect_function(borderselect_actionchannels); borderselect_function(borderselect_actionchannels);
BIF_undo_push("Select Action"); BIF_undo_push("Select Action");
} }
else if (mval[0]>ACTWIDTH){ else if (mval[0]>ACTWIDTH) {
/* If the border select is initiated in the /* If the border select is initiated in the
* vertical scrollbar, then (de)select all keys * vertical scrollbar, then (de)select all keys
* for the channels in the selection region * for the channels in the selection region
@@ -3213,13 +3207,20 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
borderselect_function(select_all_keys_frames); borderselect_function(select_all_keys_frames);
} }
/* Other wise, select the action keys /* Other wise, select the action keys */
*/
else { else {
borderselect_action(); borderselect_action();
} }
} }
} }
else if (key) {
if (mval[0]<ACTWIDTH) {
/* to do?? */
}
else {
borderselect_mesh(key);
}
}
break; break;
case CKEY: case CKEY:
@@ -3235,13 +3236,13 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
duplicate_marker(); duplicate_marker();
} }
else if (G.qual == LR_SHIFTKEY) { else if (G.qual == LR_SHIFTKEY) {
if (key) { if (act) {
duplicate_meshchannel_keys(key);
}
else if (act) {
duplicate_actionchannel_keys(); duplicate_actionchannel_keys();
remake_action_ipos(act); remake_action_ipos(act);
} }
else if (key) {
duplicate_meshchannel_keys(key);
}
} }
} }
break; break;
@@ -3252,12 +3253,12 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
} }
else { else {
if (mval[0]>=ACTWIDTH) { if (mval[0]>=ACTWIDTH) {
if (key) { if (act) {
transform_meshchannel_keys('g', key);
}
else if (act) {
transform_actionchannel_keys ('g', 0); transform_actionchannel_keys ('g', 0);
} }
else if (key) {
transform_meshchannel_keys('g', key);
}
} }
} }
break; break;
@@ -3265,18 +3266,18 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
case HKEY: case HKEY:
if(G.qual & LR_SHIFTKEY) { if(G.qual & LR_SHIFTKEY) {
if(okee("Set Keys to Auto Handle")) { if(okee("Set Keys to Auto Handle")) {
if (key) if (act)
sethandles_meshchannel_keys(HD_AUTO, key);
else
sethandles_actionchannel_keys(HD_AUTO); sethandles_actionchannel_keys(HD_AUTO);
else if (key)
sethandles_meshchannel_keys(HD_AUTO, key);
} }
} }
else { else {
if(okee("Toggle Keys Aligned Handle")) { if(okee("Toggle Keys Aligned Handle")) {
if (key) if (act)
sethandles_meshchannel_keys(HD_ALIGN, key);
else
sethandles_actionchannel_keys(HD_ALIGN); sethandles_actionchannel_keys(HD_ALIGN);
else if (key)
sethandles_meshchannel_keys(HD_ALIGN, key);
} }
} }
break; break;
@@ -3288,10 +3289,10 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
else { else {
val= (G.qual & LR_SHIFTKEY) ? 2 : 1; val= (G.qual & LR_SHIFTKEY) ? 2 : 1;
if(key) if (act)
column_select_shapekeys(key, val);
else if(act)
column_select_actionkeys(act, val); column_select_actionkeys(act, val);
else if (key)
column_select_shapekeys(key, val);
} }
allqueue(REDRAWTIME, 0); allqueue(REDRAWTIME, 0);
@@ -3333,10 +3334,10 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
break; break;
case OKEY: case OKEY:
if(key) if(act)
clean_shapekeys(key);
else if(act)
clean_actionchannels(act); clean_actionchannels(act);
else if(key)
clean_shapekeys(key);
break; break;
case PKEY: case PKEY:
@@ -3358,42 +3359,35 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
snap_keys_to_frame(val); snap_keys_to_frame(val);
} }
else { else {
if (key) if (act)
transform_meshchannel_keys('s', key);
else if (act)
transform_actionchannel_keys ('s', 0); transform_actionchannel_keys ('s', 0);
else if (key)
transform_meshchannel_keys('s', key);
} }
} }
break; break;
/*** set the Ipo type ***/
case TKEY: case TKEY:
if (key) { if (act) {
/* to do */
}
else {
if(G.qual & LR_SHIFTKEY) if(G.qual & LR_SHIFTKEY)
set_ipotype_actionchannels(SET_IPO_POPUP); set_ipotype_actionchannels(SET_IPO_POPUP);
else else
transform_actionchannel_keys ('t', 0); transform_actionchannel_keys ('t', 0);
} }
/* else if (key) {} ... todo */
break; break;
case VKEY: case VKEY:
if(okee("Set Keys to Vector Handle")) { if(okee("Set Keys to Vector Handle")) {
if (key) if (act)
sethandles_meshchannel_keys(HD_VECT, key);
else
sethandles_actionchannel_keys(HD_VECT); sethandles_actionchannel_keys(HD_VECT);
else if (key)
sethandles_meshchannel_keys(HD_VECT, key);
} }
break; break;
case PAGEUPKEY: case PAGEUPKEY:
if (key) { if (act) {
/* only jump to markers possible (key channels can't be moved yet) */
nextprev_marker(1);
}
else {
if(G.qual & LR_SHIFTKEY) if(G.qual & LR_SHIFTKEY)
top_sel_action(); top_sel_action();
else if (G.qual & LR_CTRLKEY) else if (G.qual & LR_CTRLKEY)
@@ -3401,13 +3395,13 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
else else
nextprev_marker(1); nextprev_marker(1);
} }
else if (key) {
/* only jump to markers possible (key channels can't be moved yet) */
nextprev_marker(1);
}
break; break;
case PAGEDOWNKEY: case PAGEDOWNKEY:
if (key) { if (act) {
/* only jump to markers possible (key channels can't be moved yet) */
nextprev_marker(-1);
}
else {
if(G.qual & LR_SHIFTKEY) if(G.qual & LR_SHIFTKEY)
bottom_sel_action(); bottom_sel_action();
else if (G.qual & LR_CTRLKEY) else if (G.qual & LR_CTRLKEY)
@@ -3415,19 +3409,24 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
else else
nextprev_marker(-1); nextprev_marker(-1);
} }
else if (key) {
/* only jump to markers possible (key channels can't be moved yet) */
nextprev_marker(-1);
}
break; break;
case DELKEY: case DELKEY:
case XKEY: case XKEY:
if (okee("Erase selected")) { if (okee("Erase selected")) {
if (key) { if (act) {
delete_meshchannel_keys(key);
}
else {
if (mval[0]<NAMEWIDTH) if (mval[0]<NAMEWIDTH)
delete_actionchannels(); delete_actionchannels();
else else
delete_actionchannel_keys(); delete_actionchannel_keys();
} }
else if (key) {
delete_meshchannel_keys(key);
}
if (mval[0] >= NAMEWIDTH) if (mval[0] >= NAMEWIDTH)
remove_marker(); remove_marker();
@@ -3439,6 +3438,7 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
allqueue(REDRAWSOUND, 0); allqueue(REDRAWSOUND, 0);
} }
break; break;
/* LEFTMOUSE and RIGHTMOUSE event codes can be swapped above, /* LEFTMOUSE and RIGHTMOUSE event codes can be swapped above,
* based on user preference USER_LMOUSESELECT * based on user preference USER_LMOUSESELECT
*/ */
@@ -3504,18 +3504,18 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
* selects keys and markers * selects keys and markers
*/ */
else { else {
if (key) { if (act) {
if(G.qual & LR_SHIFTKEY)
mouse_mesh_action(SELECT_INVERT, key);
else
mouse_mesh_action(SELECT_REPLACE, key);
}
else {
if(G.qual & LR_SHIFTKEY) if(G.qual & LR_SHIFTKEY)
mouse_action(SELECT_INVERT); mouse_action(SELECT_INVERT);
else else
mouse_action(SELECT_REPLACE); mouse_action(SELECT_REPLACE);
} }
else if (key) {
if(G.qual & LR_SHIFTKEY)
mouse_mesh_action(SELECT_INVERT, key);
else
mouse_mesh_action(SELECT_REPLACE, key);
}
} }
} }
break; break;
@@ -3577,7 +3577,8 @@ Key *get_action_mesh_key(void)
return NULL; return NULL;
} }
int get_nearest_key_num(Key *key, short *mval, float *x) { int get_nearest_key_num(Key *key, short *mval, float *x)
{
/* returns the key num that cooresponds to the /* returns the key num that cooresponds to the
* y value of the mouse click. Does not check * y value of the mouse click. Does not check
* if this is a valid keynum. Also gives the Ipo * if this is a valid keynum. Also gives the Ipo
@@ -3734,11 +3735,7 @@ void markers_selectkeys_between(void)
key = get_action_mesh_key(); key = get_action_mesh_key();
/* select keys in-between */ /* select keys in-between */
if (key) { if (act) {
if (key->ipo)
borderselect_ipo_key(key->ipo, min, max, SELECT_ADD);
}
else if (act) {
bActionChannel *achan; bActionChannel *achan;
bConstraintChannel *conchan; bConstraintChannel *conchan;
@@ -3771,6 +3768,10 @@ void markers_selectkeys_between(void)
} }
} }
} }
else if (key) {
if (key->ipo)
borderselect_ipo_key(key->ipo, min, max, SELECT_ADD);
}
} }
/* ************************************* Action Channel Ordering *********************************** */ /* ************************************* Action Channel Ordering *********************************** */
@@ -3841,8 +3842,7 @@ void up_sel_action()
achan->flag = achan->flag & ~ACHAN_MOVED; achan->flag = achan->flag & ~ACHAN_MOVED;
} }
/* Clean up and redraw stuff /* Clean up and redraw stuff */
*/
remake_action_ipos (act); remake_action_ipos (act);
BIF_undo_push("Up Action channel"); BIF_undo_push("Up Action channel");
allspace(REMAKEIPO, 0); allspace(REMAKEIPO, 0);
@@ -3887,8 +3887,7 @@ void down_sel_action()
achan->flag = achan->flag & ~ACHAN_MOVED; achan->flag = achan->flag & ~ACHAN_MOVED;
} }
/* Clean up and redraw stuff /* Clean up and redraw stuff */
*/
remake_action_ipos (act); remake_action_ipos (act);
BIF_undo_push("Down Action channel"); BIF_undo_push("Down Action channel");
allspace(REMAKEIPO, 0); allspace(REMAKEIPO, 0);
@@ -3922,8 +3921,7 @@ void bottom_sel_action()
achan->flag = achan->flag & ~ACHAN_MOVED; achan->flag = achan->flag & ~ACHAN_MOVED;
} }
/* Clean up and redraw stuff /* Clean up and redraw stuff */
*/
remake_action_ipos (act); remake_action_ipos (act);
BIF_undo_push("Bottom Action channel"); BIF_undo_push("Bottom Action channel");
allspace(REMAKEIPO, 0); allspace(REMAKEIPO, 0);
@@ -3946,7 +3944,7 @@ void world2bonespace(float boneSpaceMat[][4], float worldSpace[][4], float restP
Mat4MulMat4(boneSpaceMat, restPos, t2mat); Mat4MulMat4(boneSpaceMat, restPos, t2mat);
} }
bAction* bake_action_with_client (bAction *act, Object *armob, float tolerance) bAction *bake_action_with_client (bAction *act, Object *armob, float tolerance)
{ {
bArmature *arm; bArmature *arm;
bAction *result=NULL; bAction *result=NULL;

View File

@@ -150,24 +150,18 @@ void do_action_buttons(unsigned short event)
switch(event){ switch(event){
case B_ACTBAKE: case B_ACTBAKE:
bake_action_with_client (G.saction->action, ob, 0.01); bake_action_with_client(G.saction->action, ob, 0.01);
break; break;
case B_ACTHOME: case B_ACTHOME:
// Find X extents /* Find X extents */
//v2d= &(G.saction->v2d);
G.v2d->cur.xmin = 0; G.v2d->cur.xmin = 0;
G.v2d->cur.ymin=-SCROLLB; G.v2d->cur.ymin=-SCROLLB;
if (!G.saction->action){ // here the mesh rvk? if (G.saction->action) {
G.v2d->cur.xmax= -5;
G.v2d->cur.xmax= 100;
}
else {
float extra; float extra;
calc_action_range(G.saction->action, &G.v2d->cur.xmin, &G.v2d->cur.xmax, 0); calc_action_range(G.saction->action, &G.v2d->cur.xmin, &G.v2d->cur.xmax, 0);
if(G.saction->pin==0 && ob) { if (G.saction->pin==0 && ob) {
G.v2d->cur.xmin= get_action_frame_inv(ob, G.v2d->cur.xmin); G.v2d->cur.xmin= get_action_frame_inv(ob, G.v2d->cur.xmin);
G.v2d->cur.xmax= get_action_frame_inv(ob, G.v2d->cur.xmax); G.v2d->cur.xmax= get_action_frame_inv(ob, G.v2d->cur.xmax);
} }
@@ -175,11 +169,15 @@ void do_action_buttons(unsigned short event)
G.v2d->cur.xmin-= extra; G.v2d->cur.xmin-= extra;
G.v2d->cur.xmax+= extra; G.v2d->cur.xmax+= extra;
if(G.v2d->cur.xmin==G.v2d->cur.xmax) { if (G.v2d->cur.xmin==G.v2d->cur.xmax) {
G.v2d->cur.xmax= -5; G.v2d->cur.xmax= -5;
G.v2d->cur.xmax= 100; G.v2d->cur.xmax= 100;
} }
} }
else { /* shapekeys and/or no action */
G.v2d->cur.xmax= -5;
G.v2d->cur.xmax= 100;
}
G.v2d->cur.ymin= 0.0f; G.v2d->cur.ymin= 0.0f;
G.v2d->cur.ymax= 1000.0f; G.v2d->cur.ymax= 1000.0f;
@@ -204,10 +202,9 @@ void do_action_buttons(unsigned short event)
break; break;
case B_ACTPIN: /* __PINFAKE */ case B_ACTPIN: /* __PINFAKE */
/* if (G.saction->flag & SACTION_PIN){ /* if (G.saction->flag & SACTION_PIN) {
if (G.saction->action) if (G.saction->action)
G.saction->action->id.us ++; G.saction->action->id.us ++;
} }
else { else {
if (G.saction->action) if (G.saction->action)
@@ -216,7 +213,6 @@ void do_action_buttons(unsigned short event)
*/ /* end PINFAKE */ */ /* end PINFAKE */
allqueue(REDRAWACTION, 1); allqueue(REDRAWACTION, 1);
break; break;
} }
} }
@@ -356,18 +352,20 @@ static void do_action_selectmenu_columnmenu(void *arg, int event)
bAction *act; bAction *act;
Key *key; Key *key;
saction= curarea->spacedata.first; saction = curarea->spacedata.first;
act=saction->action; if (!saction) return;
act = saction->action;
key = get_action_mesh_key(); key = get_action_mesh_key();
if (event == ACTMENU_SEL_COLUMN_MARKERSBETWEEN) { if (event == ACTMENU_SEL_COLUMN_MARKERSBETWEEN) {
markers_selectkeys_between(); markers_selectkeys_between();
} }
else if (ELEM(event, ACTMENU_SEL_COLUMN_KEYS, ACTMENU_SEL_COLUMN_MARKERSCOLUMN)) { else if (ELEM(event, ACTMENU_SEL_COLUMN_KEYS, ACTMENU_SEL_COLUMN_MARKERSCOLUMN)) {
if (key) if (act)
column_select_shapekeys(key, event);
else if (act)
column_select_actionkeys(act, event); column_select_actionkeys(act, event);
else if (key)
column_select_shapekeys(key, event);
} }
else else
return; return;
@@ -412,8 +410,7 @@ static void do_action_selectmenu(void *arg, int event)
Key *key; Key *key;
saction = curarea->spacedata.first; saction = curarea->spacedata.first;
if (!saction) if (!saction) return;
return;
act = saction->action; act = saction->action;
key = get_action_mesh_key(); key = get_action_mesh_key();
@@ -421,12 +418,12 @@ static void do_action_selectmenu(void *arg, int event)
switch(event) switch(event)
{ {
case ACTMENU_SEL_BORDER: /* Border Select */ case ACTMENU_SEL_BORDER: /* Border Select */
if (key) { if (act) {
borderselect_mesh(key);
}
else {
borderselect_action(); borderselect_action();
} }
else if (key) {
borderselect_mesh(key);
}
break; break;
case ACTMENU_SEL_BORDERM: /* Border Select */ case ACTMENU_SEL_BORDERM: /* Border Select */
@@ -434,14 +431,14 @@ static void do_action_selectmenu(void *arg, int event)
break; break;
case ACTMENU_SEL_ALL_KEYS: /* Select/Deselect All Keys */ case ACTMENU_SEL_ALL_KEYS: /* Select/Deselect All Keys */
if (key) { if (act) {
deselect_meshchannel_keys(key, 1, 1); deselect_actionchannel_keys (act, 1, 1);
allqueue (REDRAWACTION, 0); allqueue (REDRAWACTION, 0);
allqueue(REDRAWNLA, 0); allqueue(REDRAWNLA, 0);
allqueue (REDRAWIPO, 0); allqueue (REDRAWIPO, 0);
} }
else { else if (key) {
deselect_actionchannel_keys (act, 1, 1); deselect_meshchannel_keys(key, 1, 1);
allqueue (REDRAWACTION, 0); allqueue (REDRAWACTION, 0);
allqueue(REDRAWNLA, 0); allqueue(REDRAWNLA, 0);
allqueue (REDRAWIPO, 0); allqueue (REDRAWIPO, 0);
@@ -449,7 +446,7 @@ static void do_action_selectmenu(void *arg, int event)
break; break;
case ACTMENU_SEL_ALL_CHAN: /* Select/Deselect All Channels */ case ACTMENU_SEL_ALL_CHAN: /* Select/Deselect All Channels */
deselect_actionchannels (act, 1); deselect_actionchannels(act, 1);
allqueue (REDRAWVIEW3D, 0); allqueue (REDRAWVIEW3D, 0);
allqueue (REDRAWACTION, 0); allqueue (REDRAWACTION, 0);
allqueue(REDRAWNLA, 0); allqueue(REDRAWNLA, 0);
@@ -466,14 +463,14 @@ static void do_action_selectmenu(void *arg, int event)
break; break;
case ACTMENU_SEL_INVERSE_KEYS: /* invert selection status of keys */ case ACTMENU_SEL_INVERSE_KEYS: /* invert selection status of keys */
if (key) { if (act) {
deselect_meshchannel_keys(key, 0, 2); deselect_actionchannel_keys(act, 0, 2);
allqueue (REDRAWACTION, 0); allqueue (REDRAWACTION, 0);
allqueue(REDRAWNLA, 0); allqueue(REDRAWNLA, 0);
allqueue (REDRAWIPO, 0); allqueue (REDRAWIPO, 0);
} }
else { else if (key) {
deselect_actionchannel_keys (act, 0, 2); deselect_meshchannel_keys(key, 0, 2);
allqueue (REDRAWACTION, 0); allqueue (REDRAWACTION, 0);
allqueue(REDRAWNLA, 0); allqueue(REDRAWNLA, 0);
allqueue (REDRAWIPO, 0); allqueue (REDRAWIPO, 0);
@@ -562,36 +559,37 @@ static void do_action_keymenu_transformmenu(void *arg, int event)
bAction *act; bAction *act;
Key *key; Key *key;
saction = curarea->spacedata.first;
if (!saction) return;
act = saction->action;
key = get_action_mesh_key(); key = get_action_mesh_key();
saction= curarea->spacedata.first;
act=saction->action; switch (event)
switch(event)
{ {
case ACTMENU_KEY_TRANSFORM_MOVE: case ACTMENU_KEY_TRANSFORM_MOVE:
if (key) { if (act) {
transform_meshchannel_keys('g', key);
}
else if (act) {
transform_actionchannel_keys ('g', 0); transform_actionchannel_keys ('g', 0);
} }
else if (key) {
transform_meshchannel_keys('g', key);
}
break; break;
case ACTMENU_KEY_TRANSFORM_SCALE: case ACTMENU_KEY_TRANSFORM_SCALE:
if (key) { if (act) {
transform_meshchannel_keys('s', key);
}
else if (act) {
transform_actionchannel_keys ('s', 0); transform_actionchannel_keys ('s', 0);
} }
else if (key) {
transform_meshchannel_keys('s', key);
}
break; break;
case ACTMENU_KEY_TRANSFORM_SLIDE: case ACTMENU_KEY_TRANSFORM_SLIDE:
if (key) { if (act) {
//transform_meshchannel_keys('t', key);
}
else if (act) {
transform_actionchannel_keys ('t', 0); transform_actionchannel_keys ('t', 0);
} }
else if (key) {
//transform_meshchannel_keys('t', key);
}
break; break;
} }
@@ -626,17 +624,24 @@ static uiBlock *action_keymenu_transformmenu(void *arg_unused)
static void do_action_keymenu_handlemenu(void *arg, int event) static void do_action_keymenu_handlemenu(void *arg, int event)
{ {
SpaceAction *saction;
bAction *act;
Key *key; Key *key;
saction = curarea->spacedata.first;
if (!saction) return;
act = saction->action;
key = get_action_mesh_key(); key = get_action_mesh_key();
switch (event){ switch (event) {
case ACTMENU_KEY_HANDLE_AUTO: case ACTMENU_KEY_HANDLE_AUTO:
if (key) { if (act) {
sethandles_meshchannel_keys(HD_AUTO, key);
} else {
sethandles_actionchannel_keys(HD_AUTO); sethandles_actionchannel_keys(HD_AUTO);
} }
else if (key) {
sethandles_meshchannel_keys(HD_AUTO, key);
}
break; break;
case ACTMENU_KEY_HANDLE_ALIGN: case ACTMENU_KEY_HANDLE_ALIGN:
@@ -644,19 +649,21 @@ static void do_action_keymenu_handlemenu(void *arg, int event)
/* OK, this is kinda dumb, need to fix the /* OK, this is kinda dumb, need to fix the
* toggle crap in sethandles_ipo_keys() * toggle crap in sethandles_ipo_keys()
*/ */
if (key) { if (act) {
sethandles_meshchannel_keys(HD_ALIGN, key);
} else {
sethandles_actionchannel_keys(HD_ALIGN); sethandles_actionchannel_keys(HD_ALIGN);
} }
else if (key) {
sethandles_meshchannel_keys(HD_ALIGN, key);
}
break; break;
case ACTMENU_KEY_HANDLE_VECTOR: case ACTMENU_KEY_HANDLE_VECTOR:
if (key) { if (act) {
sethandles_meshchannel_keys(HD_VECT, key);
} else {
sethandles_actionchannel_keys(HD_VECT); sethandles_actionchannel_keys(HD_VECT);
} }
else if (key) {
sethandles_meshchannel_keys(HD_VECT, key);
}
break; break;
} }
} }
@@ -694,35 +701,32 @@ static uiBlock *action_keymenu_handlemenu(void *arg_unused)
static void do_action_keymenu_intpolmenu(void *arg, int event) static void do_action_keymenu_intpolmenu(void *arg, int event)
{ {
Key *key; SpaceAction *saction;
bAction *act;
//Key *key;
key = get_action_mesh_key(); saction = curarea->spacedata.first;
if (!saction) return;
act = saction->action;
//key = get_action_mesh_key();
switch(event) switch(event)
{ {
case ACTMENU_KEY_INTERP_CONST: case ACTMENU_KEY_INTERP_CONST:
if (key) { if (act)
/* to do */
}
else {
set_ipotype_actionchannels(SET_IPO_CONSTANT); set_ipotype_actionchannels(SET_IPO_CONSTANT);
} //else if (key) /* todo */
break; break;
case ACTMENU_KEY_INTERP_LINEAR: case ACTMENU_KEY_INTERP_LINEAR:
if (key) { if (act)
/* to do */
}
else {
set_ipotype_actionchannels(SET_IPO_LINEAR); set_ipotype_actionchannels(SET_IPO_LINEAR);
} //else if (key) /* todo */
break; break;
case ACTMENU_KEY_INTERP_BEZIER: case ACTMENU_KEY_INTERP_BEZIER:
if (key) { if (act)
/* to do */
}
else {
set_ipotype_actionchannels(SET_IPO_BEZIER); set_ipotype_actionchannels(SET_IPO_BEZIER);
} //else if (key) /* todo */
break; break;
} }
@@ -759,43 +763,37 @@ static uiBlock *action_keymenu_intpolmenu(void *arg_unused)
static void do_action_keymenu_extendmenu(void *arg, int event) static void do_action_keymenu_extendmenu(void *arg, int event)
{ {
Key *key; SpaceAction *saction;
bAction *act;
//Key *key;
key = get_action_mesh_key(); saction = curarea->spacedata.first;
if (!saction) return;
act = saction->action;
//key = get_action_mesh_key();
switch(event) switch(event)
{ {
case ACTMENU_KEY_EXTEND_CONST: case ACTMENU_KEY_EXTEND_CONST:
if (key) { if (act)
/* to do */
}
else {
set_extendtype_actionchannels(SET_EXTEND_CONSTANT); set_extendtype_actionchannels(SET_EXTEND_CONSTANT);
} //else if (key) /* todo */
break; break;
case ACTMENU_KEY_EXTEND_EXTRAPOLATION: case ACTMENU_KEY_EXTEND_EXTRAPOLATION:
if (key) { if (act)
/* to do */
}
else {
set_extendtype_actionchannels(SET_EXTEND_EXTRAPOLATION); set_extendtype_actionchannels(SET_EXTEND_EXTRAPOLATION);
} //else if (key) /* todo */
break; break;
case ACTMENU_KEY_EXTEND_CYCLIC: case ACTMENU_KEY_EXTEND_CYCLIC:
if (key) { if (act)
/* to do */
}
else {
set_extendtype_actionchannels(SET_EXTEND_CYCLIC); set_extendtype_actionchannels(SET_EXTEND_CYCLIC);
} //else if (key) /* todo */
break; break;
case ACTMENU_KEY_EXTEND_CYCLICEXTRAPOLATION: case ACTMENU_KEY_EXTEND_CYCLICEXTRAPOLATION:
if (key) { if (act)
/* to do */
}
else {
set_extendtype_actionchannels(SET_EXTEND_CYCLICEXTRAPOLATION); set_extendtype_actionchannels(SET_EXTEND_CYCLICEXTRAPOLATION);
} //else if (key) /* todo */
break; break;
} }
@@ -984,9 +982,8 @@ static void do_action_keymenu(void *arg, int event)
bAction *act; bAction *act;
Key *key; Key *key;
saction= curarea->spacedata.first; saction = curarea->spacedata.first;
if (!saction) if (!saction) return;
return;
act = saction->action; act = saction->action;
key = get_action_mesh_key(); key = get_action_mesh_key();
@@ -994,31 +991,31 @@ static void do_action_keymenu(void *arg, int event)
switch(event) switch(event)
{ {
case ACTMENU_KEY_DUPLICATE: case ACTMENU_KEY_DUPLICATE:
if (key) { if (act) {
duplicate_meshchannel_keys(key);
}
else if (act) {
duplicate_actionchannel_keys(); duplicate_actionchannel_keys();
remake_action_ipos(act); remake_action_ipos(act);
} }
else if (key) {
duplicate_meshchannel_keys(key);
}
break; break;
case ACTMENU_KEY_DELETE: case ACTMENU_KEY_DELETE:
if (key) { if (act) {
delete_meshchannel_keys(key);
}
else if (act) {
delete_actionchannel_keys (); delete_actionchannel_keys ();
} }
else if (key) {
delete_meshchannel_keys(key);
}
break; break;
case ACTMENU_KEY_BAKE: case ACTMENU_KEY_BAKE:
bake_action_with_client (G.saction->action, OBACT, 0.01); bake_action_with_client(G.saction->action, OBACT, 0.01);
break; break;
case ACTMENU_KEY_CLEAN: case ACTMENU_KEY_CLEAN:
if (key) if (act)
clean_shapekeys(key);
else if (act)
clean_actionchannels(act); clean_actionchannels(act);
else if (key)
clean_shapekeys(key);
break; break;
} }
} }