diff options
-rw-r--r-- | source/blender/include/BIF_space.h | 3 | ||||
-rw-r--r-- | source/blender/include/BSE_editaction.h | 2 | ||||
-rw-r--r-- | source/blender/include/BSE_editipo.h | 1 | ||||
-rw-r--r-- | source/blender/include/BSE_editipo_types.h | 4 | ||||
-rw-r--r-- | source/blender/include/ipo.h | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_action_types.h | 2 | ||||
-rw-r--r-- | source/blender/src/drawaction.c | 90 | ||||
-rw-r--r-- | source/blender/src/editaction.c | 357 | ||||
-rw-r--r-- | source/blender/src/editipo.c | 148 | ||||
-rw-r--r-- | source/blender/src/editkey.c | 3 | ||||
-rw-r--r-- | source/blender/src/header_action.c | 3 | ||||
-rw-r--r-- | source/blender/src/interface.c | 7 | ||||
-rw-r--r-- | source/blender/src/toets.c | 1 | ||||
-rw-r--r-- | source/blender/src/toolbox.c | 33 |
14 files changed, 290 insertions, 366 deletions
diff --git a/source/blender/include/BIF_space.h b/source/blender/include/BIF_space.h index 54984003904..f0849b6d853 100644 --- a/source/blender/include/BIF_space.h +++ b/source/blender/include/BIF_space.h @@ -60,6 +60,9 @@ struct BWinEvent; /* image handler codes */ #define IMAGE_HANDLER_PROPERTIES 30 +/* image handler codes */ +#define ACTION_HANDLER_PROPERTIES 30 + void scrarea_do_windraw (struct ScrArea *sa); diff --git a/source/blender/include/BSE_editaction.h b/source/blender/include/BSE_editaction.h index 13539c111f0..d3ef1e71dc2 100644 --- a/source/blender/include/BSE_editaction.h +++ b/source/blender/include/BSE_editaction.h @@ -57,6 +57,6 @@ void select_actionchannel_by_name (struct bAction *act, char *name, int select); struct bAction *bake_action_with_client (struct bAction *act, struct Object *arm, float tolerance); struct Key *get_action_mesh_key(void); int get_nearest_key_num(struct Key *key, short *mval, float *x); -void stupid_damn_numbuts_action(void); + #endif /* BSE_EDITACTION_H */ diff --git a/source/blender/include/BSE_editipo.h b/source/blender/include/BSE_editipo.h index b45ee836618..a3f82a83b06 100644 --- a/source/blender/include/BSE_editipo.h +++ b/source/blender/include/BSE_editipo.h @@ -131,7 +131,6 @@ void nextkey_ipo(int dir); void nextkey_obipo(int dir); void remake_ipo_transverts(struct TransVert *transmain, float *dvec, int tot); void transform_ipo(int mode); -void clever_numbuts_ipo(void); void filter_sampledata(float *data, int sfra, int efra); void sampledata_to_ipocurve(float *data, int sfra, int efra, struct IpoCurve *icu); void ipo_record(void); diff --git a/source/blender/include/BSE_editipo_types.h b/source/blender/include/BSE_editipo_types.h index b21cdcee7aa..8ee67638e7c 100644 --- a/source/blender/include/BSE_editipo_types.h +++ b/source/blender/include/BSE_editipo_types.h @@ -35,6 +35,8 @@ struct BezTriple; +// warn these structs are still in ipo.h! + typedef struct IpoKey { struct IpoKey *next, *prev; short flag, rt; @@ -43,7 +45,7 @@ typedef struct IpoKey { } IpoKey; typedef struct EditIpo { - char name[12]; + char name[32]; // same length as keyblock->name IpoCurve *icu; short adrcode, flag; short disptype, rt; diff --git a/source/blender/include/ipo.h b/source/blender/include/ipo.h index 4336076dfd1..764377170d9 100644 --- a/source/blender/include/ipo.h +++ b/source/blender/include/ipo.h @@ -47,7 +47,7 @@ typedef struct IpoKey { } IpoKey; typedef struct EditIpo { - char name[12]; + char name[32]; IpoCurve *icu; short adrcode, flag; short disptype, rt; diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h index db49b45f61c..94c9bcf5d88 100644 --- a/source/blender/makesdna/DNA_action_types.h +++ b/source/blender/makesdna/DNA_action_types.h @@ -85,6 +85,8 @@ typedef struct SpaceAction { float blockscale; struct ScrArea *area; + short blockhandler[8]; + View2D v2d; bAction *action; int flag; diff --git a/source/blender/src/drawaction.c b/source/blender/src/drawaction.c index 13c2e24f369..04aac1f67ec 100644 --- a/source/blender/src/drawaction.c +++ b/source/blender/src/drawaction.c @@ -73,6 +73,7 @@ #include "BIF_screen.h" #include "BIF_interface.h" #include "BIF_mywindow.h" +#include "BIF_space.h" #include "BDR_editcurve.h" #include "BSE_view.h" @@ -114,6 +115,7 @@ void meshactionbuts(SpaceAction *saction, Key *key) char str[64]; float x, y; uiBlock *block; + uiBut *but; #define XIC 20 #define YIC 20 @@ -146,20 +148,26 @@ void meshactionbuts(SpaceAction *saction, Key *key) if (!showsliders) { ACTWIDTH = NAMEWIDTH; - uiDefIconButS(block, TOG, B_FLIPINFOMENU, + but=uiDefIconButS(block, TOG, B_REDR, ICON_DISCLOSURE_TRI_RIGHT, NAMEWIDTH - XIC - 5, y + CHANNELHEIGHT, XIC,YIC-2, &(showsliders), 0, 0, 0, 0, "Show action window sliders"); + // no hilite, the winmatrix is not correct later on... + uiButSetFlag(but, UI_NO_HILITE); + } else { - uiDefIconButS(block, TOG, B_FLIPINFOMENU, + but= uiDefIconButS(block, TOG, B_REDR, ICON_DISCLOSURE_TRI_DOWN, NAMEWIDTH - XIC - 5, y + CHANNELHEIGHT, XIC,YIC-2, &(showsliders), 0, 0, 0, 0, "Hide action window sliders"); + // no hilite, the winmatrix is not correct later on... + uiButSetFlag(but, UI_NO_HILITE); + ACTWIDTH = NAMEWIDTH + SLIDERWIDTH; /* sliders are open so draw them */ @@ -251,7 +259,8 @@ static void draw_action_channel_names(bAction *act) } -static void draw_action_mesh_names(Key *key) { +static void draw_action_mesh_names(Key *key) +{ /* draws the names of the rvk keys in the * left side of the action window */ @@ -325,21 +334,18 @@ static void draw_channel_names(void) glColor3ub(0x00, 0x00, 0x00); act=G.saction->action; - - + if (act) { /* if there is a selected action then * draw the channel names */ draw_action_channel_names(act); } - else { - if ( (key = get_action_mesh_key()) ) { - /* if there is a mesh selected with rvk's, - * then draw the RVK names - */ - draw_action_mesh_names(key); - } + if ( (key = get_action_mesh_key()) ) { + /* if there is a mesh selected with rvk's, + * then draw the RVK names + */ + draw_action_mesh_names(key); } myortho2(0, NAMEWIDTH, 0, (ofsy+G.v2d->mask.ymax) - @@ -522,6 +528,54 @@ static void draw_mesh_strips(SpaceAction *saction, Key *key) glaEnd2DDraw(di); } +/* ********* action panel *********** */ + + +void do_actionbuts(unsigned short event) +{ + switch(event) { + case REDRAWVIEW3D: + allqueue(REDRAWVIEW3D, 0); + break; + case B_REDR: + allqueue(REDRAWACTION, 0); + break; + } +} + + +static void action_panel_properties(short cntrl) // ACTION_HANDLER_PROPERTIES +{ + uiBlock *block; + + block= uiNewBlock(&curarea->uiblocks, "action_panel_properties", UI_EMBOSS, UI_HELV, curarea->win); + uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl); + uiSetPanelHandler(ACTION_HANDLER_PROPERTIES); // for close and esc + if(uiNewPanel(curarea, block, "Transform Properties", "Action", 10, 230, 318, 204)==0) return; + + uiDefBut(block, LABEL, 0, "test text", 10,180,300,19, 0, 0, 0, 0, 0, ""); + +} + +static void action_blockhandlers(ScrArea *sa) +{ + SpaceAction *sact= sa->spacedata.first; + short a; + + for(a=0; a<SPACE_MAXHANDLER; a+=2) { + switch(sact->blockhandler[a]) { + + case IMAGE_HANDLER_PROPERTIES: + action_panel_properties(sact->blockhandler[a+1]); + break; + + } + /* clear action value for event */ + sact->blockhandler[a+1]= 0; + } + uiDrawBlocksPanels(sa, 0); +} + void drawactionspace(ScrArea *sa, void *spacedata) { short ofsx = 0, ofsy = 0; @@ -532,6 +586,9 @@ void drawactionspace(ScrArea *sa, void *spacedata) if (!G.saction) return; + /* warning; blocks need to be freed each time, handlers dont remove */ + uiFreeBlocksWin(&sa->uiblocks, sa->win); + if (!G.saction->pin) { if (OBACT) G.saction->action = OBACT->action; @@ -552,7 +609,7 @@ void drawactionspace(ScrArea *sa, void *spacedata) maxymin = key->totkey*(CHANNELHEIGHT+CHANNELSKIP); if (G.v2d->cur.ymin > maxymin) G.v2d->cur.ymin = maxymin; } - + /* Lets make sure the width of the left hand of the screen * is set to an appropriate value based on whether sliders * are showing of not @@ -582,6 +639,8 @@ void drawactionspace(ScrArea *sa, void *spacedata) glClear(GL_COLOR_BUFFER_BIT); myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax); + bwin_clear_viewmat(sa->win); /* clear buttons view */ + glLoadIdentity(); /* Draw backdrop */ calc_ipogrid(); @@ -631,6 +690,11 @@ void drawactionspace(ScrArea *sa, void *spacedata) mywinset(curarea->win); // reset scissor too myortho2(-0.375, curarea->winx-0.375, -0.375, curarea->winy-0.375); draw_area_emboss(sa); + + /* it is important to end a view in a transform compatible with buttons */ + bwin_scalematrix(sa->win, G.saction->blockscale, G.saction->blockscale, G.saction->blockscale); + action_blockhandlers(sa); + curarea->win_swap= WIN_BACK_OK; } diff --git a/source/blender/src/editaction.c b/source/blender/src/editaction.c index 79debbc567b..7917815ff52 100644 --- a/source/blender/src/editaction.c +++ b/source/blender/src/editaction.c @@ -2149,17 +2149,80 @@ static void borderselect_function(void (*select_func)(bAction *act, } +static void clever_keyblock_names(Key *key, short* mval){ + int but=0, i, keynum; + char str[64]; + float x; + KeyBlock *kb; + /* get the keynum cooresponding to the y value + * of the mouse pointer, return if this is + * an invalid key number (and we don't deal + * with the speed ipo). + */ + + keynum = get_nearest_key_num(key, mval, &x); + if ( (keynum < 1) || (keynum >= key->totkey) ) + return; + + kb= key->block.first; + for (i=0; i<keynum; ++i) kb = kb->next; + + if (kb->name[0] == '\0') { + sprintf(str, "Key %d", keynum); + } + else { + strcpy(str, kb->name); + } + + if ( (kb->slidermin >= kb->slidermax) ) { + kb->slidermin = 0.0; + kb->slidermax = 1.0; + } + + add_numbut(but++, TEX, "KB: ", 0, 24, str, + "Does this really need a tool tip?"); + add_numbut(but++, NUM|FLO, "Slider min:", + -10000, kb->slidermax, &kb->slidermin, 0); + add_numbut(but++, NUM|FLO, "Slider max:", + kb->slidermin, 10000, &kb->slidermax, 0); + + if (do_clever_numbuts(str, but, REDRAW)) { + strcpy(kb->name, str); + allqueue (REDRAWACTION, 0); + allspace(REMAKEIPO, 0); + allqueue (REDRAWIPO, 0); + } + + +} + +static void numbuts_action(void) +{ + /* now called from action window event loop, plus reacts on mouseclick */ + /* removed Hos grunts for that reason! :) (ton) */ + Key *key; + short mval[2]; + + if ( (key = get_action_mesh_key()) ) { + getmouseco_areawin (mval); + if (mval[0]<NAMEWIDTH) { + clever_keyblock_names(key, mval); + } + } +} + void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt) { - unsigned short event= evt->event; - short val= evt->val; + extern void do_actionbuts(unsigned short event); // drawaction.c SpaceAction *saction; bAction *act; - int doredraw= 0; - short mval[2]; + Key *key; float dx,dy; + int doredraw= 0; int cfra; - Key *key; + short mval[2]; + unsigned short event= evt->event; + short val= evt->val; if(curarea->win==0) return; @@ -2178,67 +2241,10 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt) switch(event) { case UI_BUT_EVENT: - do_butspace(val); // abuse! + do_actionbuts(val); // window itself break; case HOMEKEY: - do_action_buttons(B_ACTHOME); - break; - - case CKEY: - /* scroll the window so the current - * frame is in the center. - */ - center_currframe(); - break; - - case DKEY: - if (key) { - if (G.qual & LR_SHIFTKEY && mval[0]>ACTWIDTH) { - duplicate_meshchannel_keys(key); - } - } - else { - if (G.qual & LR_SHIFTKEY && mval[0]>ACTWIDTH){ - duplicate_actionchannel_keys(); - remake_action_ipos(act); - } - } - break; - - case DELKEY: - - case XKEY: - if (key) { - delete_meshchannel_keys(key); - } - else { - if (mval[0]<NAMEWIDTH) - delete_actionchannels (); - else - delete_actionchannel_keys (); - } - break; - - case GKEY: - if (mval[0]>=ACTWIDTH) { - if (key) { - transform_meshchannel_keys('g', key); - } - else { - transform_actionchannel_keys ('g'); - } - } - break; - - case SKEY: - if (mval[0]>=ACTWIDTH) { - if (key) { - transform_meshchannel_keys('s', key); - } - else { - transform_actionchannel_keys ('s'); - } - } + do_action_buttons(B_ACTHOME); // header break; case AKEY: @@ -2270,44 +2276,6 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt) } break; - case VKEY: - if (key) { - sethandles_meshchannel_keys(HD_VECT, key); - /* to do */ - } - else { - sethandles_actionchannel_keys(HD_VECT); - } - break; - case HKEY: - if (key) { - if(G.qual & LR_SHIFTKEY) { - sethandles_meshchannel_keys(HD_AUTO, key); - } - else { - sethandles_meshchannel_keys(HD_ALIGN, key); - } - } - else { - if(G.qual & LR_SHIFTKEY) { - sethandles_actionchannel_keys(HD_AUTO); - } - else { - sethandles_actionchannel_keys(HD_ALIGN); - } - } - break; - - /*** set the Ipo type ***/ - case TKEY: - if (key) { - /* to do */ - } - else { - set_ipotype_actionchannels(SET_IPO_POPUP); - } - break; - case BKEY: if (key) { if (mval[0]<ACTWIDTH){ @@ -2353,6 +2321,111 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt) } break; + case CKEY: + /* scroll the window so the current + * frame is in the center. + */ + center_currframe(); + break; + + case DKEY: + if (key) { + if (G.qual & LR_SHIFTKEY && mval[0]>ACTWIDTH) { + duplicate_meshchannel_keys(key); + } + } + else { + if (G.qual & LR_SHIFTKEY && mval[0]>ACTWIDTH){ + duplicate_actionchannel_keys(); + remake_action_ipos(act); + } + } + break; + + case GKEY: + if (mval[0]>=ACTWIDTH) { + if (key) { + transform_meshchannel_keys('g', key); + } + else { + transform_actionchannel_keys ('g'); + } + } + break; + + case HKEY: + if (key) { + if(G.qual & LR_SHIFTKEY) { + sethandles_meshchannel_keys(HD_AUTO, key); + } + else { + sethandles_meshchannel_keys(HD_ALIGN, key); + } + } + else { + if(G.qual & LR_SHIFTKEY) { + sethandles_actionchannel_keys(HD_AUTO); + } + else { + sethandles_actionchannel_keys(HD_ALIGN); + } + } + break; + + case NKEY: + if(G.qual==0) { + numbuts_action(); + + /* no panel (yet). current numbuts are not easy to put in panel... */ + //add_blockhandler(curarea, ACTION_HANDLER_PROPERTIES, UI_PNL_TO_MOUSE); + //scrarea_queue_winredraw(curarea); + } + break; + + case SKEY: + if (mval[0]>=ACTWIDTH) { + if (key) { + transform_meshchannel_keys('s', key); + } + else { + transform_actionchannel_keys ('s'); + } + } + break; + + /*** set the Ipo type ***/ + case TKEY: + if (key) { + /* to do */ + } + else { + set_ipotype_actionchannels(SET_IPO_POPUP); + } + break; + + case VKEY: + if (key) { + sethandles_meshchannel_keys(HD_VECT, key); + /* to do */ + } + else { + sethandles_actionchannel_keys(HD_VECT); + } + break; + + case DELKEY: + case XKEY: + if (key) { + delete_meshchannel_keys(key); + } + else { + if (mval[0]<NAMEWIDTH) + delete_actionchannels (); + else + delete_actionchannel_keys (); + } + break; + case LEFTMOUSE: if (mval[0]>ACTWIDTH){ do { @@ -2380,12 +2453,13 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt) * channel or constraint channel */ if (mval[0]<NAMEWIDTH) { - if(G.qual & LR_SHIFTKEY) - mouse_actionchannels(act, mval, NULL, - SELECT_INVERT); - else - mouse_actionchannels(act, mval, NULL, - SELECT_REPLACE); + if(act) { + if(G.qual & LR_SHIFTKEY) + mouse_actionchannels(act, mval, NULL, SELECT_INVERT); + else + mouse_actionchannels(act, mval, NULL, SELECT_REPLACE); + } + else numbuts_action(); } else if (mval[0]>ACTWIDTH) { @@ -2494,71 +2568,4 @@ int get_nearest_key_num(Key *key, short *mval, float *x) { return (num + 1); } -static void clever_keyblock_names(Key *key, short* mval){ - int but=0, i, keynum; - char str[64]; - float x; - KeyBlock *kb; - /* get the keynum cooresponding to the y value - * of the mouse pointer, return if this is - * an invalid key number (and we don't deal - * with the speed ipo). - */ - - keynum = get_nearest_key_num(key, mval, &x); - if ( (keynum < 1) || (keynum >= key->totkey) ) - return; - - kb= key->block.first; - for (i=0; i<keynum; ++i) kb = kb->next; - - if (kb->name[0] == '\0') { - sprintf(str, "Key %d", keynum); - } - else { - strcpy(str, kb->name); - } - - if ( (kb->slidermin >= kb->slidermax) ) { - kb->slidermin = 0.0; - kb->slidermax = 1.0; - } - - add_numbut(but++, TEX, "KB: ", 0, 24, str, - "Does this really need a tool tip?"); - add_numbut(but++, NUM|FLO, "Slider min:", - -10000, kb->slidermax, &kb->slidermin, 0); - add_numbut(but++, NUM|FLO, "Slider max:", - kb->slidermin, 10000, &kb->slidermax, 0); - - if (do_clever_numbuts(str, but, REDRAW)) { - strcpy(kb->name, str); - allqueue (REDRAWACTION, 0); - allqueue (REDRAWIPO, 0); - } - - -} - -void stupid_damn_numbuts_action(void){ - /* I think this function might have been - * deemed clever if it could have been - * called from the event processing - * routine in this file -- rather than having - * to go from the NKEY event from blenderqread - * in toets.c (which returns 0 so nobody else - * can use the NKEY) then into the clever_numbuts - * routine in toolbox.c, the finally to this - * function. Grumble, grumble, grumble ... - */ - - Key *key; - short mval[2]; - if ( (key = get_action_mesh_key()) ) { - getmouseco_areawin (mval); - if (mval[0]<NAMEWIDTH) { - clever_keyblock_names(key, mval); - } - } -} diff --git a/source/blender/src/editipo.c b/source/blender/src/editipo.c index 1e4b49a3810..209c41246df 100644 --- a/source/blender/src/editipo.c +++ b/source/blender/src/editipo.c @@ -907,6 +907,7 @@ void make_cu_editipo(SpaceIpo *si) void make_key_editipo(SpaceIpo *si) { Key *key; + KeyBlock *kb=NULL; EditIpo *ei; int a; @@ -914,8 +915,12 @@ void make_key_editipo(SpaceIpo *si) si->totipo= KEY_TOTIPO; - for(a=0; a<KEY_TOTIPO; a++) { - getname_key_ei(key_ar[a], ei->name); + key= (Key *)G.sipo->from; + if(key) kb= key->block.first; + + for(a=0; a<KEY_TOTIPO; a++, ei++) { + if(kb && kb->name[0] != 0) strncpy(ei->name, kb->name, 32); // length both same + else getname_key_ei(key_ar[a], ei->name); ei->adrcode= key_ar[a]; ei->col= ipo_rainbow(a, KEY_TOTIPO); @@ -926,11 +931,10 @@ void make_key_editipo(SpaceIpo *si) } else if(a==0) ei->flag |= IPO_VISIBLE; - ei++; + if(kb) kb= kb->next; } ei= si->editipo; - key= (Key *)G.sipo->from; if(key && key->type==KEY_RELATIVE) { strcpy(ei->name, "----"); } @@ -4936,142 +4940,6 @@ void transform_ipo(int mode) MEM_freeN(transmain); } -void clever_numbuts_ipo() -{ - BezTriple *bezt=0, *bezt1; - Key *key; - KeyBlock *kb; - EditIpo *ei; - float far, delta[3], old[3]; - int a, b, scale10=0, totbut=2; - - if(G.sipo->ipo && G.sipo->ipo->id.lib) return; - if(G.sipo->editipo==0) return; - - /* which vertices are involved */ - get_status_editipo(); - - if(G.qual & LR_SHIFTKEY) totbut= 1; - - if(G.vd==0) far= 10000.0; - else far= (float)(MAX2(G.vd->far, 10000.0)); - - if(totipo_vertsel) { - - ei= G.sipo->editipo; - for(a=0; a<G.sipo->totipo; a++, ei++) { - - if ISPOIN(ei, flag & IPO_VISIBLE, icu) { - if( (ei->flag & IPO_EDIT) || G.sipo->showkey) { - - if(ei->icu->bezt) { - bezt1= ei->icu->bezt; - b= ei->icu->totvert; - while(b--) { - if(BEZSELECTED(bezt1)) { - bezt= bezt1; - break; - } - bezt1++; - } - - } - } - } - if(bezt) break; - } - - if(bezt==0) return; - - if(bezt->f2 & 1) { - - VECCOPY(old, bezt->vec[1]); - - if(totipo_vis==1 && G.sipo->blocktype==ID_OB) { - if ELEM4(ei->icu->adrcode, OB_TIME, OB_ROT_X, OB_ROT_Y, OB_ROT_Z) scale10= 1; - if ELEM3(ei->icu->adrcode, OB_DROT_X, OB_DROT_Y, OB_DROT_Z) scale10= 1; - } - if(scale10) bezt->vec[1][1]*= 10.0; - - add_numbut(0, NUM|FLO, "LocX:", -1000, 10000, bezt->vec[1], 0); - if(totbut==2) add_numbut(1, NUM|FLO, "LocY:", -far, far, bezt->vec[1]+1, 0); - do_clever_numbuts("Active BezierPoint", totbut, REDRAW); - - if(scale10) bezt->vec[1][1]/= 10.0; - - VecSubf(delta, bezt->vec[1], old); - VECCOPY(bezt->vec[1], old); - - /* apply */ - ei= G.sipo->editipo; - for(a=0; a<G.sipo->totipo; a++, ei++) { - if ISPOIN(ei, flag & IPO_VISIBLE, icu) { - if( (ei->flag & IPO_EDIT) || G.sipo->showkey) { - if(ei->icu->bezt) { - bezt= ei->icu->bezt; - b= ei->icu->totvert; - while(b--) { - if(bezt->f2 & 1) { - bezt->vec[0][0]+= delta[0]; - bezt->vec[1][0]+= delta[0]; - bezt->vec[2][0]+= delta[0]; - - bezt->vec[0][1]+= delta[1]; - bezt->vec[1][1]+= delta[1]; - bezt->vec[2][1]+= delta[1]; - } - bezt++; - } - } - } - } - } - - ei= G.sipo->editipo; - for(a=0; a<G.sipo->totipo; a++, ei++) { - if ISPOIN(ei, flag & IPO_VISIBLE, icu) { - sort_time_ipocurve(ei->icu); - testhandles_ipocurve(ei->icu); - } - } - - } - else if(bezt->f1 & 1) { - add_numbut(0, NUM|FLO, "LocX:", -1000, 10000, bezt->vec[0], 0); - if(totbut==2) add_numbut(1, NUM|FLO, "LocY:", -far, far, bezt->vec[0]+1, 0); - - do_clever_numbuts("Active HandlePoint", totbut, REDRAW); - } - else if(bezt->f3 & 1) { - add_numbut(0, NUM|FLO, "LocX:", -1000, 10000, bezt->vec[0], 0); - if(totbut==2) add_numbut(1, NUM|FLO, "LocY:", -far, far, bezt->vec[2]+1, 0); - - do_clever_numbuts("Active HandlePoint", totbut, REDRAW); - } - - editipo_changed(G.sipo, 1); - } - else { - - if(G.sipo->blocktype==ID_KE) { - key= (Key *)G.sipo->from; - - if(key==0) return; - - kb= key->block.first; - while(kb) { - if(kb->flag & SELECT) break; - kb= kb->next; - } - if(kb && G.sipo->rowbut&1) { - add_numbut(0, NUM|FLO, "Pos:", -100, 100, &kb->pos, 0); - do_clever_numbuts("Active Key", 1, REDRAW); - sort_keys(key); - } - } - } -} - void filter_sampledata(float *data, int sfra, int efra) { float *da; diff --git a/source/blender/src/editkey.c b/source/blender/src/editkey.c index 772dd0e62db..bebf204d27d 100644 --- a/source/blender/src/editkey.c +++ b/source/blender/src/editkey.c @@ -278,6 +278,9 @@ void make_rvk_slider(uiBlock *block, Key *key, int keynum, meshslidervals+keynum, min, max, 10, 2, "Slider to control rvk"); uiButSetFunc(but, rvk_slider_func, key, keynums+keynum); + // no hilite, the winmatrix is not correct later on... + uiButSetFlag(but, UI_NO_HILITE); + } static void default_key_ipo(Key *key) diff --git a/source/blender/src/header_action.c b/source/blender/src/header_action.c index a2b87477f3a..f9c153cc3a6 100644 --- a/source/blender/src/header_action.c +++ b/source/blender/src/header_action.c @@ -132,6 +132,7 @@ void do_action_buttons(unsigned short event) G.v2d->cur.ymin=-SCROLLB; if (!G.saction->action){ // here the mesh rvk? + G.v2d->cur.xmax=0; G.v2d->cur.xmax=100; } else { @@ -678,7 +679,7 @@ void action_buttons(void) uiBlockSetEmboss(block, UI_EMBOSSX); - if (!get_action_mesh_key()) { + if (G.saction->action) { /* NAME ETC */ ob=OBACT; from = (ID*) ob; diff --git a/source/blender/src/interface.c b/source/blender/src/interface.c index a5610c730cb..c1d1b466e57 100644 --- a/source/blender/src/interface.c +++ b/source/blender/src/interface.c @@ -2519,6 +2519,13 @@ static int ui_do_block(uiBlock *block, uiEvent *uevent) } ui_set_ftf_font(block); // sets just a pointer in ftf lib... the button dont have ftf handles + + // added this for panels in windows with buttons... + // maybe speed optimize should require test + if((block->flag & UI_BLOCK_LOOP)==0) { + bwin_load_winmatrix(block->win, block->winmat); + glLoadIdentity(); + } Mat4CpyMat4(UIwinmat, block->winmat); uiPanelPush(block); // push matrix; no return without pop! diff --git a/source/blender/src/toets.c b/source/blender/src/toets.c index c9094670859..84a54f3e98f 100644 --- a/source/blender/src/toets.c +++ b/source/blender/src/toets.c @@ -811,6 +811,7 @@ int blenderqread(unsigned short event, short val) if(curarea->spacetype==SPACE_VIEW3D); // is new panel, in view3d queue else if(curarea->spacetype==SPACE_IPO); // is new panel, in ipo queue else if(curarea->spacetype==SPACE_IMAGE); // is new panel, in ipo queue + else if(curarea->spacetype==SPACE_ACTION); // is new panel else { clever_numbuts(); return 0; diff --git a/source/blender/src/toolbox.c b/source/blender/src/toolbox.c index b69de18a342..c6ca8d14afb 100644 --- a/source/blender/src/toolbox.c +++ b/source/blender/src/toolbox.c @@ -1412,59 +1412,26 @@ void clever_numbuts(void) char str[128]; if(curarea->spacetype==SPACE_VIEW3D) { - lim= 1000.0*MAX2(1.0, G.vd->grid); - - if(G.obpose){ - if (G.obpose->type == OB_ARMATURE) clever_numbuts_posearmature(); - } - else if(G.obedit==0) { - ob= OBACT; - if(ob==0) return; - - add_numbut(0, NUM|FLO, "LocX:", -lim, lim, ob->loc, 0); - add_numbut(1, NUM|FLO, "LocY:", -lim, lim, ob->loc+1, 0); - add_numbut(2, NUM|FLO, "LocZ:", -lim, lim, ob->loc+2, 0); - - add_numbut(3, NUM|FLO, "RotX:", -10.0*lim, 10.0*lim, ob->rot, 0); - add_numbut(4, NUM|FLO, "RotY:", -10.0*lim, 10.0*lim, ob->rot+1, 0); - add_numbut(5, NUM|FLO, "RotZ:", -10.0*lim, 10.0*lim, ob->rot+2, 0); - - add_numbut(6, NUM|FLO, "SizeX:", -lim, lim, ob->size, 0); - add_numbut(7, NUM|FLO, "SizeY:", -lim, lim, ob->size+1, 0); - add_numbut(8, NUM|FLO, "SizeZ:", -lim, lim, ob->size+2, 0); - - sprintf(str, "Active Object: %s", ob->id.name+2); - do_clever_numbuts(str, 9, REDRAW); - - } - else if(G.obedit->type==OB_MESH) clever_numbuts_mesh(); - else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) clever_numbuts_curve(); - else if (G.obedit->type==OB_ARMATURE) clever_numbuts_armature(); } else if(curarea->spacetype==SPACE_NLA){ clever_numbuts_nla(); } else if(curarea->spacetype==SPACE_IPO) { - clever_numbuts_ipo(); } else if(curarea->spacetype==SPACE_SEQ) { clever_numbuts_seq(); } else if(curarea->spacetype==SPACE_IMAGE) { - //clever_numbuts_sima(); } else if(curarea->spacetype==SPACE_IMASEL) { clever_numbuts_imasel(); } else if(curarea->spacetype==SPACE_BUTS){ - // clever_numbuts_buts(); } else if(curarea->spacetype==SPACE_OOPS) { clever_numbuts_oops(); } else if(curarea->spacetype==SPACE_ACTION){ - void stupid_damn_numbuts_action(void); // editaction.c - stupid_damn_numbuts_action(); } else if(curarea->spacetype==SPACE_FILE) { clever_numbuts_filesel(); |