UI: Panels
* API and usage is basically the same still. * Panels were moved to region level. I first thought of keeping them at area level, but having them at region level it's simpler to handle events and do drawing, and also to integrate with view2d. They can still become area level overlapping regions, if we make a floating (or docked) region that can contain panels. * Added back a few panels from the scene buttons for testing. Issues still: * The view2d handling and alignment refresh of panels is not correct yet in the buttons window. * I did not yet bring back the block handlers system. It was basically a system that stored which panel was open and where the events for that panel would go. Just a few functions, but not sure how it fits in 2.5. * There was a case where dragging panels would not properly remove the window level handler, but could not redo anymore even though I don't think I fixed it. * Some text in the panels goes past the end of the button, that is due to the checkmark button drawing, not related to this commit. Other UI code changes: * Renamed interface.h to interface_intern.h for consistency. * Fixed some issues with freeing of blocks when they changed due to context. * uiDrawBlock now takes a context pointer (mostly for block drawextra).
This commit is contained in:
@@ -123,6 +123,7 @@ void BKE_spacedata_freelist(ListBase *lb)
|
||||
ARegion *BKE_area_region_copy(ARegion *ar)
|
||||
{
|
||||
ARegion *newar= MEM_dupallocN(ar);
|
||||
Panel *pa, *newpa, *patab;
|
||||
|
||||
newar->handlers.first= newar->handlers.last= NULL;
|
||||
newar->uiblocks.first= newar->uiblocks.last= NULL;
|
||||
@@ -131,6 +132,23 @@ ARegion *BKE_area_region_copy(ARegion *ar)
|
||||
/* XXX regiondata callback */
|
||||
if(ar->regiondata)
|
||||
newar->regiondata= MEM_dupallocN(ar->regiondata);
|
||||
|
||||
newar->panels.first= newar->panels.last= NULL;
|
||||
BLI_duplicatelist(&newar->panels, &ar->panels);
|
||||
|
||||
/* copy panel pointers */
|
||||
for(newpa= newar->panels.first; newpa; newpa= newpa->next) {
|
||||
patab= newar->panels.first;
|
||||
pa= ar->panels.first;
|
||||
while(patab) {
|
||||
if(newpa->paneltab == pa) {
|
||||
newpa->paneltab = patab;
|
||||
break;
|
||||
}
|
||||
patab= patab->next;
|
||||
pa= pa->next;
|
||||
}
|
||||
}
|
||||
|
||||
return newar;
|
||||
}
|
||||
@@ -174,8 +192,12 @@ void BKE_spacedata_copylist(ListBase *lb1, ListBase *lb2)
|
||||
/* not region itself */
|
||||
void BKE_area_region_free(ARegion *ar)
|
||||
{
|
||||
if(ar && ar->type && ar->type->free)
|
||||
ar->type->free(ar);
|
||||
if(ar) {
|
||||
if(ar->type && ar->type->free)
|
||||
ar->type->free(ar);
|
||||
|
||||
BLI_freelistN(&ar->panels);
|
||||
}
|
||||
}
|
||||
|
||||
/* not area itself */
|
||||
@@ -193,10 +215,6 @@ void BKE_screen_area_free(ScrArea *sa)
|
||||
BLI_freelistN(&sa->regionbase);
|
||||
BLI_freelistN(&sa->actionzones);
|
||||
|
||||
BLI_freelistN(&sa->panels);
|
||||
// uiFreeBlocks(&sa->uiblocks);
|
||||
// uiFreePanels(&sa->panels);
|
||||
|
||||
#ifndef DISABLE_PYTHON
|
||||
BPY_free_scriptlink(&sa->scriptlink);
|
||||
#endif
|
||||
|
||||
@@ -3560,7 +3560,7 @@ static void direct_link_scene(FileData *fd, Scene *sce)
|
||||
if(sce->sculptdata.cumap)
|
||||
direct_link_curvemapping(fd, sce->sculptdata.cumap);
|
||||
else
|
||||
; //XXX sculpt_reset_curve(&sce->sculptdata);
|
||||
sculpt_reset_curve(&sce->sculptdata);
|
||||
|
||||
if(sce->ed) {
|
||||
ListBase *old_seqbasep= &((Editing *)sce->ed)->seqbase;
|
||||
@@ -4150,6 +4150,17 @@ void lib_link_screen_restore(Main *newmain, Scene *curscene)
|
||||
|
||||
static void direct_link_region(FileData *fd, ARegion *ar)
|
||||
{
|
||||
Panel *pa;
|
||||
|
||||
link_list(fd, &(ar->panels));
|
||||
|
||||
for(pa= ar->panels.first; pa; pa=pa->next) {
|
||||
pa->paneltab= newdataadr(fd, pa->paneltab);
|
||||
pa->active= 0;
|
||||
pa->sortcounter= 0;
|
||||
pa->activedata= NULL;
|
||||
}
|
||||
|
||||
ar->handlers.first= ar->handlers.last= NULL;
|
||||
ar->uiblocks.first= ar->uiblocks.last= NULL;
|
||||
ar->headerstr= NULL;
|
||||
@@ -4200,16 +4211,13 @@ static void direct_link_screen(FileData *fd, bScreen *sc)
|
||||
|
||||
/* areas */
|
||||
for(sa= sc->areabase.first; sa; sa= sa->next) {
|
||||
Panel *pa;
|
||||
SpaceLink *sl;
|
||||
ARegion *ar;
|
||||
|
||||
link_list(fd, &(sa->spacedata));
|
||||
link_list(fd, &(sa->panels));
|
||||
link_list(fd, &(sa->regionbase));
|
||||
|
||||
sa->handlers.first= sa->handlers.last= NULL;
|
||||
sa->uiblocks.first= sa->uiblocks.last= NULL;
|
||||
sa->type= NULL; /* spacetype callbacks */
|
||||
|
||||
/* accident can happen when read/save new file with older version */
|
||||
@@ -4220,12 +4228,6 @@ static void direct_link_screen(FileData *fd, bScreen *sc)
|
||||
BLI_addtail(&sa->spacedata, sinfo);
|
||||
}
|
||||
|
||||
for(pa= sa->panels.first; pa; pa=pa->next) {
|
||||
pa->paneltab= newdataadr(fd, pa->paneltab);
|
||||
pa->active= 0;
|
||||
pa->sortcounter= 0;
|
||||
}
|
||||
|
||||
for (sl= sa->spacedata.first; sl; sl= sl->next) {
|
||||
link_list(fd, &(sl->regionbase));
|
||||
|
||||
@@ -4705,19 +4707,19 @@ static void vcol_to_fcol(Mesh *me)
|
||||
static int map_223_keybd_code_to_224_keybd_code(int code)
|
||||
{
|
||||
switch (code) {
|
||||
//XXX case 312: return F12KEY;
|
||||
//XXX case 159: return PADSLASHKEY;
|
||||
//XXX case 161: return PAD0;
|
||||
//XXX case 154: return PAD1;
|
||||
//XXX case 150: return PAD2;
|
||||
//XXX case 155: return PAD3;
|
||||
//XXX case 151: return PAD4;
|
||||
//XXX case 156: return PAD5;
|
||||
//XXX case 152: return PAD6;
|
||||
//XXX case 157: return PAD7;
|
||||
//XXX case 153: return PAD8;
|
||||
//XXX case 158: return PAD9;
|
||||
default: return code;
|
||||
case 312: return 311; /* F12KEY */
|
||||
case 159: return 161; /* PADSLASHKEY */
|
||||
case 161: return 150; /* PAD0 */
|
||||
case 154: return 151; /* PAD1 */
|
||||
case 150: return 152; /* PAD2 */
|
||||
case 155: return 153; /* PAD3 */
|
||||
case 151: return 154; /* PAD4 */
|
||||
case 156: return 155; /* PAD5 */
|
||||
case 152: return 156; /* PAD6 */
|
||||
case 157: return 157; /* PAD7 */
|
||||
case 153: return 158; /* PAD8 */
|
||||
case 158: return 159; /* PAD9 */
|
||||
default: return code;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1655,12 +1655,13 @@ static void write_screens(WriteData *wd, ListBase *scrbase)
|
||||
|
||||
writestruct(wd, DATA, "ScrArea", 1, sa);
|
||||
|
||||
for(pa= sa->panels.first; pa; pa= pa->next)
|
||||
writestruct(wd, DATA, "Panel", 1, pa);
|
||||
|
||||
for(ar= sa->regionbase.first; ar; ar= ar->next)
|
||||
for(ar= sa->regionbase.first; ar; ar= ar->next) {
|
||||
writestruct(wd, DATA, "ARegion", 1, ar);
|
||||
|
||||
for(pa= ar->panels.first; pa; pa= pa->next)
|
||||
writestruct(wd, DATA, "Panel", 1, pa);
|
||||
}
|
||||
|
||||
/* space handler scriptlinks */
|
||||
write_scriptlink(wd, &sa->scriptlink);
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ struct View2D;
|
||||
struct gla2DDrawInfo;
|
||||
struct Object;
|
||||
struct bActionGroup;
|
||||
struct Ipo;
|
||||
struct IpoCurve;
|
||||
|
||||
/* ************************************************ */
|
||||
|
||||
@@ -176,7 +176,6 @@ typedef struct uiBlock uiBlock;
|
||||
/* Common Drawing Functions */
|
||||
|
||||
void uiEmboss(float x1, float y1, float x2, float y2, int sel);
|
||||
void uiRoundBoxEmboss(float minx, float miny, float maxx, float maxy, float rad, int active);
|
||||
void uiRoundBox(float minx, float miny, float maxx, float maxy, float rad);
|
||||
void uiSetRoundBox(int type);
|
||||
void uiRoundRect(float minx, float miny, float maxx, float maxy, float rad);
|
||||
@@ -222,12 +221,13 @@ void uiPupmenuError(struct bContext *C, char *str, ...);
|
||||
|
||||
uiBlock *uiBeginBlock(const struct bContext *C, struct ARegion *region, char *name, short dt, short font);
|
||||
void uiEndBlock(const struct bContext *C, uiBlock *block);
|
||||
void uiDrawBlock(const struct bContext *C, struct uiBlock *block);
|
||||
uiBlock *uiGetBlock(char *name, struct ARegion *ar);
|
||||
void uiFreeBlock(const struct bContext *C, uiBlock *block);
|
||||
void uiFreeBlocks(const struct bContext *C, struct ListBase *lb);
|
||||
void uiFreeInactiveBlocks(const struct bContext *C, struct ListBase *lb);
|
||||
|
||||
void uiBoundsBlock(struct uiBlock *block, int addval);
|
||||
void uiDrawBlock(struct uiBlock *block);
|
||||
void uiTextBoundsBlock(uiBlock *block, int addval);
|
||||
|
||||
void uiBlockSetButLock(uiBlock *block, int val, char *lockstr);
|
||||
@@ -357,18 +357,16 @@ void uiBlockSetDrawExtraFunc(uiBlock *block, void (*func)(struct bContext *C, u
|
||||
|
||||
extern void uiFreePanels(struct ListBase *lb);
|
||||
extern void uiNewPanelTabbed(char *, char *);
|
||||
extern int uiNewPanel(struct ScrArea *sa, struct uiBlock *block, char *panelname, char *tabname, int ofsx, int ofsy, int sizex, int sizey);
|
||||
extern int uiNewPanel(const struct bContext *C, struct ARegion *ar, uiBlock *block, char *panelname, char *tabname, int ofsx, int ofsy, int sizex, int sizey);
|
||||
extern void uiDrawPanels(const struct bContext *C, int re_align);
|
||||
|
||||
extern void uiSetPanel_view2d(struct ScrArea *sa);
|
||||
extern void uiMatchPanel_view2d(struct ScrArea *sa);
|
||||
extern void uiSetPanelsView2d(struct ARegion *ar);
|
||||
extern void uiMatchPanelsView2d(struct ARegion *ar);
|
||||
|
||||
extern void uiDrawBlocksPanels(struct ScrArea *sa, int re_align);
|
||||
extern void uiNewPanelHeight(struct uiBlock *block, int sizey);
|
||||
extern void uiNewPanelTitle(struct uiBlock *block, char *str);
|
||||
extern void uiPanelPush(struct uiBlock *block);
|
||||
extern void uiPanelPop(struct uiBlock *block);
|
||||
extern uiBlock *uiFindOpenPanelBlockName(ListBase *lb, char *name);
|
||||
extern int uiAlignPanelStep(struct ScrArea *sa, float fac);
|
||||
extern int uiAlignPanelStep(struct ScrArea *sa, struct ARegion *ar, float fac);
|
||||
extern void uiPanelControl(int);
|
||||
extern void uiSetPanelHandler(int);
|
||||
|
||||
@@ -383,6 +381,7 @@ void autocomplete_end(AutoComplete *autocpl, char *autoname);
|
||||
/* Handlers for regions with UI blocks */
|
||||
|
||||
void UI_add_region_handlers(struct ListBase *handlers);
|
||||
void UI_add_area_handlers(struct ListBase *handlers);
|
||||
void UI_add_popup_handlers(struct ListBase *handlers, uiMenuBlockHandle *menu);
|
||||
|
||||
/* Module initialization and exit */
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
#include "RNA_access.h"
|
||||
#include "RNA_types.h"
|
||||
|
||||
#include "interface.h"
|
||||
#include "interface_intern.h"
|
||||
|
||||
/*
|
||||
* a full doc with API notes can be found in bf-blender/blender/doc/interface_API.txt
|
||||
@@ -86,7 +86,6 @@ static uiFont UIfont[UI_ARRAY]; // no init needed
|
||||
|
||||
/* ************* translation ************** */
|
||||
|
||||
/* XXX 2.50 missing from context */
|
||||
int ui_translate_buttons()
|
||||
{
|
||||
return (U.transopts & USER_TR_BUTTONS);
|
||||
@@ -116,6 +115,12 @@ void ui_block_to_window_fl(const ARegion *ar, uiBlock *block, float *x, float *y
|
||||
|
||||
gx= *x;
|
||||
gy= *y;
|
||||
|
||||
if(block->panel) {
|
||||
gx += block->panel->ofsx;
|
||||
gy += block->panel->ofsy;
|
||||
}
|
||||
|
||||
*x= ((float)sx) + ((float)getsizex)*(0.5+ 0.5*(gx*block->winmat[0][0]+ gy*block->winmat[1][0]+ block->winmat[3][0]));
|
||||
*y= ((float)sy) + ((float)getsizey)*(0.5+ 0.5*(gx*block->winmat[0][1]+ gy*block->winmat[1][1]+ block->winmat[3][1]));
|
||||
}
|
||||
@@ -170,6 +175,11 @@ void ui_window_to_block_fl(const ARegion *ar, uiBlock *block, float *x, float *y
|
||||
|
||||
*y= (a*(py-f) + d*(c-px))/(a*e-d*b);
|
||||
*x= (px- b*(*y)- c)/a;
|
||||
|
||||
if(block->panel) {
|
||||
*x -= block->panel->ofsx;
|
||||
*y -= block->panel->ofsy;
|
||||
}
|
||||
}
|
||||
|
||||
void ui_window_to_block(const ARegion *ar, uiBlock *block, int *x, int *y)
|
||||
@@ -482,7 +492,6 @@ void uiEndBlock(const bContext *C, uiBlock *block)
|
||||
block->auto_open_last= block->oldblock->auto_open_last;
|
||||
block->tooltipdisabled= block->oldblock->tooltipdisabled;
|
||||
|
||||
uiFreeBlock(C, block->oldblock);
|
||||
block->oldblock= NULL;
|
||||
}
|
||||
|
||||
@@ -494,34 +503,24 @@ void uiEndBlock(const bContext *C, uiBlock *block)
|
||||
|
||||
/* ************** BLOCK DRAWING FUNCTION ************* */
|
||||
|
||||
void uiDrawBlock(uiBlock *block)
|
||||
void uiDrawBlock(const bContext *C, uiBlock *block)
|
||||
{
|
||||
uiBut *but;
|
||||
|
||||
/* we set this only once */
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
/* XXX 2.50 no panels yet */
|
||||
//uiPanelPush(block); // panel matrix
|
||||
|
||||
if(block->flag & UI_BLOCK_LOOP) {
|
||||
if(block->flag & UI_BLOCK_LOOP)
|
||||
uiDrawMenuBox(block->minx, block->miny, block->maxx, block->maxy, block->flag);
|
||||
}
|
||||
else {
|
||||
/* XXX 2.50 no panels yet */
|
||||
//if(block->panel) ui_draw_panel(block);
|
||||
}
|
||||
else if(block->panel)
|
||||
ui_draw_panel(CTX_wm_region(C), block);
|
||||
|
||||
/* XXX 2.50 need context here? */
|
||||
//if(block->drawextra) block->drawextra(curarea, block);
|
||||
if(block->drawextra) block->drawextra(C, block);
|
||||
|
||||
for (but= block->buttons.first; but; but= but->next)
|
||||
ui_draw_but(but);
|
||||
|
||||
ui_draw_links(block);
|
||||
|
||||
/* XXX 2.50 no panels yet */
|
||||
//uiPanelPop(block); // matrix restored
|
||||
}
|
||||
|
||||
/* ************* EVENTS ************* */
|
||||
@@ -1365,9 +1364,10 @@ void uiFreeBlock(const bContext *C, uiBlock *block)
|
||||
ui_free_but(C, but);
|
||||
}
|
||||
|
||||
if(block->panel) block->panel->active= 0;
|
||||
if(block->panel) {
|
||||
block->panel->active= 0;
|
||||
}
|
||||
BLI_freelistN(&block->saferct);
|
||||
|
||||
|
||||
MEM_freeN(block);
|
||||
}
|
||||
@@ -1382,6 +1382,24 @@ void uiFreeBlocks(const bContext *C, ListBase *lb)
|
||||
}
|
||||
}
|
||||
|
||||
void uiFreeInactiveBlocks(const bContext *C, ListBase *lb)
|
||||
{
|
||||
uiBlock *block, *nextblock;
|
||||
|
||||
for(block=lb->first; block; block=nextblock) {
|
||||
nextblock= block->next;
|
||||
|
||||
if(!block->handle) {
|
||||
if(!block->active) {
|
||||
uiFreeBlock(C, block);
|
||||
BLI_remlink(lb, block);
|
||||
}
|
||||
else
|
||||
block->active= 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uiBlock *uiBeginBlock(const bContext *C, ARegion *region, char *name, short dt, short font)
|
||||
{
|
||||
ListBase *lb;
|
||||
@@ -1399,12 +1417,15 @@ uiBlock *uiBeginBlock(const bContext *C, ARegion *region, char *name, short dt,
|
||||
if (BLI_streq(oldblock->name, name))
|
||||
break;
|
||||
|
||||
if (oldblock)
|
||||
BLI_remlink(lb, oldblock);
|
||||
if (oldblock) {
|
||||
oldblock->active= 0;
|
||||
oldblock->panel= NULL;
|
||||
}
|
||||
}
|
||||
|
||||
block= MEM_callocN(sizeof(uiBlock), "uiBlock");
|
||||
block->oldblock= oldblock;
|
||||
block->active= 1;
|
||||
|
||||
/* at the beginning of the list! for dynamical menus/blocks */
|
||||
if(lb)
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
#include "FTF_Api.h"
|
||||
#endif
|
||||
|
||||
#include "interface.h"
|
||||
#include "interface_intern.h"
|
||||
|
||||
#define UI_RB_ALPHA 16
|
||||
static int roundboxtype= 15;
|
||||
@@ -94,43 +94,43 @@ void gl_round_box(int mode, float minx, float miny, float maxx, float maxy, floa
|
||||
|
||||
/* start with corner right-bottom */
|
||||
if(roundboxtype & 4) {
|
||||
glVertex2f( maxx-rad, miny);
|
||||
glVertex2f(maxx-rad, miny);
|
||||
for(a=0; a<7; a++) {
|
||||
glVertex2f( maxx-rad+vec[a][0], miny+vec[a][1]);
|
||||
glVertex2f(maxx-rad+vec[a][0], miny+vec[a][1]);
|
||||
}
|
||||
glVertex2f( maxx, miny+rad);
|
||||
glVertex2f(maxx, miny+rad);
|
||||
}
|
||||
else glVertex2f( maxx, miny);
|
||||
else glVertex2f(maxx, miny);
|
||||
|
||||
/* corner right-top */
|
||||
if(roundboxtype & 2) {
|
||||
glVertex2f( maxx, maxy-rad);
|
||||
glVertex2f(maxx, maxy-rad);
|
||||
for(a=0; a<7; a++) {
|
||||
glVertex2f( maxx-vec[a][1], maxy-rad+vec[a][0]);
|
||||
glVertex2f(maxx-vec[a][1], maxy-rad+vec[a][0]);
|
||||
}
|
||||
glVertex2f( maxx-rad, maxy);
|
||||
glVertex2f(maxx-rad, maxy);
|
||||
}
|
||||
else glVertex2f( maxx, maxy);
|
||||
else glVertex2f(maxx, maxy);
|
||||
|
||||
/* corner left-top */
|
||||
if(roundboxtype & 1) {
|
||||
glVertex2f( minx+rad, maxy);
|
||||
glVertex2f(minx+rad, maxy);
|
||||
for(a=0; a<7; a++) {
|
||||
glVertex2f( minx+rad-vec[a][0], maxy-vec[a][1]);
|
||||
glVertex2f(minx+rad-vec[a][0], maxy-vec[a][1]);
|
||||
}
|
||||
glVertex2f( minx, maxy-rad);
|
||||
glVertex2f(minx, maxy-rad);
|
||||
}
|
||||
else glVertex2f( minx, maxy);
|
||||
else glVertex2f(minx, maxy);
|
||||
|
||||
/* corner left-bottom */
|
||||
if(roundboxtype & 8) {
|
||||
glVertex2f( minx, miny+rad);
|
||||
glVertex2f(minx, miny+rad);
|
||||
for(a=0; a<7; a++) {
|
||||
glVertex2f( minx+vec[a][1], miny+rad-vec[a][0]);
|
||||
glVertex2f(minx+vec[a][1], miny+rad-vec[a][0]);
|
||||
}
|
||||
glVertex2f( minx+rad, miny);
|
||||
glVertex2f(minx+rad, miny);
|
||||
}
|
||||
else glVertex2f( minx, miny);
|
||||
else glVertex2f(minx, miny);
|
||||
|
||||
glEnd();
|
||||
}
|
||||
@@ -246,7 +246,7 @@ void gl_round_box_shade(int mode, float minx, float miny, float maxx, float maxy
|
||||
if(roundboxtype & 2) {
|
||||
|
||||
round_box_shade_col(coltop, coldown, (div-rad)/div);
|
||||
glVertex2f( maxx, maxy-rad);
|
||||
glVertex2f(maxx, maxy-rad);
|
||||
|
||||
for(a=0; a<7; a++) {
|
||||
round_box_shade_col(coltop, coldown, (div-rad+vec[a][1])/div);
|
||||
@@ -264,11 +264,11 @@ void gl_round_box_shade(int mode, float minx, float miny, float maxx, float maxy
|
||||
if(roundboxtype & 1) {
|
||||
|
||||
round_box_shade_col(coltop, coldown, 1.0);
|
||||
glVertex2f( minx+rad, maxy);
|
||||
glVertex2f(minx+rad, maxy);
|
||||
|
||||
for(a=0; a<7; a++) {
|
||||
round_box_shade_col(coltop, coldown, (div-vec[a][1])/div);
|
||||
glVertex2f( minx+rad-vec[a][0], maxy-vec[a][1]);
|
||||
glVertex2f(minx+rad-vec[a][0], maxy-vec[a][1]);
|
||||
}
|
||||
|
||||
round_box_shade_col(coltop, coldown, (div-rad)/div);
|
||||
@@ -407,6 +407,30 @@ void gl_round_box_vertical_shade(int mode, float minx, float miny, float maxx, f
|
||||
glShadeModel(GL_FLAT);
|
||||
}
|
||||
|
||||
/* plain antialiased unfilled rectangle */
|
||||
void uiRoundRect(float minx, float miny, float maxx, float maxy, float rad)
|
||||
{
|
||||
float color[4];
|
||||
|
||||
if(roundboxtype & UI_RB_ALPHA) {
|
||||
glGetFloatv(GL_CURRENT_COLOR, color);
|
||||
color[3]= 0.5;
|
||||
glColor4fv(color);
|
||||
glEnable( GL_BLEND );
|
||||
}
|
||||
|
||||
/* set antialias line */
|
||||
if (UI_GetThemeValue(TH_BUT_DRAWTYPE) != TH_MINIMAL) {
|
||||
glEnable( GL_LINE_SMOOTH );
|
||||
glEnable( GL_BLEND );
|
||||
}
|
||||
|
||||
gl_round_box(GL_LINE_LOOP, minx, miny, maxx, maxy, rad);
|
||||
|
||||
glDisable( GL_BLEND );
|
||||
glDisable( GL_LINE_SMOOTH );
|
||||
}
|
||||
|
||||
/* plain fake antialiased unfilled round rectangle */
|
||||
void uiRoundRectFakeAA(float minx, float miny, float maxx, float maxy, float rad, float asp)
|
||||
{
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
#include "UI_interface.h"
|
||||
#include "UI_text.h"
|
||||
#include "interface.h"
|
||||
#include "interface_intern.h"
|
||||
|
||||
#include "RNA_access.h"
|
||||
|
||||
@@ -1417,7 +1417,7 @@ static void ui_blockopen_begin(bContext *C, uiBut *but, uiHandleButtonData *data
|
||||
}
|
||||
|
||||
/* this makes adjacent blocks auto open from now on */
|
||||
if(but->block->auto_open==0) but->block->auto_open= 1;
|
||||
//if(but->block->auto_open==0) but->block->auto_open= 1;
|
||||
}
|
||||
|
||||
static void ui_blockopen_end(bContext *C, uiBut *but, uiHandleButtonData *data)
|
||||
@@ -3568,10 +3568,15 @@ static int ui_handler_region(bContext *C, wmEvent *event, void *userdata)
|
||||
/* either handle events for already activated button or try to activate */
|
||||
but= ui_but_find_activated(ar);
|
||||
|
||||
if(but)
|
||||
retval= ui_handle_button_event(C, event, but);
|
||||
else
|
||||
retval= ui_handle_button_over(C, event, ar);
|
||||
if(!but || !button_modal_state(but->active->state))
|
||||
retval= ui_handler_panel_region(C, event);
|
||||
|
||||
if(retval == WM_UI_HANDLER_CONTINUE) {
|
||||
if(but)
|
||||
retval= ui_handle_button_event(C, event, but);
|
||||
else
|
||||
retval= ui_handle_button_over(C, event, ar);
|
||||
}
|
||||
|
||||
/* re-enable tooltips */
|
||||
if(event->type == MOUSEMOVE && (event->x!=event->prevx || event->y!=event->prevy))
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
// XXX #include "BIF_screen.h"
|
||||
|
||||
#include "UI_resources.h" /* elubie: should be removed once the enum for the ICONS is in BIF_preview_icons.h */
|
||||
#include "interface.h"
|
||||
#include "interface_intern.h"
|
||||
#include "ED_datafiles.h"
|
||||
|
||||
#define ICON_IMAGE_W 512
|
||||
|
||||
@@ -37,6 +37,7 @@ struct ARegion;
|
||||
struct bContext;
|
||||
struct IDProperty;
|
||||
struct uiHandleButtonData;
|
||||
struct wmEvent;
|
||||
struct wmWindow;
|
||||
|
||||
/* general defines */
|
||||
@@ -81,12 +82,6 @@ typedef struct {
|
||||
short xofs, yofs;
|
||||
} uiIconImage;
|
||||
|
||||
typedef struct {
|
||||
short mval[2];
|
||||
short qual, val;
|
||||
int event;
|
||||
} uiEvent;
|
||||
|
||||
typedef struct {
|
||||
void *xl, *large, *medium, *small;
|
||||
} uiFont;
|
||||
@@ -226,6 +221,9 @@ struct uiBlock {
|
||||
|
||||
uiMenuBlockHandle *handle; // handle
|
||||
int tooltipdisabled; // to avoid tooltip after click
|
||||
|
||||
int handler; // for panels in other windows than buttonswin... just event code
|
||||
int active; // to keep blocks while drawing and free them afterwards
|
||||
};
|
||||
|
||||
typedef struct uiSafetyRct {
|
||||
@@ -276,12 +274,8 @@ void ui_menu_block_free(struct bContext *C, uiMenuBlockHandle *handle);
|
||||
void ui_set_name_menu(uiBut *but, int value);
|
||||
|
||||
/* interface_panel.c */
|
||||
extern void ui_draw_panel(uiBlock *block);
|
||||
extern void ui_do_panel(uiBlock *block, uiEvent *uevent);
|
||||
extern void ui_scale_panel(uiBlock *block);
|
||||
extern void gl_round_box(int mode, float minx, float miny, float maxx, float maxy, float rad);
|
||||
extern void gl_round_box_shade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadetop, float shadedown);
|
||||
extern void gl_round_box_vertical_shade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadeLeft, float shadeRight);
|
||||
extern int ui_handler_panel_region(struct bContext *C, struct wmEvent *event);
|
||||
extern void ui_draw_panel(struct ARegion *ar, uiBlock *block);
|
||||
|
||||
/* interface_draw.c */
|
||||
extern void ui_set_embossfunc(uiBut *but, int drawtype);
|
||||
@@ -291,6 +285,10 @@ extern void ui_draw_tria_icon(float x, float y, float aspect, char dir);
|
||||
extern void ui_draw_anti_x(float x1, float y1, float x2, float y2);
|
||||
extern void ui_dropshadow(rctf *rct, float radius, float aspect, int select);
|
||||
|
||||
extern void gl_round_box(int mode, float minx, float miny, float maxx, float maxy, float rad);
|
||||
extern void gl_round_box_shade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadetop, float shadedown);
|
||||
extern void gl_round_box_vertical_shade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadeLeft, float shadeRight);
|
||||
|
||||
/* interface_handlers.c */
|
||||
extern void ui_button_active_cancel(const struct bContext *C, uiBut *but);
|
||||
|
||||
1610
source/blender/editors/interface/interface_panel.c
Normal file
1610
source/blender/editors/interface/interface_panel.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -54,7 +54,7 @@
|
||||
|
||||
#include "ED_screen.h"
|
||||
|
||||
#include "interface.h"
|
||||
#include "interface_intern.h"
|
||||
|
||||
#define MENU_BUTTON_HEIGHT 20
|
||||
#define B_NOP -1
|
||||
@@ -306,7 +306,7 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
|
||||
static ARegionType type;
|
||||
ARegion *ar;
|
||||
uiTooltipData *data;
|
||||
int x1, x2, y1, y2, winx, winy;
|
||||
int x1, x2, y1, y2, winx, winy, ofsx, ofsy;
|
||||
|
||||
if(!but->tip || strlen(but->tip)==0)
|
||||
return NULL;
|
||||
@@ -329,9 +329,12 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
|
||||
ar->regiondata= data;
|
||||
|
||||
/* compute position */
|
||||
x1= (but->x1+but->x2)/2;
|
||||
ofsx= (but->block->panel)? but->block->panel->ofsx: 0;
|
||||
ofsy= (but->block->panel)? but->block->panel->ofsy: 0;
|
||||
|
||||
x1= (but->x1+but->x2)/2 + ofsx;
|
||||
x2= x1+but->aspect*((data->bbox.xmax-data->bbox.xmin) + 8);
|
||||
y2= but->y1-10;
|
||||
y2= but->y1-10 + ofsy;
|
||||
y1= y2-but->aspect*((data->bbox.ymax+(data->bbox.ymax-data->bbox.ymin)));
|
||||
|
||||
y2 += 8;
|
||||
@@ -612,7 +615,7 @@ static void ui_block_region_draw(const bContext *C, ARegion *ar)
|
||||
uiBlock *block;
|
||||
|
||||
for(block=ar->uiblocks.first; block; block=block->next)
|
||||
uiDrawBlock(block);
|
||||
uiDrawBlock(C, block);
|
||||
}
|
||||
|
||||
uiMenuBlockHandle *ui_menu_block_create(bContext *C, ARegion *butregion, uiBut *but, uiBlockFuncFP block_func, void *arg)
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
#include "UI_view2d.h"
|
||||
|
||||
#include "UI_interface.h"
|
||||
#include "interface.h"
|
||||
#include "interface_intern.h"
|
||||
|
||||
/* *********************************************************************** */
|
||||
/* Refresh and Validation */
|
||||
|
||||
@@ -205,6 +205,8 @@ void ED_region_do_draw(bContext *C, ARegion *ar)
|
||||
|
||||
if(sa)
|
||||
region_draw_emboss(ar);
|
||||
|
||||
uiFreeInactiveBlocks(C, &ar->uiblocks);
|
||||
|
||||
/* XXX test: add convention to end regions always in pixel space, for drawing of borders/gestures etc */
|
||||
ED_region_pixelspace(ar);
|
||||
@@ -524,7 +526,6 @@ void ED_region_init(bContext *C, ARegion *ar)
|
||||
/* area vertices were set */
|
||||
void area_copy_data(ScrArea *sa1, ScrArea *sa2, int swap_space)
|
||||
{
|
||||
Panel *pa1, *pa2, *patab;
|
||||
ARegion *ar;
|
||||
|
||||
sa1->headertype= sa2->headertype;
|
||||
@@ -542,24 +543,6 @@ void area_copy_data(ScrArea *sa1, ScrArea *sa2, int swap_space)
|
||||
BKE_spacedata_copylist(&sa1->spacedata, &sa2->spacedata);
|
||||
}
|
||||
|
||||
BLI_freelistN(&sa1->panels);
|
||||
BLI_duplicatelist(&sa1->panels, &sa2->panels);
|
||||
|
||||
/* copy panel pointers */
|
||||
for(pa1= sa1->panels.first; pa1; pa1= pa1->next) {
|
||||
|
||||
patab= sa1->panels.first;
|
||||
pa2= sa2->panels.first;
|
||||
while(patab) {
|
||||
if( pa1->paneltab == pa2) {
|
||||
pa1->paneltab = patab;
|
||||
break;
|
||||
}
|
||||
patab= patab->next;
|
||||
pa2= pa2->next;
|
||||
}
|
||||
}
|
||||
|
||||
/* regions... XXX */
|
||||
BLI_freelistN(&sa1->regionbase);
|
||||
|
||||
|
||||
@@ -458,8 +458,6 @@ static void screen_copy(bScreen *to, bScreen *from)
|
||||
sa->v4= sa->v4->newv;
|
||||
|
||||
sa->spacedata.first= sa->spacedata.last= NULL;
|
||||
sa->uiblocks.first= sa->uiblocks.last= NULL;
|
||||
sa->panels.first= sa->panels.last= NULL;
|
||||
sa->regionbase.first= sa->regionbase.last= NULL;
|
||||
sa->actionzones.first= sa->actionzones.last= NULL;
|
||||
sa->scriptlink.totscript= 0;
|
||||
|
||||
@@ -182,7 +182,7 @@ static void meshactionbuts(SpaceAction *saction, Object *ob, Key *key)
|
||||
if (i >= 255) break;
|
||||
}
|
||||
}
|
||||
uiDrawBlock(block);
|
||||
uiDrawBlock(C, block);
|
||||
}
|
||||
|
||||
static void icu_slider_func(void *voidicu, void *voidignore)
|
||||
@@ -387,7 +387,7 @@ static void action_icu_buts(SpaceAction *saction)
|
||||
/* free tempolary channels */
|
||||
BLI_freelistN(&act_data);
|
||||
}
|
||||
uiDrawBlock(block);
|
||||
uiDrawBlock(C, block);
|
||||
}
|
||||
|
||||
#endif // XXX all of this slider stuff will need a rethink
|
||||
|
||||
@@ -477,7 +477,7 @@ void action_header_buttons(const bContext *C, ARegion *ar)
|
||||
UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin);
|
||||
|
||||
uiEndBlock(C, block);
|
||||
uiDrawBlock(block);
|
||||
uiDrawBlock(C, block);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ CPPFLAGS += -I../../makesdna
|
||||
CPPFLAGS += -I../../imbuf
|
||||
CPPFLAGS += -I../../python
|
||||
CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include
|
||||
CPPFLAGS += -I../../render/extern/include
|
||||
|
||||
# own include
|
||||
|
||||
|
||||
@@ -5,5 +5,6 @@ sources = env.Glob('*.c')
|
||||
|
||||
incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
|
||||
incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
|
||||
incs += ' ../../render/extern/include'
|
||||
|
||||
env.BlenderLib ( 'bf_editors_space_buttons', sources, Split(incs), [], libtype=['core'], priority=[120] )
|
||||
|
||||
@@ -101,6 +101,9 @@ static void do_buttons_buttons(bContext *C, void *arg, int event)
|
||||
case B_NEWFRAME:
|
||||
WM_event_add_notifier(C, WM_NOTE_WINDOW_REDRAW, 0, NULL);
|
||||
break;
|
||||
case B_CONTEXT_SWITCH:
|
||||
ED_area_tag_redraw(CTX_wm_area(C));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,7 +198,7 @@ void buttons_header_buttons(const bContext *C, ARegion *ar)
|
||||
UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin);
|
||||
|
||||
uiEndBlock(C, block);
|
||||
uiDrawBlock(block);
|
||||
uiDrawBlock(C, block);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -72,10 +72,9 @@
|
||||
|
||||
/* internal exports only */
|
||||
|
||||
|
||||
/* image_header.c */
|
||||
void buttons_header_buttons(const bContext *C, ARegion *ar);
|
||||
|
||||
void buttons_scene(const bContext *C, ARegion *ar);
|
||||
|
||||
#endif /* ED_BUTTONS_INTERN_H */
|
||||
|
||||
|
||||
324
source/blender/editors/space_buttons/buttons_scene.c
Normal file
324
source/blender/editors/space_buttons/buttons_scene.c
Normal file
@@ -0,0 +1,324 @@
|
||||
/**
|
||||
* $Id:
|
||||
*
|
||||
* ***** BEGIN GPL LICENSE BLOCK *****
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software Foundation,
|
||||
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* The Original Code is Copyright (C) 2008 Blender Foundation.
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Contributor(s): Blender Foundation
|
||||
*
|
||||
* ***** END GPL LICENSE BLOCK *****
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "DNA_space_types.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "DNA_screen_types.h"
|
||||
|
||||
#include "BLI_threads.h"
|
||||
|
||||
#include "BKE_context.h"
|
||||
#include "BKE_global.h"
|
||||
|
||||
#include "RE_pipeline.h"
|
||||
|
||||
#include "UI_interface.h"
|
||||
#include "UI_resources.h"
|
||||
|
||||
#include "buttons_intern.h"
|
||||
|
||||
#define R_DISPLAYIMAGE 0
|
||||
#define R_DISPLAYWIN 1
|
||||
#define R_DISPLAYSCREEN 2
|
||||
|
||||
static void render_panel_output(const bContext *C, ARegion *ar)
|
||||
{
|
||||
//ID *id;
|
||||
int a,b;
|
||||
uiBlock *block;
|
||||
//char *strp;
|
||||
|
||||
block= uiBeginBlock(C, ar, "render_panel_output", UI_EMBOSS, UI_HELV);
|
||||
if(uiNewPanel(C, ar, block, "Output", "Render", 0, 0, 318, 204)==0) return;
|
||||
|
||||
uiBlockBeginAlign(block);
|
||||
uiDefIconBut(block, BUT, 0, ICON_FILESEL, 10, 190, 20, 20, 0, 0, 0, 0, 0, "Select the directory/name for saving animations");
|
||||
uiDefBut(block, TEX,0,"", 31, 190, 279, 20,G.scene->r.pic, 0.0,79.0, 0, 0, "Directory/name to save animations, # characters defines the position and length of frame numbers");
|
||||
uiDefIconBut(block, BUT,0, ICON_FILESEL, 10, 168, 20, 20, 0, 0, 0, 0, 0, "Select the directory/name for a Backbuf image");
|
||||
uiDefBut(block, TEX,0,"", 31, 168, 259, 20,G.scene->r.backbuf, 0.0,79.0, 0, 0, "Image to use as background for rendering");
|
||||
uiDefIconButBitS(block, ICONTOG, R_BACKBUF, 0, ICON_CHECKBOX_HLT-1, 290, 168, 20, 20, &G.scene->r.bufflag, 0.0, 0.0, 0, 0, "Enable/Disable use of Backbuf image");
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
uiDefButBitI(block, TOG, R_EXTENSION, 0, "Extensions", 10, 142, 100, 20, &G.scene->r.scemode, 0.0, 0.0, 0, 0, "Adds filetype extensions to the filename when rendering animations");
|
||||
|
||||
uiBlockBeginAlign(block);
|
||||
uiDefButBitI(block, TOG, R_TOUCH, 0, "Touch", 170, 142, 50, 20, &G.scene->r.mode, 0.0, 0.0, 0, 0, "Create an empty file before rendering each frame, remove if cancelled (and empty)");
|
||||
uiDefButBitI(block, TOG, R_NO_OVERWRITE, 0, "No Overwrite", 220, 142, 90, 20, &G.scene->r.mode, 0.0, 0.0, 0, 0, "Skip rendering frames when the file exists (image output only)");
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
/* SET BUTTON */
|
||||
uiBlockBeginAlign(block);
|
||||
/*XXX id= (ID *)G.scene->set;
|
||||
IDnames_to_pupstring(&strp, NULL, NULL, &(G.main->scene), id, &(G.buts->menunr));
|
||||
if(strp[0])
|
||||
uiDefButS(block, MENU, 0, strp, 10, 114, 20, 20, &(G.buts->menunr), 0, 0, 0, 0, "Scene to link as a Set");
|
||||
MEM_freeN(strp);*/
|
||||
|
||||
if(G.scene->set) {
|
||||
uiBlockSetButLock(block, 1, NULL);
|
||||
//XXX uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 0, "", 31, 114, 100, 20, &(G.scene->set), "Name of the Set");
|
||||
uiBlockClearButLock(block);
|
||||
uiDefIconBut(block, BUT, 0, ICON_X, 132, 114, 20, 20, 0, 0, 0, 0, 0, "Remove Set link");
|
||||
} else {
|
||||
uiDefBut(block, LABEL, 0, "No Set Scene", 31, 114, 200, 20, 0, 0, 0, 0, 0, "");
|
||||
}
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
uiBlockBeginAlign(block);
|
||||
uiDefIconButBitI(block, TOGN, R_FIXED_THREADS, 0, ICON_AUTO, 10, 63, 20, 20, &G.scene->r.mode, 0.0, 0.0, 0, 0, "Automatically set the threads to the number of processors on the system");
|
||||
if ((G.scene->r.mode & R_FIXED_THREADS)==0) {
|
||||
char thread_str[16];
|
||||
sprintf(thread_str, " Threads: %d", BLI_system_thread_count());
|
||||
uiDefBut(block, LABEL, 0, thread_str, 30, 63,80,20, 0, 0, 0, 0, 0, "");
|
||||
} else {
|
||||
uiDefButS(block, NUM, 0, "Threads:", 30, 63, 80, 20, &G.scene->r.threads, 1, BLENDER_MAX_THREADS, 0, 0, "Amount of threads for render (takes advantage of multi-core and multi-processor computers)");
|
||||
}
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
uiBlockSetCol(block, TH_AUTO);
|
||||
|
||||
uiBlockBeginAlign(block);
|
||||
for(b=2; b>=0; b--)
|
||||
for(a=0; a<3; a++)
|
||||
uiDefButBitS(block, TOG, 1<<(3*b+a), 800,"", (short)(10+18*a),(short)(10+14*b),16,12, &G.winpos, 0, 0, 0, 0, "Render window placement on screen");
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
#ifdef WITH_OPENEXR
|
||||
uiBlockBeginAlign(block);
|
||||
uiDefButBitI(block, TOG, R_EXR_TILE_FILE, 0, "Save Buffers", 72, 31, 120, 19, &G.scene->r.scemode, 0.0, 0.0, 0, 0, "Save tiles for all RenderLayers and used SceneNodes to files in the temp directory (saves memory, allows Full Sampling)");
|
||||
if(G.scene->r.scemode & R_EXR_TILE_FILE)
|
||||
uiDefButBitI(block, TOG, R_FULL_SAMPLE, 0, "FullSample", 192, 31, 118, 19, &G.scene->r.scemode, 0.0, 0.0, 0, 0, "Saves for every OSA sample the entire RenderLayer results (Higher quality sampling but slower)");
|
||||
uiBlockEndAlign(block);
|
||||
#endif
|
||||
|
||||
uiDefButS(block, MENU, 0, "Render Display %t|Render Window %x1|Image Editor %x0|Full Screen %x2",
|
||||
72, 10, 120, 19, &G.displaymode, 0.0, (float)R_DISPLAYWIN, 0, 0, "Sets render output display");
|
||||
|
||||
/* Dither control */
|
||||
uiDefButF(block, NUM,0, "Dither:", 10,89,100,19, &G.scene->r.dither_intensity, 0.0, 2.0, 0, 0, "The amount of dithering noise present in the output image (0.0 = no dithering)");
|
||||
|
||||
/* Toon shading buttons */
|
||||
uiBlockBeginAlign(block);
|
||||
uiDefButBitI(block, TOG, R_EDGE, 0,"Edge", 115, 89, 60, 20, &G.scene->r.mode, 0, 0, 0, 0, "Enable Toon Edge-enhance");
|
||||
//XXX uiDefBlockBut(block, edge_render_menu, NULL, "Edge Settings", 175, 89, 135, 20, "Display Edge settings");
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
uiBlockBeginAlign(block);
|
||||
uiDefButBitI(block, TOG, R_NO_TEX, 0, "Disable Tex", 115, 63, 75, 20, &G.scene->r.scemode, 0.0, 0.0, 0, 0, "Disables Textures for render");
|
||||
uiDefButBitI(block, TOG, R_FREE_IMAGE, 0, "Free Tex Images", 210, 63, 100, 20, &G.scene->r.scemode, 0.0, 0.0, 0, 0, "Frees all Images used by Textures after each render");
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
uiEndBlock(C, block);
|
||||
}
|
||||
|
||||
static void do_bake_func(bContext *C, void *unused_v, void *unused_p)
|
||||
{
|
||||
//XXX objects_bake_render_ui(0);
|
||||
}
|
||||
|
||||
static void render_panel_bake(const bContext *C, ARegion *ar)
|
||||
{
|
||||
uiBlock *block;
|
||||
uiBut *but;
|
||||
|
||||
block= uiBeginBlock(C, ar, "render_panel_bake", UI_EMBOSS, UI_HELV);
|
||||
uiNewPanelTabbed("Anim", "Render");
|
||||
if(uiNewPanel(C, ar, block, "Bake", "Render", 320, 0, 318, 204)==0) return;
|
||||
|
||||
but= uiDefBut(block, BUT, 0, "BAKE", 10, 150, 190,40, 0, 0, 0, 0, 0, "Start the bake render for selected Objects");
|
||||
uiButSetFunc(but, do_bake_func, NULL, NULL);
|
||||
|
||||
uiBlockBeginAlign(block);
|
||||
uiDefButBitS(block, TOG, R_BAKE_TO_ACTIVE, 0, "Selected to Active", 10,120,190,20,&G.scene->r.bake_flag, 0.0, 0, 0, 0, "Bake shading on the surface of selected objects to the active object");
|
||||
uiDefButF(block, NUM, 0, "Dist:", 10,100,95,20,&G.scene->r.bake_maxdist, 0.0, 1000.0, 1, 0, "Maximum distance from active object to other object (in blender units)");
|
||||
uiDefButF(block, NUM, 0, "Bias:", 105,100,95,20,&G.scene->r.bake_biasdist, 0.0, 1000.0, 1, 0, "Bias towards faces further away from the object (in blender units)");
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
if(G.scene->r.bake_mode == RE_BAKE_NORMALS)
|
||||
uiDefButS(block, MENU, 0, "Normal Space %t|Camera %x0|World %x1|Object %x2|Tangent %x3",
|
||||
10,70,190,20, &G.scene->r.bake_normal_space, 0, 0, 0, 0, "Choose normal space for baking");
|
||||
else if(G.scene->r.bake_mode == RE_BAKE_AO || G.scene->r.bake_mode == RE_BAKE_DISPLACEMENT) {
|
||||
uiDefButBitS(block, TOG, R_BAKE_NORMALIZE, 0, "Normalized", 10,70,190,20, &G.scene->r.bake_flag, 0.0, 0, 0, 0,
|
||||
G.scene->r.bake_mode == RE_BAKE_AO ?
|
||||
"Bake ambient occlusion normalized, without taking into acount material settings":
|
||||
"Normalized displacement value to fit the 'Dist' range"
|
||||
);
|
||||
}
|
||||
|
||||
uiDefButS(block, MENU, 0, "Quad Split Order%t|Quad Split Auto%x0|Quad Split A (0,1,2) (0,2,3)%x1|Quad Split B (1,2,3) (1,3,0)%x2",
|
||||
10,10,190,20, &G.scene->r.bake_quad_split, 0, 0, 0, 0, "Method to divide quads (use A or B for external applications that use a fixed order)");
|
||||
|
||||
#if 0
|
||||
uiBlockBeginAlign(block);
|
||||
uiDefButBitS(block, TOG, R_BAKE_OSA, 0, "OSA", 10,120,190,20, &G.scene->r.bake_flag, 0, 0, 0, 0, "Enables Oversampling (Anti-aliasing)");
|
||||
uiDefButS(block, ROW,0,"5", 10,100,50,20,&G.scene->r.bake_osa,2.0,5.0, 0, 0, "Sets oversample level to 5");
|
||||
uiDefButS(block, ROW,0,"8", 60,100,45,20,&G.scene->r.bake_osa,2.0,8.0, 0, 0, "Sets oversample level to 8");
|
||||
uiDefButS(block, ROW,0,"11", 105,100,45,20,&G.scene->r.bake_osa,2.0,11.0, 0, 0, "Sets oversample level to 11");
|
||||
uiDefButS(block, ROW,0,"16", 150,100,50,20,&G.scene->r.bake_osa,2.0,16.0, 0, 0, "Sets oversample level to 16");
|
||||
#endif
|
||||
uiBlockBeginAlign(block);
|
||||
uiDefButS(block, ROW,0,"Full Render", 210,170,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_ALL, 0, 0, "");
|
||||
uiDefButS(block, ROW,0,"Ambient Occlusion",210,150,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_AO, 0, 0, "");
|
||||
uiDefButS(block, ROW,0,"Shadow", 210,130,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_SHADOW, 0, 0, "");
|
||||
uiDefButS(block, ROW,0,"Normals", 210,110,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_NORMALS, 0, 0, "");
|
||||
uiDefButS(block, ROW,0,"Textures", 210,90,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_TEXTURE, 0, 0, "");
|
||||
uiDefButS(block, ROW,0,"Displacement", 210,70,120,20,&G.scene->r.bake_mode, 1.0, RE_BAKE_DISPLACEMENT, 0, 0, "");
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
uiDefButBitS(block, TOG, R_BAKE_CLEAR, 0, "Clear", 210,40,120,20,&G.scene->r.bake_flag, 0.0, 0, 0, 0, "Clear Images before baking");
|
||||
|
||||
uiDefButS(block, NUM, 0,"Margin:", 210,10,120,20,&G.scene->r.bake_filter, 0.0, 32.0, 0, 0, "Amount of pixels to extend the baked result with, as post process filter");
|
||||
|
||||
uiEndBlock(C, block);
|
||||
}
|
||||
|
||||
static void render_panel_render(const bContext *C, ARegion *ar)
|
||||
{
|
||||
uiBlock *block;
|
||||
char str[256];
|
||||
|
||||
block= uiBeginBlock(C, ar, "render_panel_render", UI_EMBOSS, UI_HELV);
|
||||
if(uiNewPanel(C, ar, block, "Render", "Render", 320, 0, 318, 204)==0) return;
|
||||
|
||||
uiBlockBeginAlign(block);
|
||||
uiDefBut(block, BUT,0,"RENDER", 369, 164, 191,37, 0, 0, 0, 0, 0, "Render the current frame (F12)");
|
||||
#ifndef DISABLE_YAFRAY
|
||||
/* yafray: on request, render engine menu is back again, and moved to Render panel */
|
||||
uiDefButS(block, MENU, 0, "Rendering Engine %t|Blender Internal %x0|YafRay %x1",
|
||||
369, 142, 191, 20, &G.scene->r.renderer, 0, 0, 0, 0, "Choose rendering engine");
|
||||
#else
|
||||
uiDefButS(block, MENU, 0, "Rendering Engine %t|Blender Internal %x0",
|
||||
369, 142, 191, 20, &G.scene->r.renderer, 0, 0, 0, 0, "Choose rendering engine");
|
||||
#endif /* disable yafray */
|
||||
|
||||
uiBlockBeginAlign(block);
|
||||
if((G.scene->r.scemode & R_FULL_SAMPLE) && (G.scene->r.scemode & R_EXR_TILE_FILE))
|
||||
uiDefButBitI(block, TOG, R_OSA, 0, "FSA", 369,109,122,20,&G.scene->r.mode, 0, 0, 0, 0, "Saves all samples, then composites, and then merges (for best Anti-aliasing)");
|
||||
else
|
||||
uiDefButBitI(block, TOG, R_OSA, 0, "OSA", 369,109,122,20,&G.scene->r.mode, 0, 0, 0, 0, "Enables Oversampling (Anti-aliasing)");
|
||||
uiDefButS(block, ROW,0,"5", 369,88,29,20,&G.scene->r.osa,2.0,5.0, 0, 0, "Render 5 samples per pixel for smooth edges (Fast)");
|
||||
uiDefButS(block, ROW,0,"8", 400,88,29,20,&G.scene->r.osa,2.0,8.0, 0, 0, "Render 8 samples per pixel for smooth edges (Recommended)");
|
||||
uiDefButS(block, ROW,0,"11", 431,88,29,20,&G.scene->r.osa,2.0,11.0, 0, 0, "Render 11 samples per pixel for smooth edges (High Quality)");
|
||||
uiDefButS(block, ROW,0,"16", 462,88,29,20,&G.scene->r.osa,2.0,16.0, 0, 0, "Render 16 samples per pixel for smooth edges (Highest Quality)");
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
uiBlockBeginAlign(block);
|
||||
uiDefButBitI(block, TOG, R_MBLUR, 0, "MBLUR", 496,109,64,20,&G.scene->r.mode, 0, 0, 0, 0, "Enables Motion Blur calculation");
|
||||
uiDefButF(block, NUM,0,"Bf:", 496,88,64,20,&G.scene->r.blurfac, 0.01, 5.0, 10, 2, "Sets motion blur factor");
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
uiBlockBeginAlign(block);
|
||||
uiDefButS(block, NUM,0,"Xparts:", 369,46,95,29,&G.scene->r.xparts,1.0, 512.0, 0, 0, "Sets the number of horizontal parts to render image in (For panorama sets number of camera slices)");
|
||||
uiDefButS(block, NUM,0,"Yparts:", 465,46,95,29,&G.scene->r.yparts,1.0, 64.0, 0, 0, "Sets the number of vertical parts to render image in");
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
uiBlockBeginAlign(block);
|
||||
uiDefButS(block, ROW,800,"Sky", 369,13,35,20,&G.scene->r.alphamode,3.0,0.0, 0, 0, "Fill background with sky");
|
||||
uiDefButS(block, ROW,800,"Premul", 405,13,50,20,&G.scene->r.alphamode,3.0,1.0, 0, 0, "Multiply alpha in advance");
|
||||
uiDefButS(block, ROW,800,"Key", 456,13,35,20,&G.scene->r.alphamode,3.0,2.0, 0, 0, "Alpha and color values remain unchanged");
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
uiDefButS(block, MENU, 0,"Octree resolution %t|64 %x64|128 %x128|256 %x256|512 %x512", 496,13,64,20,&G.scene->r.ocres,0.0,0.0, 0, 0, "Octree resolution for ray tracing and baking, Use higher values for complex scenes");
|
||||
|
||||
uiBlockBeginAlign(block);
|
||||
uiDefButBitI(block, TOG, R_SHADOW, 0,"Shadow", 565,172,52,29, &G.scene->r.mode, 0, 0, 0, 0, "Enable shadow calculation");
|
||||
uiDefButBitI(block, TOG, R_SSS, 0,"SSS", 617,172,32,29, &G.scene->r.mode, 0, 0, 0, 0, "Enable subsurface scattering map rendering");
|
||||
uiDefButBitI(block, TOG, R_PANORAMA, 0,"Pano", 649,172,38,29, &G.scene->r.mode, 0, 0, 0, 0, "Enable panorama rendering (output width is multiplied by Xparts)");
|
||||
uiDefButBitI(block, TOG, R_ENVMAP, 0,"EnvMap", 565,142,52,29, &G.scene->r.mode, 0, 0, 0, 0, "Enable environment map rendering");
|
||||
uiDefButBitI(block, TOG, R_RAYTRACE, 0,"Ray",617,142,32,29, &G.scene->r.mode, 0, 0, 0, 0, "Enable ray tracing");
|
||||
uiDefButBitI(block, TOG, R_RADIO, 0,"Radio", 649,142,38,29, &G.scene->r.mode, 0, 0, 0, 0, "Enable radiosity rendering");
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
uiBlockBeginAlign(block);
|
||||
uiDefButS(block, ROW,0,"100%", 565,109,122,20,&G.scene->r.size,1.0,100.0, 0, 0, "Set render size to defined size");
|
||||
uiDefButS(block, ROW,0,"75%", 565,88,40,20,&G.scene->r.size,1.0,75.0, 0, 0, "Set render size to 3/4 of defined size");
|
||||
uiDefButS(block, ROW,0,"50%", 606,88,40,20,&G.scene->r.size,1.0,50.0, 0, 0, "Set render size to 1/2 of defined size");
|
||||
uiDefButS(block, ROW,0,"25%", 647,88,40,20,&G.scene->r.size,1.0,25.0, 0, 0, "Set render size to 1/4 of defined size");
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
uiBlockBeginAlign(block);
|
||||
uiDefButBitI(block, TOG, R_FIELDS, 0,"Fields", 565,55,60,20,&G.scene->r.mode, 0, 0, 0, 0, "Enables field rendering");
|
||||
uiDefButBitI(block, TOG, R_ODDFIELD, 0,"Odd", 627,55,39,20,&G.scene->r.mode, 0, 0, 0, 0, "Enables Odd field first rendering (Default: Even field)");
|
||||
uiDefButBitI(block, TOG, R_FIELDSTILL, 0,"X", 668,55,19,20,&G.scene->r.mode, 0, 0, 0, 0, "Disables time difference in field calculations");
|
||||
|
||||
sprintf(str, "Filter%%t|Box %%x%d|Tent %%x%d|Quad %%x%d|Cubic %%x%d|Gauss %%x%d|CatRom %%x%d|Mitch %%x%d", R_FILTER_BOX, R_FILTER_TENT, R_FILTER_QUAD, R_FILTER_CUBIC, R_FILTER_GAUSS, R_FILTER_CATROM, R_FILTER_MITCH);
|
||||
uiDefButS(block, MENU, 0,str, 565,34,60,20, &G.scene->r.filtertype, 0, 0, 0, 0, "Set sampling filter for antialiasing");
|
||||
uiDefButF(block, NUM,0,"", 627,34,60,20,&G.scene->r.gauss,0.5, 1.5, 10, 2, "Sets the filter size");
|
||||
|
||||
uiDefButBitI(block, TOG, R_BORDER, 0, "Border", 565,13,122,20, &G.scene->r.mode, 0, 0, 0, 0, "Render a small cut-out of the image (Shift+B to set in the camera view)");
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
uiEndBlock(C, block);
|
||||
}
|
||||
|
||||
|
||||
void render_panel_anim(const bContext *C, ARegion *ar)
|
||||
{
|
||||
Scene *scene= CTX_data_scene(C);
|
||||
uiBlock *block;
|
||||
|
||||
block= uiBeginBlock(C, ar, "render_panel_anim", UI_EMBOSS, UI_HELV);
|
||||
if(uiNewPanel(C, ar, block, "Anim", "Render", 640, 0, 318, 204) == 0) return;
|
||||
|
||||
uiDefBut(block, BUT, 0, "ANIM", 692,142,192,47, 0, 0, 0, 0, 0, "Render the animation to disk from start to end frame, (Ctrl+F12)");
|
||||
|
||||
uiBlockSetCol(block, TH_BUT_SETTING1);
|
||||
uiBlockBeginAlign(block);
|
||||
uiDefButBitI(block, TOG, R_DOSEQ, 0, "Do Sequence",692,114,192,20, &scene->r.scemode, 0, 0, 0, 0, "Enables sequence output rendering (Default: 3D rendering)");
|
||||
uiDefButBitI(block, TOG, R_DOCOMP, 0, "Do Composite",692,90,192,20, &scene->r.scemode, 0, 0, 0, 0, "Uses compositing nodes for output rendering");
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
uiBlockSetCol(block, TH_AUTO);
|
||||
uiDefBut(block, BUT, 0, "PLAY",692,50,94,33, 0, 0, 0, 0, 0, "Play rendered images/avi animation (Ctrl+F11), (Play Hotkeys: A-Noskip, P-PingPong)");
|
||||
uiDefButS(block, NUM, 0, "rt:",789,50,95,33, &G.rt, -1000.0, 1000.0, 0, 0, "General testing/debug button");
|
||||
|
||||
uiBlockBeginAlign(block);
|
||||
uiDefButI(block, NUM,0,"Sta:",692,20,94,24, &scene->r.sfra,1.0,MAXFRAMEF, 0, 0, "The start frame of the animation (inclusive)");
|
||||
uiDefButI(block, NUM,0,"End:",789,20,95,24, &scene->r.efra,SFRA,MAXFRAMEF, 0, 0, "The end frame of the animation (inclusive)");
|
||||
uiDefButI(block, NUM,0,"Step:",692,0,192,18, &scene->frame_step, 1.0, MAXFRAMEF, 0, 0, "Frame Step");
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
uiEndBlock(C, block);
|
||||
}
|
||||
|
||||
void buttons_scene(const bContext *C, ARegion *ar)
|
||||
{
|
||||
SpaceButs *sbuts= (SpaceButs*)CTX_wm_space_data(C);
|
||||
int tab= sbuts->tab[CONTEXT_SCENE];
|
||||
|
||||
if(tab == TAB_SCENE_RENDER) {
|
||||
render_panel_output(C, ar);
|
||||
render_panel_render(C, ar);
|
||||
render_panel_anim(C, ar);
|
||||
render_panel_bake(C, ar);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,9 +158,10 @@ static void buttons_main_area_init(wmWindowManager *wm, ARegion *ar)
|
||||
static void buttons_main_area_draw(const bContext *C, ARegion *ar)
|
||||
{
|
||||
/* draw entirely, view changes should be handled here */
|
||||
// SpaceButs *sbuts= (SpaceButs*)CTX_wm_space_data(C);
|
||||
SpaceButs *sbuts= (SpaceButs*)CTX_wm_space_data(C);
|
||||
View2D *v2d= &ar->v2d;
|
||||
float col[3], fac;
|
||||
int align= 0;
|
||||
|
||||
/* clear and setup matrix */
|
||||
UI_GetThemeColor3fv(TH_BACK, col);
|
||||
@@ -174,8 +175,16 @@ static void buttons_main_area_draw(const bContext *C, ARegion *ar)
|
||||
glColor3f(fac, fac, fac);
|
||||
glRecti(20, 2, 30, 12);
|
||||
|
||||
/* data... */
|
||||
/* panels */
|
||||
if(sbuts->mainb == CONTEXT_SCENE)
|
||||
buttons_scene(C, ar);
|
||||
|
||||
if(sbuts->align)
|
||||
if(sbuts->re_align || sbuts->mainbo!=sbuts->mainb || sbuts->tabo!=sbuts->tab[sbuts->mainb])
|
||||
align= 1;
|
||||
|
||||
uiDrawPanels(C, align);
|
||||
uiMatchPanelsView2d(ar);
|
||||
|
||||
/* reset view matrix */
|
||||
UI_view2d_view_restore(C);
|
||||
@@ -247,7 +256,7 @@ void ED_spacetype_buttons(void)
|
||||
art->init= buttons_main_area_init;
|
||||
art->draw= buttons_main_area_draw;
|
||||
art->listener= buttons_main_area_listener;
|
||||
art->keymapflag= ED_KEYMAP_VIEW2D;
|
||||
art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
|
||||
|
||||
BLI_addhead(&st->regiontypes, art);
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ void file_header_buttons(const bContext *C, ARegion *ar)
|
||||
UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin);
|
||||
|
||||
uiEndBlock(C, block);
|
||||
uiDrawBlock(block);
|
||||
uiDrawBlock(C, block);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ void image_header_buttons(const bContext *C, ARegion *ar)
|
||||
UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin);
|
||||
|
||||
uiEndBlock(C, block);
|
||||
uiDrawBlock(block);
|
||||
uiDrawBlock(C, block);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -150,7 +150,7 @@ void info_header_buttons(const bContext *C, ARegion *ar)
|
||||
UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin);
|
||||
|
||||
uiEndBlock(C, block);
|
||||
uiDrawBlock(block);
|
||||
uiDrawBlock(C, block);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ void ipo_header_buttons(const bContext *C, ARegion *ar)
|
||||
UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin);
|
||||
|
||||
uiEndBlock(C, block);
|
||||
uiDrawBlock(block);
|
||||
uiDrawBlock(C, block);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ void nla_header_buttons(const bContext *C, ARegion *ar)
|
||||
UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin);
|
||||
|
||||
uiEndBlock(C, block);
|
||||
uiDrawBlock(block);
|
||||
uiDrawBlock(C, block);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
extern void ui_dropshadow(rctf *rct, float radius, float aspect, int select);
|
||||
extern void ui_rasterpos_safe(float x, float y, float aspect);
|
||||
extern void gl_round_box(int mode, float minx, float miny, float maxx, float maxy, float rad);
|
||||
void ui_draw_tria_icon(float x, float y, float aspect, char dir) {}
|
||||
extern void ui_draw_tria_icon(float x, float y, float aspect, char dir);
|
||||
|
||||
// XXX butspace.h
|
||||
#define B_NODE_EXEC 3610
|
||||
@@ -837,7 +837,7 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
|
||||
if(node->typeinfo->butfunc) {
|
||||
node->typeinfo->butfunc(block, snode->nodetree, node, &node->butr);
|
||||
}
|
||||
uiDrawBlock(block);
|
||||
uiDrawBlock(C, block);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1155,4 +1155,4 @@ void drawnodespace(const bContext *C, ARegion *ar, View2D *v2d)
|
||||
scrollers= UI_view2d_scrollers_calc(C, v2d, 10/*unit*/, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY);
|
||||
UI_view2d_scrollers_draw(C, v2d, scrollers);
|
||||
UI_view2d_scrollers_free(scrollers);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -783,7 +783,7 @@ void node_header_buttons(const bContext *C, ARegion *ar)
|
||||
UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, (int)(ar->v2d.tot.ymax-ar->v2d.tot.ymin));
|
||||
|
||||
uiEndBlock(C, block);
|
||||
uiDrawBlock(block);
|
||||
uiDrawBlock(C, block);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3828,7 +3828,7 @@ void draw_outliner(const bContext *C)
|
||||
}
|
||||
|
||||
uiEndBlock(C, block);
|
||||
uiDrawBlock(block);
|
||||
uiDrawBlock(C, block);
|
||||
|
||||
/* clear flag that allows quick redraws */
|
||||
soops->storeflag &= ~SO_TREESTORE_REDRAW;
|
||||
|
||||
@@ -228,7 +228,7 @@ void outliner_header_buttons(const bContext *C, ARegion *ar)
|
||||
UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin);
|
||||
|
||||
uiEndBlock(C, block);
|
||||
uiDrawBlock(block);
|
||||
uiDrawBlock(C, block);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@ void UI_table_draw(const bContext *C, uiTable *table)
|
||||
fdrawline(rct->xmin+COLUMN_WIDTH*(col+1), rct->ymin, rct->xmin+COLUMN_WIDTH*(col+1), rct->ymax);
|
||||
|
||||
uiEndBlock(C, block);
|
||||
uiDrawBlock(block);
|
||||
uiDrawBlock(C, block);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ void script_header_buttons(const bContext *C, ARegion *ar)
|
||||
UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin);
|
||||
|
||||
uiEndBlock(C, block);
|
||||
uiDrawBlock(block);
|
||||
uiDrawBlock(C, block);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ void sequencer_header_buttons(const bContext *C, ARegion *ar)
|
||||
UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin);
|
||||
|
||||
uiEndBlock(C, block);
|
||||
uiDrawBlock(block);
|
||||
uiDrawBlock(C, block);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ void sound_header_buttons(const bContext *C, ARegion *ar)
|
||||
UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin);
|
||||
|
||||
uiEndBlock(C, block);
|
||||
uiDrawBlock(block);
|
||||
uiDrawBlock(C, block);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ void text_header_buttons(const bContext *C, ARegion *ar)
|
||||
UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin);
|
||||
|
||||
uiEndBlock(C, block);
|
||||
uiDrawBlock(block);
|
||||
uiDrawBlock(C, block);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -553,7 +553,7 @@ void time_header_buttons(const bContext *C, ARegion *ar)
|
||||
UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin);
|
||||
|
||||
uiEndBlock(C, block);
|
||||
uiDrawBlock(block);
|
||||
uiDrawBlock(C, block);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -5995,7 +5995,7 @@ void view3d_header_buttons(const bContext *C, ARegion *ar)
|
||||
UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin);
|
||||
|
||||
uiEndBlock(C, block);
|
||||
uiDrawBlock(block);
|
||||
uiDrawBlock(C, block);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
|
||||
struct SpaceType;
|
||||
struct SpaceLink;
|
||||
struct ARegion;
|
||||
struct ARegionType;
|
||||
struct Scene;
|
||||
struct wmTimer;
|
||||
@@ -88,9 +89,9 @@ typedef struct Panel { /* the part from uiBlock that needs saved in file */
|
||||
short flag, active; /* active= used currently by a uiBlock */
|
||||
short control;
|
||||
short snap;
|
||||
short old_ofsx, old_ofsy; /* for stow */
|
||||
int sortcounter; /* when sorting panels, it uses this to put new ones in right place */
|
||||
int sortcounter, pad; /* when sorting panels, it uses this to put new ones in right place */
|
||||
struct Panel *paneltab; /* this panel is tabbed in *paneltab */
|
||||
void *activedata; /* runtime for panel manipulation */
|
||||
} Panel;
|
||||
|
||||
typedef struct ScrArea {
|
||||
@@ -112,9 +113,7 @@ typedef struct ScrArea {
|
||||
|
||||
struct SpaceType *type; /* callbacks for this space type */
|
||||
|
||||
ListBase spacedata;
|
||||
ListBase uiblocks; /* uiBlock */
|
||||
ListBase panels;
|
||||
ListBase spacedata; /* SpaceLink */
|
||||
ListBase regionbase; /* ARegion */
|
||||
ListBase handlers; /* wmEventHandler */
|
||||
|
||||
@@ -141,7 +140,8 @@ typedef struct ARegion {
|
||||
|
||||
struct ARegionType *type; /* callbacks for this region type */
|
||||
|
||||
ListBase uiblocks;
|
||||
ListBase uiblocks; /* uiBlock */
|
||||
ListBase panels; /* Panel */
|
||||
ListBase handlers; /* wmEventHandler */
|
||||
|
||||
char *headerstr; /* use this string to draw info */
|
||||
|
||||
@@ -436,10 +436,9 @@ typedef struct SpaceImaSel {
|
||||
|
||||
/* **************** SPACE DEFINES ********************* */
|
||||
|
||||
|
||||
/* button defines */
|
||||
/* warning: the values of these defines are used in sbuts->tabs[7] */
|
||||
/* buts->mainb new */
|
||||
/* sbuts->mainb new */
|
||||
#define CONTEXT_SCENE 0
|
||||
#define CONTEXT_OBJECT 1
|
||||
#define CONTEXT_TYPES 2
|
||||
@@ -448,7 +447,7 @@ typedef struct SpaceImaSel {
|
||||
#define CONTEXT_SCRIPT 5
|
||||
#define CONTEXT_LOGIC 6
|
||||
|
||||
/* buts->tab new */
|
||||
/* sbuts->tab new */
|
||||
#define TAB_SHADING_MAT 0
|
||||
#define TAB_SHADING_TEX 1
|
||||
#define TAB_SHADING_RAD 2
|
||||
@@ -465,10 +464,13 @@ typedef struct SpaceImaSel {
|
||||
#define TAB_SCENE_SOUND 3
|
||||
#define TAB_SCENE_SEQUENCER 4
|
||||
|
||||
|
||||
/* sbuts->flag */
|
||||
#define SB_PRV_OSA 1
|
||||
|
||||
/* sbuts->align */
|
||||
#define BUT_HORIZONTAL 1
|
||||
#define BUT_VERTICAL 2
|
||||
|
||||
/* these values need to be hardcoded in structs, dna does not recognize defines */
|
||||
/* also defined in BKE */
|
||||
#define FILE_MAXDIR 160
|
||||
|
||||
Reference in New Issue
Block a user