Bugfix #6674:
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:
@@ -356,7 +356,7 @@ static void *get_nearest_actionchannel_key (float *selx, short *sel, short *ret_
|
||||
if(VISIBLE_ACHAN(achan)) {
|
||||
if (clickmax < 0)
|
||||
break;
|
||||
if (clickmin <= 0) {
|
||||
if ((clickmin <= 0) && (achan->ipo)) {
|
||||
/* found level - action channel */
|
||||
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) {
|
||||
if (clickmax < 0)
|
||||
break;
|
||||
if (clickmin <= 0) {
|
||||
if ((clickmin <= 0) && (conchan->ipo)) {
|
||||
/* found match - constraint channel */
|
||||
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 (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) {
|
||||
if (SEL_ICU(icu)) {
|
||||
sel= 0;
|
||||
@@ -1739,7 +1739,7 @@ void deselect_actionchannels (bAction *act, int test)
|
||||
achan->flag &= ~ACHAN_SELECTED;
|
||||
|
||||
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) {
|
||||
if (sel)
|
||||
icu->flag |= IPO_SELECT;
|
||||
@@ -2578,13 +2578,13 @@ void snap_keys_to_frame(int snap_mode)
|
||||
}
|
||||
|
||||
/* snap to frame */
|
||||
if (key) {
|
||||
set_snap_meshchannels(key, snap_mode);
|
||||
}
|
||||
else if (act) {
|
||||
if (act) {
|
||||
set_snap_actionchannels(act, snap_mode);
|
||||
remake_action_ipos (act);
|
||||
}
|
||||
else if (key) {
|
||||
set_snap_meshchannels(key, snap_mode);
|
||||
}
|
||||
|
||||
BIF_undo_push(str);
|
||||
allspace(REMAKEIPO, 0);
|
||||
@@ -2680,13 +2680,13 @@ void mirror_action_keys(short mirror_mode)
|
||||
}
|
||||
|
||||
/* mirror */
|
||||
if (key) {
|
||||
mirror_meshchannels(key, mirror_mode);
|
||||
}
|
||||
else if (act) {
|
||||
if (act) {
|
||||
mirror_actionchannels(act, mirror_mode);
|
||||
remake_action_ipos (act);
|
||||
}
|
||||
else if (key) {
|
||||
mirror_meshchannels(key, mirror_mode);
|
||||
}
|
||||
|
||||
BIF_undo_push(str);
|
||||
allspace(REMAKEIPO, 0);
|
||||
@@ -3064,17 +3064,20 @@ static void numbuts_action(void)
|
||||
{
|
||||
/* now called from action window event loop, plus reacts on mouseclick */
|
||||
/* removed Hos grunts for that reason! :) (ton) */
|
||||
bAction *act;
|
||||
Key *key;
|
||||
short mval[2];
|
||||
|
||||
key = get_action_mesh_key();
|
||||
act = G.saction->action;
|
||||
|
||||
getmouseco_areawin (mval);
|
||||
|
||||
if (mval[0] < NAMEWIDTH) {
|
||||
if (key)
|
||||
clever_keyblock_names(key, mval);
|
||||
else
|
||||
if (act)
|
||||
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;
|
||||
|
||||
act=saction->action;
|
||||
key = get_action_mesh_key();
|
||||
|
||||
if (val) {
|
||||
if ( uiDoBlocks(&curarea->uiblocks, event)!=UI_NOTHING ) event= 0;
|
||||
|
||||
@@ -3115,8 +3120,6 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
|
||||
getmouseco_areawin(mval);
|
||||
|
||||
key = get_action_mesh_key();
|
||||
|
||||
switch(event) {
|
||||
case UI_BUT_EVENT:
|
||||
do_actionbuts(val); // window itself
|
||||
@@ -3127,28 +3130,7 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
break;
|
||||
|
||||
case AKEY:
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (act) {
|
||||
if (mval[0]<NAMEWIDTH) {
|
||||
deselect_actionchannels (act, 1);
|
||||
allqueue (REDRAWVIEW3D, 0);
|
||||
@@ -3173,20 +3155,33 @@ 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;
|
||||
|
||||
case BKEY:
|
||||
if (G.qual & LR_CTRLKEY)
|
||||
borderselect_markers();
|
||||
else if (key) {
|
||||
if (mval[0]<ACTWIDTH) {
|
||||
/* to do?? */
|
||||
}
|
||||
else {
|
||||
borderselect_mesh(key);
|
||||
}
|
||||
}
|
||||
else {
|
||||
else if (act) {
|
||||
/* If the border select is initiated in the
|
||||
* part of the action window where the channel
|
||||
* names reside, then select the channels
|
||||
@@ -3196,7 +3191,6 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
BIF_undo_push("Select Action");
|
||||
}
|
||||
else if (mval[0]>ACTWIDTH) {
|
||||
|
||||
/* If the border select is initiated in the
|
||||
* vertical scrollbar, then (de)select all keys
|
||||
* 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);
|
||||
}
|
||||
|
||||
/* Other wise, select the action keys
|
||||
*/
|
||||
/* Other wise, select the action keys */
|
||||
else {
|
||||
borderselect_action();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (key) {
|
||||
if (mval[0]<ACTWIDTH) {
|
||||
/* to do?? */
|
||||
}
|
||||
else {
|
||||
borderselect_mesh(key);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case CKEY:
|
||||
@@ -3235,13 +3236,13 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
duplicate_marker();
|
||||
}
|
||||
else if (G.qual == LR_SHIFTKEY) {
|
||||
if (key) {
|
||||
duplicate_meshchannel_keys(key);
|
||||
}
|
||||
else if (act) {
|
||||
if (act) {
|
||||
duplicate_actionchannel_keys();
|
||||
remake_action_ipos(act);
|
||||
}
|
||||
else if (key) {
|
||||
duplicate_meshchannel_keys(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -3252,12 +3253,12 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
}
|
||||
else {
|
||||
if (mval[0]>=ACTWIDTH) {
|
||||
if (key) {
|
||||
transform_meshchannel_keys('g', key);
|
||||
}
|
||||
else if (act) {
|
||||
if (act) {
|
||||
transform_actionchannel_keys ('g', 0);
|
||||
}
|
||||
else if (key) {
|
||||
transform_meshchannel_keys('g', key);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -3265,18 +3266,18 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
case HKEY:
|
||||
if(G.qual & LR_SHIFTKEY) {
|
||||
if(okee("Set Keys to Auto Handle")) {
|
||||
if (key)
|
||||
sethandles_meshchannel_keys(HD_AUTO, key);
|
||||
else
|
||||
if (act)
|
||||
sethandles_actionchannel_keys(HD_AUTO);
|
||||
else if (key)
|
||||
sethandles_meshchannel_keys(HD_AUTO, key);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(okee("Toggle Keys Aligned Handle")) {
|
||||
if (key)
|
||||
sethandles_meshchannel_keys(HD_ALIGN, key);
|
||||
else
|
||||
if (act)
|
||||
sethandles_actionchannel_keys(HD_ALIGN);
|
||||
else if (key)
|
||||
sethandles_meshchannel_keys(HD_ALIGN, key);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -3288,10 +3289,10 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
else {
|
||||
val= (G.qual & LR_SHIFTKEY) ? 2 : 1;
|
||||
|
||||
if(key)
|
||||
column_select_shapekeys(key, val);
|
||||
else if(act)
|
||||
if (act)
|
||||
column_select_actionkeys(act, val);
|
||||
else if (key)
|
||||
column_select_shapekeys(key, val);
|
||||
}
|
||||
|
||||
allqueue(REDRAWTIME, 0);
|
||||
@@ -3333,10 +3334,10 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
break;
|
||||
|
||||
case OKEY:
|
||||
if(key)
|
||||
clean_shapekeys(key);
|
||||
else if(act)
|
||||
if(act)
|
||||
clean_actionchannels(act);
|
||||
else if(key)
|
||||
clean_shapekeys(key);
|
||||
break;
|
||||
|
||||
case PKEY:
|
||||
@@ -3358,42 +3359,35 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
snap_keys_to_frame(val);
|
||||
}
|
||||
else {
|
||||
if (key)
|
||||
transform_meshchannel_keys('s', key);
|
||||
else if (act)
|
||||
if (act)
|
||||
transform_actionchannel_keys ('s', 0);
|
||||
else if (key)
|
||||
transform_meshchannel_keys('s', key);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
/*** set the Ipo type ***/
|
||||
case TKEY:
|
||||
if (key) {
|
||||
/* to do */
|
||||
}
|
||||
else {
|
||||
if (act) {
|
||||
if(G.qual & LR_SHIFTKEY)
|
||||
set_ipotype_actionchannels(SET_IPO_POPUP);
|
||||
else
|
||||
transform_actionchannel_keys ('t', 0);
|
||||
}
|
||||
/* else if (key) {} ... todo */
|
||||
break;
|
||||
|
||||
case VKEY:
|
||||
if(okee("Set Keys to Vector Handle")) {
|
||||
if (key)
|
||||
sethandles_meshchannel_keys(HD_VECT, key);
|
||||
else
|
||||
if (act)
|
||||
sethandles_actionchannel_keys(HD_VECT);
|
||||
else if (key)
|
||||
sethandles_meshchannel_keys(HD_VECT, key);
|
||||
}
|
||||
break;
|
||||
|
||||
case PAGEUPKEY:
|
||||
if (key) {
|
||||
/* only jump to markers possible (key channels can't be moved yet) */
|
||||
nextprev_marker(1);
|
||||
}
|
||||
else {
|
||||
if (act) {
|
||||
if(G.qual & LR_SHIFTKEY)
|
||||
top_sel_action();
|
||||
else if (G.qual & LR_CTRLKEY)
|
||||
@@ -3401,13 +3395,13 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
else
|
||||
nextprev_marker(1);
|
||||
}
|
||||
else if (key) {
|
||||
/* only jump to markers possible (key channels can't be moved yet) */
|
||||
nextprev_marker(1);
|
||||
}
|
||||
break;
|
||||
case PAGEDOWNKEY:
|
||||
if (key) {
|
||||
/* only jump to markers possible (key channels can't be moved yet) */
|
||||
nextprev_marker(-1);
|
||||
}
|
||||
else {
|
||||
if (act) {
|
||||
if(G.qual & LR_SHIFTKEY)
|
||||
bottom_sel_action();
|
||||
else if (G.qual & LR_CTRLKEY)
|
||||
@@ -3415,19 +3409,24 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
else
|
||||
nextprev_marker(-1);
|
||||
}
|
||||
else if (key) {
|
||||
/* only jump to markers possible (key channels can't be moved yet) */
|
||||
nextprev_marker(-1);
|
||||
}
|
||||
break;
|
||||
|
||||
case DELKEY:
|
||||
case XKEY:
|
||||
if (okee("Erase selected")) {
|
||||
if (key) {
|
||||
delete_meshchannel_keys(key);
|
||||
}
|
||||
else {
|
||||
if (act) {
|
||||
if (mval[0]<NAMEWIDTH)
|
||||
delete_actionchannels();
|
||||
else
|
||||
delete_actionchannel_keys();
|
||||
}
|
||||
else if (key) {
|
||||
delete_meshchannel_keys(key);
|
||||
}
|
||||
|
||||
if (mval[0] >= NAMEWIDTH)
|
||||
remove_marker();
|
||||
@@ -3439,6 +3438,7 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
allqueue(REDRAWSOUND, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
/* LEFTMOUSE and RIGHTMOUSE event codes can be swapped above,
|
||||
* based on user preference USER_LMOUSESELECT
|
||||
*/
|
||||
@@ -3504,18 +3504,18 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
||||
* selects keys and markers
|
||||
*/
|
||||
else {
|
||||
if (key) {
|
||||
if(G.qual & LR_SHIFTKEY)
|
||||
mouse_mesh_action(SELECT_INVERT, key);
|
||||
else
|
||||
mouse_mesh_action(SELECT_REPLACE, key);
|
||||
}
|
||||
else {
|
||||
if (act) {
|
||||
if(G.qual & LR_SHIFTKEY)
|
||||
mouse_action(SELECT_INVERT);
|
||||
else
|
||||
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;
|
||||
@@ -3577,7 +3577,8 @@ Key *get_action_mesh_key(void)
|
||||
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
|
||||
* y value of the mouse click. Does not check
|
||||
* if this is a valid keynum. Also gives the Ipo
|
||||
@@ -3734,11 +3735,7 @@ void markers_selectkeys_between(void)
|
||||
key = get_action_mesh_key();
|
||||
|
||||
/* select keys in-between */
|
||||
if (key) {
|
||||
if (key->ipo)
|
||||
borderselect_ipo_key(key->ipo, min, max, SELECT_ADD);
|
||||
}
|
||||
else if (act) {
|
||||
if (act) {
|
||||
bActionChannel *achan;
|
||||
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 *********************************** */
|
||||
@@ -3841,8 +3842,7 @@ void up_sel_action()
|
||||
achan->flag = achan->flag & ~ACHAN_MOVED;
|
||||
}
|
||||
|
||||
/* Clean up and redraw stuff
|
||||
*/
|
||||
/* Clean up and redraw stuff */
|
||||
remake_action_ipos (act);
|
||||
BIF_undo_push("Up Action channel");
|
||||
allspace(REMAKEIPO, 0);
|
||||
@@ -3887,8 +3887,7 @@ void down_sel_action()
|
||||
achan->flag = achan->flag & ~ACHAN_MOVED;
|
||||
}
|
||||
|
||||
/* Clean up and redraw stuff
|
||||
*/
|
||||
/* Clean up and redraw stuff */
|
||||
remake_action_ipos (act);
|
||||
BIF_undo_push("Down Action channel");
|
||||
allspace(REMAKEIPO, 0);
|
||||
@@ -3922,8 +3921,7 @@ void bottom_sel_action()
|
||||
achan->flag = achan->flag & ~ACHAN_MOVED;
|
||||
}
|
||||
|
||||
/* Clean up and redraw stuff
|
||||
*/
|
||||
/* Clean up and redraw stuff */
|
||||
remake_action_ipos (act);
|
||||
BIF_undo_push("Bottom Action channel");
|
||||
allspace(REMAKEIPO, 0);
|
||||
|
||||
@@ -153,17 +153,11 @@ void do_action_buttons(unsigned short event)
|
||||
bake_action_with_client(G.saction->action, ob, 0.01);
|
||||
break;
|
||||
case B_ACTHOME:
|
||||
// Find X extents
|
||||
//v2d= &(G.saction->v2d);
|
||||
|
||||
/* Find X extents */
|
||||
G.v2d->cur.xmin = 0;
|
||||
G.v2d->cur.ymin=-SCROLLB;
|
||||
|
||||
if (!G.saction->action){ // here the mesh rvk?
|
||||
G.v2d->cur.xmax= -5;
|
||||
G.v2d->cur.xmax= 100;
|
||||
}
|
||||
else {
|
||||
if (G.saction->action) {
|
||||
float extra;
|
||||
|
||||
calc_action_range(G.saction->action, &G.v2d->cur.xmin, &G.v2d->cur.xmax, 0);
|
||||
@@ -180,6 +174,10 @@ void do_action_buttons(unsigned short event)
|
||||
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.ymax= 1000.0f;
|
||||
|
||||
@@ -207,7 +205,6 @@ void do_action_buttons(unsigned short event)
|
||||
/* if (G.saction->flag & SACTION_PIN) {
|
||||
if (G.saction->action)
|
||||
G.saction->action->id.us ++;
|
||||
|
||||
}
|
||||
else {
|
||||
if (G.saction->action)
|
||||
@@ -216,7 +213,6 @@ void do_action_buttons(unsigned short event)
|
||||
*/ /* end PINFAKE */
|
||||
allqueue(REDRAWACTION, 1);
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -357,6 +353,8 @@ static void do_action_selectmenu_columnmenu(void *arg, int event)
|
||||
Key *key;
|
||||
|
||||
saction = curarea->spacedata.first;
|
||||
if (!saction) return;
|
||||
|
||||
act = saction->action;
|
||||
key = get_action_mesh_key();
|
||||
|
||||
@@ -364,10 +362,10 @@ static void do_action_selectmenu_columnmenu(void *arg, int event)
|
||||
markers_selectkeys_between();
|
||||
}
|
||||
else if (ELEM(event, ACTMENU_SEL_COLUMN_KEYS, ACTMENU_SEL_COLUMN_MARKERSCOLUMN)) {
|
||||
if (key)
|
||||
column_select_shapekeys(key, event);
|
||||
else if (act)
|
||||
if (act)
|
||||
column_select_actionkeys(act, event);
|
||||
else if (key)
|
||||
column_select_shapekeys(key, event);
|
||||
}
|
||||
else
|
||||
return;
|
||||
@@ -412,8 +410,7 @@ static void do_action_selectmenu(void *arg, int event)
|
||||
Key *key;
|
||||
|
||||
saction = curarea->spacedata.first;
|
||||
if (!saction)
|
||||
return;
|
||||
if (!saction) return;
|
||||
|
||||
act = saction->action;
|
||||
key = get_action_mesh_key();
|
||||
@@ -421,12 +418,12 @@ static void do_action_selectmenu(void *arg, int event)
|
||||
switch(event)
|
||||
{
|
||||
case ACTMENU_SEL_BORDER: /* Border Select */
|
||||
if (key) {
|
||||
borderselect_mesh(key);
|
||||
}
|
||||
else {
|
||||
if (act) {
|
||||
borderselect_action();
|
||||
}
|
||||
else if (key) {
|
||||
borderselect_mesh(key);
|
||||
}
|
||||
break;
|
||||
|
||||
case ACTMENU_SEL_BORDERM: /* Border Select */
|
||||
@@ -434,14 +431,14 @@ static void do_action_selectmenu(void *arg, int event)
|
||||
break;
|
||||
|
||||
case ACTMENU_SEL_ALL_KEYS: /* Select/Deselect All Keys */
|
||||
if (key) {
|
||||
deselect_meshchannel_keys(key, 1, 1);
|
||||
if (act) {
|
||||
deselect_actionchannel_keys (act, 1, 1);
|
||||
allqueue (REDRAWACTION, 0);
|
||||
allqueue(REDRAWNLA, 0);
|
||||
allqueue (REDRAWIPO, 0);
|
||||
}
|
||||
else {
|
||||
deselect_actionchannel_keys (act, 1, 1);
|
||||
else if (key) {
|
||||
deselect_meshchannel_keys(key, 1, 1);
|
||||
allqueue (REDRAWACTION, 0);
|
||||
allqueue(REDRAWNLA, 0);
|
||||
allqueue (REDRAWIPO, 0);
|
||||
@@ -466,14 +463,14 @@ static void do_action_selectmenu(void *arg, int event)
|
||||
break;
|
||||
|
||||
case ACTMENU_SEL_INVERSE_KEYS: /* invert selection status of keys */
|
||||
if (key) {
|
||||
deselect_meshchannel_keys(key, 0, 2);
|
||||
if (act) {
|
||||
deselect_actionchannel_keys(act, 0, 2);
|
||||
allqueue (REDRAWACTION, 0);
|
||||
allqueue(REDRAWNLA, 0);
|
||||
allqueue (REDRAWIPO, 0);
|
||||
}
|
||||
else {
|
||||
deselect_actionchannel_keys (act, 0, 2);
|
||||
else if (key) {
|
||||
deselect_meshchannel_keys(key, 0, 2);
|
||||
allqueue (REDRAWACTION, 0);
|
||||
allqueue(REDRAWNLA, 0);
|
||||
allqueue (REDRAWIPO, 0);
|
||||
@@ -562,36 +559,37 @@ static void do_action_keymenu_transformmenu(void *arg, int event)
|
||||
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)
|
||||
{
|
||||
case ACTMENU_KEY_TRANSFORM_MOVE:
|
||||
if (key) {
|
||||
transform_meshchannel_keys('g', key);
|
||||
}
|
||||
else if (act) {
|
||||
if (act) {
|
||||
transform_actionchannel_keys ('g', 0);
|
||||
}
|
||||
else if (key) {
|
||||
transform_meshchannel_keys('g', key);
|
||||
}
|
||||
break;
|
||||
case ACTMENU_KEY_TRANSFORM_SCALE:
|
||||
if (key) {
|
||||
transform_meshchannel_keys('s', key);
|
||||
}
|
||||
else if (act) {
|
||||
if (act) {
|
||||
transform_actionchannel_keys ('s', 0);
|
||||
}
|
||||
else if (key) {
|
||||
transform_meshchannel_keys('s', key);
|
||||
}
|
||||
break;
|
||||
case ACTMENU_KEY_TRANSFORM_SLIDE:
|
||||
if (key) {
|
||||
//transform_meshchannel_keys('t', key);
|
||||
}
|
||||
else if (act) {
|
||||
if (act) {
|
||||
transform_actionchannel_keys ('t', 0);
|
||||
}
|
||||
else if (key) {
|
||||
//transform_meshchannel_keys('t', key);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -626,17 +624,24 @@ static uiBlock *action_keymenu_transformmenu(void *arg_unused)
|
||||
|
||||
static void do_action_keymenu_handlemenu(void *arg, int event)
|
||||
{
|
||||
SpaceAction *saction;
|
||||
bAction *act;
|
||||
Key *key;
|
||||
|
||||
saction = curarea->spacedata.first;
|
||||
if (!saction) return;
|
||||
|
||||
act = saction->action;
|
||||
key = get_action_mesh_key();
|
||||
|
||||
switch (event) {
|
||||
case ACTMENU_KEY_HANDLE_AUTO:
|
||||
if (key) {
|
||||
sethandles_meshchannel_keys(HD_AUTO, key);
|
||||
} else {
|
||||
if (act) {
|
||||
sethandles_actionchannel_keys(HD_AUTO);
|
||||
}
|
||||
else if (key) {
|
||||
sethandles_meshchannel_keys(HD_AUTO, key);
|
||||
}
|
||||
break;
|
||||
|
||||
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
|
||||
* toggle crap in sethandles_ipo_keys()
|
||||
*/
|
||||
if (key) {
|
||||
sethandles_meshchannel_keys(HD_ALIGN, key);
|
||||
} else {
|
||||
if (act) {
|
||||
sethandles_actionchannel_keys(HD_ALIGN);
|
||||
}
|
||||
else if (key) {
|
||||
sethandles_meshchannel_keys(HD_ALIGN, key);
|
||||
}
|
||||
break;
|
||||
|
||||
case ACTMENU_KEY_HANDLE_VECTOR:
|
||||
if (key) {
|
||||
sethandles_meshchannel_keys(HD_VECT, key);
|
||||
} else {
|
||||
if (act) {
|
||||
sethandles_actionchannel_keys(HD_VECT);
|
||||
}
|
||||
else if (key) {
|
||||
sethandles_meshchannel_keys(HD_VECT, key);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -694,35 +701,32 @@ static uiBlock *action_keymenu_handlemenu(void *arg_unused)
|
||||
|
||||
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)
|
||||
{
|
||||
case ACTMENU_KEY_INTERP_CONST:
|
||||
if (key) {
|
||||
/* to do */
|
||||
}
|
||||
else {
|
||||
if (act)
|
||||
set_ipotype_actionchannels(SET_IPO_CONSTANT);
|
||||
}
|
||||
//else if (key) /* todo */
|
||||
break;
|
||||
case ACTMENU_KEY_INTERP_LINEAR:
|
||||
if (key) {
|
||||
/* to do */
|
||||
}
|
||||
else {
|
||||
if (act)
|
||||
set_ipotype_actionchannels(SET_IPO_LINEAR);
|
||||
}
|
||||
//else if (key) /* todo */
|
||||
break;
|
||||
case ACTMENU_KEY_INTERP_BEZIER:
|
||||
if (key) {
|
||||
/* to do */
|
||||
}
|
||||
else {
|
||||
if (act)
|
||||
set_ipotype_actionchannels(SET_IPO_BEZIER);
|
||||
}
|
||||
//else if (key) /* todo */
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -759,43 +763,37 @@ static uiBlock *action_keymenu_intpolmenu(void *arg_unused)
|
||||
|
||||
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)
|
||||
{
|
||||
case ACTMENU_KEY_EXTEND_CONST:
|
||||
if (key) {
|
||||
/* to do */
|
||||
}
|
||||
else {
|
||||
if (act)
|
||||
set_extendtype_actionchannels(SET_EXTEND_CONSTANT);
|
||||
}
|
||||
//else if (key) /* todo */
|
||||
break;
|
||||
case ACTMENU_KEY_EXTEND_EXTRAPOLATION:
|
||||
if (key) {
|
||||
/* to do */
|
||||
}
|
||||
else {
|
||||
if (act)
|
||||
set_extendtype_actionchannels(SET_EXTEND_EXTRAPOLATION);
|
||||
}
|
||||
//else if (key) /* todo */
|
||||
break;
|
||||
case ACTMENU_KEY_EXTEND_CYCLIC:
|
||||
if (key) {
|
||||
/* to do */
|
||||
}
|
||||
else {
|
||||
if (act)
|
||||
set_extendtype_actionchannels(SET_EXTEND_CYCLIC);
|
||||
}
|
||||
//else if (key) /* todo */
|
||||
break;
|
||||
case ACTMENU_KEY_EXTEND_CYCLICEXTRAPOLATION:
|
||||
if (key) {
|
||||
/* to do */
|
||||
}
|
||||
else {
|
||||
if (act)
|
||||
set_extendtype_actionchannels(SET_EXTEND_CYCLICEXTRAPOLATION);
|
||||
}
|
||||
//else if (key) /* todo */
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -985,8 +983,7 @@ static void do_action_keymenu(void *arg, int event)
|
||||
Key *key;
|
||||
|
||||
saction = curarea->spacedata.first;
|
||||
if (!saction)
|
||||
return;
|
||||
if (!saction) return;
|
||||
|
||||
act = saction->action;
|
||||
key = get_action_mesh_key();
|
||||
@@ -994,31 +991,31 @@ static void do_action_keymenu(void *arg, int event)
|
||||
switch(event)
|
||||
{
|
||||
case ACTMENU_KEY_DUPLICATE:
|
||||
if (key) {
|
||||
duplicate_meshchannel_keys(key);
|
||||
}
|
||||
else if (act) {
|
||||
if (act) {
|
||||
duplicate_actionchannel_keys();
|
||||
remake_action_ipos(act);
|
||||
}
|
||||
else if (key) {
|
||||
duplicate_meshchannel_keys(key);
|
||||
}
|
||||
break;
|
||||
|
||||
case ACTMENU_KEY_DELETE:
|
||||
if (key) {
|
||||
delete_meshchannel_keys(key);
|
||||
}
|
||||
else if (act) {
|
||||
if (act) {
|
||||
delete_actionchannel_keys ();
|
||||
}
|
||||
else if (key) {
|
||||
delete_meshchannel_keys(key);
|
||||
}
|
||||
break;
|
||||
case ACTMENU_KEY_BAKE:
|
||||
bake_action_with_client(G.saction->action, OBACT, 0.01);
|
||||
break;
|
||||
case ACTMENU_KEY_CLEAN:
|
||||
if (key)
|
||||
clean_shapekeys(key);
|
||||
else if (act)
|
||||
if (act)
|
||||
clean_actionchannels(act);
|
||||
else if (key)
|
||||
clean_shapekeys(key);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user