- Added button align code:
uiBlockBeginAlign(block, 'v'); 'v'= vertical. 'h'=horizontal ..... (button def calls) uiBlockEndAlign(block); this will allow new themes to have buttons nicely drawn together. - added new rounded draw theme, to test & illustrate the above. - only did parts of button code with align... rest for later - fixed 'minimal' theme to make it usable (with some decoration) - put back 'oldskool' theme... but it just looks plain ugly! remove? Lazy people: http://www.blender.org/bf/rt.jpg check the top header, or Nkey menu, to see the meaning of 'align'.
This commit is contained in:
@@ -74,6 +74,7 @@ struct ScrArea;
|
||||
#define UI_BLOCK_BUSY 8
|
||||
#define UI_BLOCK_NUMSELECT 16
|
||||
#define UI_BLOCK_ENTER_OK 32
|
||||
/* block->flag bits 12-15 are identical to but->flag bits */
|
||||
|
||||
/* block->font, for now: bold = medium+1 */
|
||||
#define UI_HELV 0
|
||||
@@ -100,6 +101,13 @@ struct ScrArea;
|
||||
#define UI_MAKE_RIGHT 1024
|
||||
/* dont draw hilite on mouse over */
|
||||
#define UI_NO_HILITE 2048
|
||||
/* button align flag, for drawing groups together */
|
||||
#define UI_BUT_ALIGN (15<<12)
|
||||
#define UI_BUT_ALIGN_TOP (1<<12)
|
||||
#define UI_BUT_ALIGN_LEFT (1<<13)
|
||||
#define UI_BUT_ALIGN_RIGHT (1<<14)
|
||||
#define UI_BUT_ALIGN_DOWN (1<<15)
|
||||
|
||||
|
||||
/* Button types */
|
||||
#define CHA 32
|
||||
@@ -166,6 +174,10 @@ void uiFreeBlocks(struct ListBase *lb);
|
||||
void uiFreeBlocksWin(struct ListBase *lb, int win);
|
||||
uiBlock *uiNewBlock(struct ListBase *lb, char *name, short dt, short font, short win);
|
||||
uiBlock *uiGetBlock(char *name, struct ScrArea *sa);
|
||||
|
||||
void uiBlockBeginAlign(uiBlock *block, char dir);
|
||||
void uiBlockEndAlign(uiBlock *block);
|
||||
|
||||
uiBut *uiDefBut(uiBlock *block,
|
||||
int type, int retval, char *str,
|
||||
short x1, short y1,
|
||||
|
||||
@@ -111,7 +111,8 @@ typedef struct {
|
||||
|
||||
struct uiBut {
|
||||
uiBut *next, *prev;
|
||||
short type, pointype, bit, bitnr, retval, flag, strwidth, ofs, pos;
|
||||
short type, pointype, bit, bitnr, retval, strwidth, ofs, pos;
|
||||
int flag;
|
||||
|
||||
char *str;
|
||||
char strdata[UI_MAX_NAME_STR];
|
||||
@@ -182,13 +183,12 @@ struct uiBlock {
|
||||
void (*drawextra)();
|
||||
|
||||
int themecol; /* themecolor id */
|
||||
short but_align; /* aligning buttons, horiz/vertical */
|
||||
|
||||
short font; /* indices */
|
||||
int afterval;
|
||||
int afterval, flag;
|
||||
void *curfont;
|
||||
|
||||
short autofill, flag, win, winq, direction, dt, frontbuf, auto_open; //frontbuf see below
|
||||
short autofill, win, winq, direction, dt, frontbuf, auto_open; //frontbuf see below
|
||||
void *saveunder;
|
||||
|
||||
float xofs, yofs; // offset to parent button
|
||||
@@ -208,6 +208,7 @@ extern void ui_window_to_graphics(int win, float *x, float *y);
|
||||
/* interface_panel.c */
|
||||
extern void ui_draw_panel(uiBlock *block);
|
||||
extern void ui_do_panel(uiBlock *block, uiEvent *uevent);
|
||||
extern void gl_round_box(float minx, float miny, float maxx, float maxy, float rad);
|
||||
|
||||
/* interface_draw.c */
|
||||
extern void ui_set_embossfunc(uiBut *but, int drawtype);
|
||||
|
||||
@@ -954,12 +954,16 @@ static void render_panel_output()
|
||||
block= uiNewBlock(&curarea->uiblocks, "render_panel_output", UI_EMBOSS, UI_HELV, curarea->win);
|
||||
if(uiNewPanel(curarea, block, "Output", "Render", 0, 0, 318, 204)==0) return;
|
||||
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefBut(block, TEX,0,"", 30, 170, 268, 19,G.scene->r.pic, 0.0,79.0, 0, 0, "Directory/name to save rendered Pics to");
|
||||
uiDefIconBut(block, BUT, B_FS_PIC, ICON_FILESEL, 8, 170, 20, 19, 0, 0, 0, 0, 0, "Open Fileselect to get Pics dir/name");
|
||||
uiDefBut(block, TEX,0,"", 30, 148, 268, 19,G.scene->r.backbuf, 0.0,79.0, 0, 0, "Image to use as background for rendering");
|
||||
uiDefIconBut(block, BUT,B_FS_BACKBUF, ICON_FILESEL, 8, 148, 20, 19, 0, 0, 0, 0, 0, "Open Fileselect to get Backbuf image");
|
||||
uiDefBut(block, TEX,0,"", 30, 125, 268, 19,G.scene->r.ftype,0.0,79.0, 0, 0, "Image to use with FTYPE Image type");
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefIconBut(block, BUT, B_FS_PIC, ICON_FILESEL, 8, 170, 20, 19, 0, 0, 0, 0, 0, "Open Fileselect to get Pics dir/name");
|
||||
uiDefIconBut(block, BUT,B_FS_BACKBUF, ICON_FILESEL, 8, 148, 20, 19, 0, 0, 0, 0, 0, "Open Fileselect to get Backbuf image");
|
||||
uiDefIconBut(block, BUT,B_FS_FTYPE, ICON_FILESEL, 8, 125, 20, 19, 0, 0, 0, 0, 0, "Open Fileselect to get Ftype image");
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
uiDefIconBut(block, BUT, B_CLEARSET, ICON_X, 131, 95, 20, 19, 0, 0, 0, 0, 0, "Remove Set link");
|
||||
|
||||
/* SET BUTTON */
|
||||
@@ -986,8 +990,10 @@ static void render_panel_output()
|
||||
for(a=0; a<3; a++)
|
||||
uiDefButS(block, TOG|BIT|(3*b+a), 800,"", (short)(9+18*a),(short)(7+12*b),16,10, &R.winpos, 0, 0, 0, 0, "Render window placement on screen");
|
||||
|
||||
uiBlockBeginAlign(block, 'h');
|
||||
uiDefButS(block, ROW, B_REDR, "DispView", 72, 7, 65, 19, &R.displaymode, 0.0, (float)R_DISPLAYVIEW, 0, 0, "Sets render output to display in 3D view");
|
||||
uiDefButS(block, ROW, B_REDR, "DispWin", 139, 7, 62, 19, &R.displaymode, 0.0, (float)R_DISPLAYWIN, 0, 0, "Sets render output to display in a seperate window");
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
uiDefButS(block, TOG|BIT|4, 0, "Extensions", 228, 8, 67, 18, &G.scene->r.scemode, 0.0, 0.0, 0, 0, "Adds extensions to the output when rendering animations");
|
||||
|
||||
@@ -1020,17 +1026,21 @@ static void render_panel_render()
|
||||
uiDefButF(block, NUM,B_DIFF,"Bf:", 495,90,65,20,&G.scene->r.blurfac, 0.01, 5.0, 10, 0, "Sets motion blur factor");
|
||||
uiDefButS(block, TOG|BIT|14, 0, "MBLUR", 495,114,66,20,&G.scene->r.mode, 0, 0, 0, 0, "Enables Motion Blur calculation");
|
||||
|
||||
uiBlockBeginAlign(block, 'h');
|
||||
uiDefButS(block, ROW,B_DIFF,"5", 369,90,29,20,&G.scene->r.osa,2.0,5.0, 0, 0, "Sets oversample level to 5");
|
||||
uiDefButS(block, ROW,B_DIFF,"8", 400,90,29,20,&G.scene->r.osa,2.0,8.0, 0, 0, "Sets oversample level to 8 (Recommended)");
|
||||
uiDefButS(block, ROW,B_DIFF,"11", 431,90,33,20,&G.scene->r.osa,2.0,11.0, 0, 0, "Sets oversample level to 11");
|
||||
uiDefButS(block, ROW,B_DIFF,"16", 466,90,28,20,&G.scene->r.osa,2.0,16.0, 0, 0, "Sets oversample level to 16");
|
||||
|
||||
uiBlockBeginAlign(block, 'h');
|
||||
uiDefButS(block, NUM,B_DIFF,"Xparts:", 369,42,99,31,&G.scene->r.xparts,1.0, 64.0, 0, 0, "Sets the number of horizontal parts to render image in (For panorama sets number of camera slices)");
|
||||
uiDefButS(block, NUM,B_DIFF,"Yparts:", 472,42,86,31,&G.scene->r.yparts,1.0, 64.0, 0, 0, "Sets the number of vertical parts to render image in");
|
||||
|
||||
uiBlockBeginAlign(block, 'h');
|
||||
uiDefButS(block, ROW,800,"Sky", 369,11,38,24,&G.scene->r.alphamode,3.0,0.0, 0, 0, "Fill background with sky");
|
||||
uiDefButS(block, ROW,800,"Premul", 410,11,54,24,&G.scene->r.alphamode,3.0,1.0, 0, 0, "Multiply alpha in advance");
|
||||
uiDefButS(block, ROW,800,"Key", 467,11,44,24,&G.scene->r.alphamode,3.0,2.0, 0, 0, "Alpha and colour values remain unchanged");
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
uiDefButS(block, TOG|BIT|1,0,"Shadow", 565,167,61,22, &G.scene->r.mode, 0, 0, 0, 0, "Enable shadow calculation");
|
||||
uiDefButS(block, TOG|BIT|4,0,"EnvMap", 626,167,61,22, &G.scene->r.mode, 0, 0, 0, 0, "Enable environment map renering");
|
||||
@@ -1038,14 +1048,17 @@ static void render_panel_render()
|
||||
uiDefButS(block, TOG|BIT|8,0,"Radio", 626,142,61,22, &G.scene->r.mode, 0, 0, 0, 0, "Enable radiosity rendering");
|
||||
|
||||
uiDefButS(block, ROW,B_DIFF,"100%", 565,114,121,20,&G.scene->r.size,1.0,100.0, 0, 0, "Set render size to defined size");
|
||||
uiBlockBeginAlign(block, 'h');
|
||||
uiDefButS(block, ROW,B_DIFF,"75%", 565,90,36,20,&G.scene->r.size,1.0,75.0, 0, 0, "Set render size to 3/4 of defined size");
|
||||
uiDefButS(block, ROW,B_DIFF,"50%", 604,90,40,20,&G.scene->r.size,1.0,50.0, 0, 0, "Set render size to 1/2 of defined size");
|
||||
uiDefButS(block, ROW,B_DIFF,"25%", 647,90,39,20,&G.scene->r.size,1.0,25.0, 0, 0, "Set render size to 1/4 of defined size");
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
uiDefButS(block, TOG|BIT|6,0,"Fields", 564,42,90,31,&G.scene->r.mode, 0, 0, 0, 0, "Enables field rendering");
|
||||
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButS(block, TOG|BIT|13,0,"Odd", 655,57,30,16,&G.scene->r.mode, 0, 0, 0, 0, "Enables Odd field first rendering (Default: Even field)");
|
||||
uiDefButS(block, TOG|BIT|7,0,"x", 655,42,30,15,&G.scene->r.mode, 0, 0, 0, 0, "Disables time difference in field calculations");
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
uiDefButS(block, TOG|BIT|9,REDRAWVIEWCAM, "Border", 565,11,58,24, &G.scene->r.mode, 0, 0, 0, 0, "Render a small cut-out of the image");
|
||||
uiDefButS(block, TOG|BIT|2,0, "Gamma", 626,11,58,24, &G.scene->r.mode, 0, 0, 0, 0, "Enable gamma correction");
|
||||
@@ -1065,16 +1078,19 @@ static void render_panel_anim()
|
||||
uiDefBut(block, BUT,B_DOANIM,"ANIM", 692,142,192,47, 0, 0, 0, 0, 0, "Start rendering a sequence");
|
||||
|
||||
uiBlockSetCol(block, TH_BUT_SETTING1);
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButS(block, TOG|BIT|0, 0, "Do Sequence", 692,114,192,20, &G.scene->r.scemode, 0, 0, 0, 0, "Enables sequence output rendering (Default: 3D rendering)");
|
||||
uiDefButS(block, TOG|BIT|1, 0, "Render Daemon", 692,90,192,20, &G.scene->r.scemode, 0, 0, 0, 0, "Let external network render current scene");
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
uiBlockSetCol(block, TH_AUTO);
|
||||
uiDefBut(block, BUT,B_PLAYANIM, "PLAY", 692,40,94,33, 0, 0, 0, 0, 0, "Play animation of rendered images/avi (searches Pics: field)");
|
||||
uiDefButS(block, NUM, B_RTCHANGED, "rt:", 790,40,95,33, &G.rt, -1000.0, 1000.0, 0, 0, "General testing/debug button");
|
||||
|
||||
uiBlockBeginAlign(block, 'h');
|
||||
uiDefButS(block, NUM,REDRAWSEQ,"Sta:", 692,10,94,24, &G.scene->r.sfra,1.0,18000.0, 0, 0, "The start frame of the animation");
|
||||
uiDefButS(block, NUM,REDRAWSEQ,"End:", 790,10,95,24, &G.scene->r.efra,1.0,18000.0, 0, 0, "The end frame of the animation");
|
||||
|
||||
uiBlockEndAlign(block);
|
||||
}
|
||||
|
||||
static void render_panel_format()
|
||||
@@ -1088,11 +1104,13 @@ static void render_panel_format()
|
||||
|
||||
uiDefBlockBut(block, framing_render_menu, NULL, "Game framing settings |>> ", 892, 169, 227, 20, "Display game framing settings");
|
||||
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButS(block, NUM,REDRAWVIEWCAM,"SizeX:", 892 ,136,112,27, &G.scene->r.xsch, 4.0, 10000.0, 0, 0, "The image width in pixels");
|
||||
uiDefButS(block, NUM,REDRAWVIEWCAM,"SizeY:", 1007,136,112,27, &G.scene->r.ysch, 4.0,10000.0, 0, 0, "The image height in scanlines");
|
||||
uiDefButS(block, NUM,REDRAWVIEWCAM,"AspX:", 892 ,114,112,20, &G.scene->r.xasp, 1.0,200.0, 0, 0, "The horizontal aspect ratio");
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButS(block, NUM,REDRAWVIEWCAM,"SizeY:", 1007,136,112,27, &G.scene->r.ysch, 4.0,10000.0, 0, 0, "The image height in scanlines");
|
||||
uiDefButS(block, NUM,REDRAWVIEWCAM,"AspY:", 1007,114,112,20, &G.scene->r.yasp, 1.0,200.0, 0, 0, "The vertical aspect ratio");
|
||||
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
yofs = 54;
|
||||
|
||||
@@ -1157,12 +1175,12 @@ static void render_panel_format()
|
||||
uiDefButS(block, NUM,REDRAWALL,"Frs/sec:", 1006,yofs,113,20, &G.scene->r.frs_sec, 1.0, 120.0, 100.0, 0, "Frames per second");
|
||||
|
||||
|
||||
uiBlockBeginAlign(block, 'h');
|
||||
uiDefButS(block, ROW,B_DIFF,"BW", 892, 10,74,19, &G.scene->r.planes, 5.0,(float)R_PLANESBW, 0, 0, "Images are saved with BW (grayscale) data");
|
||||
uiDefButS(block, ROW,B_DIFF,"RGB", 968, 10,74,19, &G.scene->r.planes, 5.0,(float)R_PLANES24, 0, 0, "Images are saved with RGB (color) data");
|
||||
uiDefButS(block, ROW,B_DIFF,"RGBA", 1044, 10,75,19, &G.scene->r.planes, 5.0,(float)R_PLANES32, 0, 0, "Images are saved with RGB and Alpha data (if supported)");
|
||||
|
||||
uiDefButS(block, ROW,B_DIFF,"BW", 892, 10,74,20, &G.scene->r.planes, 5.0,(float)R_PLANESBW, 0, 0, "Images are saved with BW (grayscale) data");
|
||||
uiDefButS(block, ROW,B_DIFF,"RGB", 968, 10,74,20, &G.scene->r.planes, 5.0,(float)R_PLANES24, 0, 0, "Images are saved with RGB (color) data");
|
||||
uiDefButS(block, ROW,B_DIFF,"RGBA", 1044, 10,75,20, &G.scene->r.planes, 5.0,(float)R_PLANES32, 0, 0, "Images are saved with RGB and Alpha data (if supported)");
|
||||
|
||||
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefBut(block, BUT,B_PR_PAL, "PAL", 1146,170,100,18, 0, 0, 0, 0, 0, "Size preset: Image size - 720x576, Aspect ratio - 54x51, 25 fps");
|
||||
uiDefBut(block, BUT,B_PR_NTSC, "NTSC", 1146,150,100,18, 0, 0, 0, 0, 0, "Size preset: Image size - 720x480, Aspect ratio - 10x11, 30 fps");
|
||||
uiDefBut(block, BUT,B_PR_PRESET, "Default", 1146,130,100,18, 0, 0, 0, 0, 0, "Same as PAL, with render settings (OSA, Shadows, Fields)");
|
||||
@@ -1172,7 +1190,7 @@ static void render_panel_format()
|
||||
uiDefBut(block, BUT,B_PR_PANO, "PANO", 1146,50,100,18, 0, 0, 0, 0, 0, "Standard panorama settings");
|
||||
uiDefBut(block, BUT,B_PR_FULL, "FULL", 1146,30,100,18, 0, 0, 0, 0, 0, "Size preset: Image size - 1280x1024, Aspect ratio - 1x1");
|
||||
uiDefButS(block, TOG|BIT|15, B_REDR, "Unified Renderer", 1146,10,100,18, &G.scene->r.mode, 0, 0, 0, 0, "Use the unified renderer.");
|
||||
|
||||
uiBlockEndAlign(block);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -877,15 +877,17 @@ static void texture_panel_image1(Tex *tex)
|
||||
uiDefButS(block, NUM, B_TEXPRV, "StartFr:", 642,30,150,19, &tex->sfra, 1.0, 9000.0, 0, 0, "Set the start frame of the animation");
|
||||
uiDefButS(block, NUM, B_TEXPRV, "Len:", 642,10,150,19, &tex->len, 0.0, 9000.0, 0, 0, "Set the length of the animation");
|
||||
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButS(block, NUM, B_TEXPRV, "Fra:", 802,70,73,19, &(tex->fradur[0][0]), 0.0, 18000.0, 0, 0, "Montage mode: frame start");
|
||||
uiDefButS(block, NUM, B_TEXPRV, "", 879,70,37,19, &(tex->fradur[0][1]), 0.0, 250.0, 0, 0, "Montage mode: amount of displayed frames");
|
||||
uiDefButS(block, NUM, B_TEXPRV, "Fra:", 802,50,73,19, &(tex->fradur[1][0]), 0.0, 18000.0, 0, 0, "Montage mode: frame start");
|
||||
uiDefButS(block, NUM, B_TEXPRV, "", 879,50,37,19, &(tex->fradur[1][1]), 0.0, 250.0, 0, 0, "Montage mode: amount of displayed frames");
|
||||
uiDefButS(block, NUM, B_TEXPRV, "Fra:", 802,30,73,19, &(tex->fradur[2][0]), 0.0, 18000.0, 0, 0, "Montage mode: frame start");
|
||||
uiDefButS(block, NUM, B_TEXPRV, "", 879,30,37,19, &(tex->fradur[2][1]), 0.0, 250.0, 0, 0, "Montage mode: amount of displayed frames");
|
||||
uiDefButS(block, NUM, B_TEXPRV, "Fra:", 802,10,73,19, &(tex->fradur[3][0]), 0.0, 18000.0, 0, 0, "Montage mode: frame start");
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButS(block, NUM, B_TEXPRV, "", 879,70,37,19, &(tex->fradur[0][1]), 0.0, 250.0, 0, 0, "Montage mode: amount of displayed frames");
|
||||
uiDefButS(block, NUM, B_TEXPRV, "", 879,50,37,19, &(tex->fradur[1][1]), 0.0, 250.0, 0, 0, "Montage mode: amount of displayed frames");
|
||||
uiDefButS(block, NUM, B_TEXPRV, "", 879,30,37,19, &(tex->fradur[2][1]), 0.0, 250.0, 0, 0, "Montage mode: amount of displayed frames");
|
||||
uiDefButS(block, NUM, B_TEXPRV, "", 879,10,37,19, &(tex->fradur[3][1]), 0.0, 250.0, 0, 0, "Montage mode: amount of displayed frames");
|
||||
|
||||
uiBlockEndAlign(block);
|
||||
uiDefButS(block, TOG|BIT|6, 0, "Cyclic", 743,60,48,19, &tex->imaflag, 0, 0, 0, 0, "Repeat animation image");
|
||||
}
|
||||
}
|
||||
@@ -902,17 +904,19 @@ static void texture_panel_image(Tex *tex)
|
||||
uiSetButLock(tex->id.lib!=0, "Can't edit library data");
|
||||
|
||||
/* types */
|
||||
uiBlockBeginAlign(block, 'h');
|
||||
uiDefButS(block, TOG|BIT|0, 0, "InterPol", 10, 180, 75, 18, &tex->imaflag, 0, 0, 0, 0, "Interpolate pixels of the image");
|
||||
uiDefButS(block, TOG|BIT|1, B_TEXPRV, "UseAlpha", 85, 180, 75, 18, &tex->imaflag, 0, 0, 0, 0, "Use the alpha layer");
|
||||
uiDefButS(block, TOG|BIT|5, B_TEXPRV, "CalcAlpha", 160, 180, 75, 18, &tex->imaflag, 0, 0, 0, 0, "Calculate an alpha based on the RGB");
|
||||
uiDefButS(block, TOG|BIT|2, B_TEXPRV, "NegAlpha", 235, 180, 75, 18, &tex->flag, 0, 0, 0, 0, "Reverse the alpha value");
|
||||
|
||||
uiBlockBeginAlign(block, 'h');
|
||||
uiDefButS(block, TOG|BIT|2, B_IMAPTEST, "MipMap", 10, 160, 60, 18, &tex->imaflag, 0, 0, 0, 0, "Generate a series of pictures used for mipmapping");
|
||||
uiDefButS(block, TOG|BIT|3, B_IMAPTEST, "Fields", 70, 160, 50, 18, &tex->imaflag, 0, 0, 0, 0, "Work with field images");
|
||||
uiDefButS(block, TOG|BIT|4, B_TEXPRV, "Rot90", 120, 160, 50, 18, &tex->imaflag, 0, 0, 0, 0, "Rotate image 90 degrees when rendered");
|
||||
uiDefButS(block, TOG|BIT|7, B_RELOADIMA, "Movie", 170, 160, 50, 18, &tex->imaflag, 0, 0, 0, 0, "Use a movie for an image");
|
||||
uiDefButS(block, TOG|BIT|8, 0, "Anti", 220, 160, 40, 18, &tex->imaflag, 0, 0, 0, 0, "Use anti-aliasing");
|
||||
uiDefButS(block, TOG|BIT|10, 0, "StField", 260, 160, 50, 18, &tex->imaflag, 0, 0, 0, 0, "");
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
/* file input */
|
||||
id= (ID *)tex->ima;
|
||||
@@ -938,19 +942,21 @@ static void texture_panel_image(Tex *tex)
|
||||
/* crop extend clip */
|
||||
|
||||
uiDefButF(block, NUM, B_TEXPRV, "Filter :", 10,92,150,19, &tex->filtersize, 0.1, 25.0, 0, 0, "Set the filter size used by mipmap and interpol");
|
||||
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButS(block, ROW, 0, "Extend", 10,70,75,19, &tex->extend, 4.0, 1.0, 0, 0, "Extend the colour of the edge");
|
||||
uiDefButS(block, ROW, 0, "Clip", 85,70,75,19, &tex->extend, 4.0, 2.0, 0, 0, "Return alpha 0.0 outside image");
|
||||
uiDefButS(block, ROW, 0, "ClipCube", 160,70,75,19, &tex->extend, 4.0, 4.0, 0, 0, "Return alpha 0.0 outside cubeshaped area around image");
|
||||
uiDefButS(block, ROW, 0, "Repeat", 235,70,75,19, &tex->extend, 4.0, 3.0, 0, 0, "Repeat image horizontally and vertically");
|
||||
|
||||
uiBlockBeginAlign(block, 'h');
|
||||
uiDefButS(block, NUM, B_TEXPRV, "Xrepeat:", 10,50,150,19, &tex->xrepeat, 1.0, 512.0, 0, 0, "Set the degree of repetition in the X direction");
|
||||
uiDefButS(block, NUM, B_TEXPRV, "Yrepeat:", 160,50,150,19, &tex->yrepeat, 1.0, 512.0, 0, 0, "Set the degree of repetition in the Y direction");
|
||||
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButF(block, NUM, B_REDR, "MinX ", 10,28,150,19, &tex->cropxmin, -10.0, 10.0, 10, 0, "Set minimum X value for cropping");
|
||||
uiDefButF(block, NUM, B_REDR, "MaxX ", 160,28,150,19, &tex->cropxmax, -10.0, 10.0, 10, 0, "Set maximum X value for cropping");
|
||||
uiDefButF(block, NUM, B_REDR, "MinY ", 10,8,150,19, &tex->cropymin, -10.0, 10.0, 10, 0, "Set minimum Y value for cropping");
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButF(block, NUM, B_REDR, "MaxX ", 160,28,150,19, &tex->cropxmax, -10.0, 10.0, 10, 0, "Set maximum X value for cropping");
|
||||
uiDefButF(block, NUM, B_REDR, "MaxY ", 160,8,150,19, &tex->cropymax, -10.0, 10.0, 10, 0, "Set maximum Y value for cropping");
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
}
|
||||
|
||||
@@ -987,24 +993,27 @@ static void texture_panel_colors(Tex *tex)
|
||||
uiBlockSetDrawExtraFunc(block, drawcolorband_cb);
|
||||
cbd= tex->coba->data + tex->coba->cur;
|
||||
|
||||
uiBlockBeginAlign(block, 'h');
|
||||
uiDefButF(block, NUM, B_CALCCBAND, "Pos", 10,120,80,20, &cbd->pos, 0.0, 1.0, 10, 0, "Set the position of the active colour");
|
||||
uiDefButS(block, ROW, B_TEXPRV, "E", 90,120,20,20, &tex->coba->ipotype, 5.0, 1.0, 0, 0, "Interpolation type Ease");
|
||||
uiDefButS(block, ROW, B_TEXPRV, "L", 110,120,20,20, &tex->coba->ipotype, 5.0, 0.0, 0, 0, "Interpolation type Linear");
|
||||
uiDefButS(block, ROW, B_TEXPRV, "S", 130,120,20,20, &tex->coba->ipotype, 5.0, 2.0, 0, 0, "Interpolation type Spline");
|
||||
uiDefButF(block, COL, B_BANDCOL, "", 150,120,30,20, &(cbd->r), 0, 0, 0, 0, "");
|
||||
uiDefButF(block, NUMSLI, B_TEXPRV, "A ", 180,120,130,20, &cbd->a, 0.0, 1.0, 0, 0, "Set the alpha value");
|
||||
|
||||
uiBlockBeginAlign(block, 'h');
|
||||
uiDefButF(block, NUMSLI, B_TEXPRV, "R ", 10,100,100,20, &cbd->r, 0.0, 1.0, B_BANDCOL, 0, "Set the red value");
|
||||
uiDefButF(block, NUMSLI, B_TEXPRV, "G ", 110,100,100,20, &cbd->g, 0.0, 1.0, B_BANDCOL, 0, "Set the green value");
|
||||
uiDefButF(block, NUMSLI, B_TEXPRV, "B ", 210,100,100,20, &cbd->b, 0.0, 1.0, B_BANDCOL, 0, "Set the blue value");
|
||||
|
||||
uiBlockEndAlign(block);
|
||||
}
|
||||
|
||||
/* RGB-BRICON */
|
||||
if((tex->flag & TEX_COLORBAND)==0) {
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButF(block, NUMSLI, B_TEXPRV, "R ", 60,80,200,20, &tex->rfac, 0.0, 2.0, 0, 0, "Set the red value");
|
||||
uiDefButF(block, NUMSLI, B_TEXPRV, "G ", 60,60,200,20, &tex->gfac, 0.0, 2.0, 0, 0, "Set the green value");
|
||||
uiDefButF(block, NUMSLI, B_TEXPRV, "B ", 60,40,200,20, &tex->bfac, 0.0, 2.0, 0, 0, "Set the blue value");
|
||||
uiBlockEndAlign(block);
|
||||
}
|
||||
uiDefButF(block, NUMSLI, B_TEXPRV, "Bright", 10,10,150,20, &tex->bright, 0.0, 2.0, 0, 0, "Set the brightness of the colour or intensity of a texture");
|
||||
uiDefButF(block, NUMSLI, B_TEXPRV, "Contr", 160,10,150,20, &tex->contrast, 0.01, 2.0, 0, 0, "Set the contrast of the colour or intensity of a texture");
|
||||
@@ -1043,6 +1052,7 @@ static void texture_panel_texture(MTex *mtex, Material *ma, World *wrld, Lamp *l
|
||||
/* From button: removed */
|
||||
|
||||
/* CHANNELS */
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
yco= 10;
|
||||
for(a= 7; a>=0; a--) {
|
||||
|
||||
@@ -1066,8 +1076,8 @@ static void texture_panel_texture(MTex *mtex, Material *ma, World *wrld, Lamp *l
|
||||
uiDefButS(block, ROW, B_TEXCHANNEL, str, 10,yco,140,19, &(la->texact), 0.0, (float)a, 0, 0, "");
|
||||
yco+= 20;
|
||||
}
|
||||
|
||||
}
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
uiBlockSetCol(block, TH_AUTO);
|
||||
|
||||
@@ -1114,10 +1124,11 @@ static void texture_panel_preview(int preview)
|
||||
// label to force a boundbox for buttons not to be centered
|
||||
uiDefBut(block, LABEL, 0, " ", 20,20,10,10, 0, 0, 0, 0, 0, "");
|
||||
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButC(block, ROW, B_TEXREDR_PRV, "Mat", 200,175,80,25, &G.buts->texfrom, 3.0, 0.0, 0, 0, "Display the texture of the active material");
|
||||
uiDefButC(block, ROW, B_TEXREDR_PRV, "World", 200,150,80,25, &G.buts->texfrom, 3.0, 1.0, 0, 0, "Display the texture of the world block");
|
||||
uiDefButC(block, ROW, B_TEXREDR_PRV, "Lamp", 200,125,80,25, &G.buts->texfrom, 3.0, 2.0, 0, 0, "Display the texture of the lamp");
|
||||
|
||||
uiBlockEndAlign(block);
|
||||
uiDefBut(block, BUT, B_DEFTEXVAR, "Default Vars",200,10,80,20, 0, 0, 0, 0, 0, "Return to standard values");
|
||||
|
||||
}
|
||||
@@ -1379,27 +1390,31 @@ static void world_panel_mapto(World *wrld)
|
||||
}
|
||||
|
||||
/* TEXTURE OUTPUT */
|
||||
uiBlockBeginAlign(block, 'h');
|
||||
uiDefButS(block, TOG|BIT|1, B_MATPRV, "Stencil", 920,114,52,18, &(mtex->texflag), 0, 0, 0, 0, "Use stencil mode");
|
||||
uiDefButS(block, TOG|BIT|2, B_MATPRV, "Neg", 974,114,38,18, &(mtex->texflag), 0, 0, 0, 0, "Inverse texture operation");
|
||||
uiDefButS(block, TOG|BIT|0, B_MATPRV, "RGBtoInt", 1014,114,69,18, &(mtex->texflag), 0, 0, 0, 0, "Use RGB values for intensity texure");
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
uiDefButF(block, COL, B_MTEXCOL, "", 920,100,163,12, &(mtex->r), 0, 0, 0, 0, "");
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "R ", 920,80,163,18, &(mtex->r), 0.0, 1.0, B_MTEXCOL, 0, "The amount of red that blends with the intensity colour");
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "G ", 920,60,163,18, &(mtex->g), 0.0, 1.0, B_MTEXCOL, 0, "The amount of green that blends with the intensity colour");
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "B ", 920,40,163,18, &(mtex->b), 0.0, 1.0, B_MTEXCOL, 0, "The amount of blue that blends with the intensity colour");
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "DVar ", 920,10,163,18, &(mtex->def_var), 0.0, 1.0, 0, 0, "The value that an intensity texture blends with the current value");
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
/* MAP TO */
|
||||
uiDefButS(block, TOG|BIT|0, B_MATPRV, "Blend", 1087,166,81,18, &(mtex->mapto), 0, 0, 0, 0, "Let the texture work on the colour progression in the sky");
|
||||
uiDefButS(block, TOG|BIT|1, B_MATPRV, "Hori", 1172,166,81,18, &(mtex->mapto), 0, 0, 0, 0, "Let the texture work on the colour of the horizon");
|
||||
uiDefButS(block, TOG|BIT|2, B_MATPRV, "ZenUp", 1087,147,81,18, &(mtex->mapto), 0, 0, 0, 0, "Let the texture work on the colour of the zenith above");
|
||||
uiDefButS(block, TOG|BIT|3, B_MATPRV, "ZenDo", 1172,147,81,18, &(mtex->mapto), 0, 0, 0, 0, "Let the texture work on the colour of the zenith below");
|
||||
|
||||
uiBlockBeginAlign(block, 'h');
|
||||
uiDefButS(block, ROW, B_MATPRV, "Blend", 1087,114,48,18, &(mtex->blendtype), 9.0, (float)MTEX_BLEND, 0, 0, "The texture blends the values");
|
||||
uiDefButS(block, ROW, B_MATPRV, "Mul", 1136,114,44,18, &(mtex->blendtype), 9.0, (float)MTEX_MUL, 0, 0, "The texture multiplies the values");
|
||||
uiDefButS(block, ROW, B_MATPRV, "Add", 1182,114,41,18, &(mtex->blendtype), 9.0, (float)MTEX_ADD, 0, 0, "The texture adds the values");
|
||||
uiDefButS(block, ROW, B_MATPRV, "Sub", 1226,114,40,18, &(mtex->blendtype), 9.0, (float)MTEX_SUB, 0, 0, "The texture subtracts the values");
|
||||
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "Col ", 1087,50,179,18, &(mtex->colfac), 0.0, 1.0, 0, 0, "Specify the extent to which the texture works on colour");
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "Nor ", 1087,30,179,18, &(mtex->norfac), 0.0, 1.0, 0, 0, "Specify the extent to which the texture works on the normal");
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "Var ", 1087,10,179,18, &(mtex->varfac), 0.0, 1.0, 0, 0, "Specify the extent to which the texture works on a value");
|
||||
@@ -1421,7 +1436,7 @@ static void world_panel_texture(World *wrld)
|
||||
|
||||
/* TEX CHANNELS */
|
||||
uiBlockSetCol(block, TH_BUT_NEUTRAL);
|
||||
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
for(a= 0; a<6; a++) {
|
||||
mtex= wrld->mtex[a];
|
||||
if(mtex && mtex->tex) splitIDname(mtex->tex->id.name+2, str, &loos);
|
||||
@@ -1429,6 +1444,7 @@ static void world_panel_texture(World *wrld)
|
||||
str[10]= 0;
|
||||
uiDefButS(block, ROW, REDRAWBUTSSHADING, str,10, 140-20*a, 80, 20, &(wrld->texact), 3.0, (float)a, 0, 0, "Texture channel");
|
||||
}
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
mtex= wrld->mtex[ wrld->texact ];
|
||||
if(mtex==0) {
|
||||
@@ -1467,14 +1483,15 @@ static void world_panel_texture(World *wrld)
|
||||
uiDefButS(block, ROW, B_MATPRV, "Object", 150,110,50,19, &(mtex->texco), 4.0, (float)TEXCO_OBJECT, 0, 0, "The name of the object used as a source for texture coordinates");
|
||||
uiDefIDPoinBut(block, test_obpoin_but, B_MATPRV, "", 100,90,100,19, &(mtex->object), "");
|
||||
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButF(block, NUM, B_MATPRV, "dX", 100,50,100,18, mtex->ofs, -20.0, 20.0, 10, 0, "Set the extra translation of the texture coordinate");
|
||||
uiDefButF(block, NUM, B_MATPRV, "dY", 100,30,100,18, mtex->ofs+1, -20.0, 20.0, 10, 0, "Set the extra translation of the texture coordinate");
|
||||
uiDefButF(block, NUM, B_MATPRV, "dZ", 100,10,100,18, mtex->ofs+2, -20.0, 20.0, 10, 0, "Set the extra translation of the texture coordinate");
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButF(block, NUM, B_MATPRV, "sizeX", 200,50,100,18, mtex->size, -10.0, 10.0, 10, 0, "Set the extra scaling of the texture coordinate");
|
||||
uiDefButF(block, NUM, B_MATPRV, "sizeY", 200,30,100,18, mtex->size+1, -10.0, 10.0, 10, 0, "Set the extra scaling of the texture coordinate");
|
||||
uiDefButF(block, NUM, B_MATPRV, "sizeZ", 200,10,100,18, mtex->size+2, -10.0, 10.0, 10, 0, "Set the extra scaling of the texture coordinate");
|
||||
|
||||
|
||||
uiBlockEndAlign(block);
|
||||
}
|
||||
|
||||
static void world_panel_mistaph(World *wrld)
|
||||
@@ -1494,27 +1511,30 @@ static void world_panel_mistaph(World *wrld)
|
||||
|
||||
|
||||
uiBlockSetCol(block, TH_BUT_SETTING1);
|
||||
uiDefButS(block, TOG|BIT|0,REDRAWVIEW3D,"Mist", 10,110,140,19, &wrld->mode, 0, 0, 0, 0, "Enable mist");
|
||||
uiDefButS(block, TOG|BIT|0,REDRAWVIEW3D,"Mist", 10,120,140,19, &wrld->mode, 0, 0, 0, 0, "Enable mist");
|
||||
uiBlockSetCol(block, TH_AUTO);
|
||||
|
||||
uiBlockBeginAlign(block, 'h');
|
||||
uiDefButS(block, ROW, B_DIFF, "Qua", 10, 90, 40, 19, &wrld->mistype, 1.0, 0.0, 0, 0, "Use quadratic progression");
|
||||
uiDefButS(block, ROW, B_DIFF, "Lin", 50, 90, 50, 19, &wrld->mistype, 1.0, 1.0, 0, 0, "Use linear progression");
|
||||
uiDefButS(block, ROW, B_DIFF, "Sqr", 100, 90, 50, 19, &wrld->mistype, 1.0, 2.0, 0, 0, "Use inverse quadratic progression");
|
||||
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButF(block, NUM,REDRAWVIEW3D, "Sta:",10,70,140,19, &wrld->miststa, 0.0, 1000.0, 10, 0, "Specify the starting distance of the mist");
|
||||
uiDefButF(block, NUM,REDRAWVIEW3D, "Di:",10,50,140,19, &wrld->mistdist, 0.0,1000.0, 10, 00, "Specify the depth of the mist");
|
||||
uiDefButF(block, NUM,B_DIFF,"Hi:", 10,30,140,19, &wrld->misthi,0.0,100.0, 10, 0, "Specify the factor for a less dense mist with increasing height");
|
||||
uiDefButF(block, NUMSLI, 0, "Misi", 10,10,140,19, &(wrld->misi), 0., 1.0, 0, 0, "Set the mist intensity");
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
uiBlockSetCol(block, TH_BUT_SETTING1);
|
||||
uiDefButS(block, TOG|BIT|1,B_DIFF, "Stars",160,110,140,19, &wrld->mode, 0, 0, 0, 0, "Enable stars");
|
||||
uiDefButS(block, TOG|BIT|1,B_DIFF, "Stars",160,120,140,19, &wrld->mode, 0, 0, 0, 0, "Enable stars");
|
||||
uiBlockSetCol(block, TH_AUTO);
|
||||
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButF(block, NUM,B_DIFF,"StarDist:", 160,70,140,19, &(wrld->stardist), 2.0, 1000.0, 100, 0, "Specify the average distance between two stars");
|
||||
uiDefButF(block, NUM,B_DIFF,"MinDist:", 160,50,140,19, &(wrld->starmindist), 0.0, 1000.0, 100, 0, "Specify the minimum distance to the camera");
|
||||
uiDefButF(block, NUMSLI,B_DIFF,"Size:", 160,30,140,19, &(wrld->starsize), 0.0, 10.0, 10, 0, "Specify the average screen dimension");
|
||||
uiDefButF(block, NUMSLI,B_DIFF,"Colnoise:", 160,10,140,19, &(wrld->starcolnoise), 0.0, 1.0, 100, 0, "Randomize starcolour");
|
||||
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
}
|
||||
|
||||
@@ -1538,20 +1558,26 @@ static void world_panel_world(World *wrld)
|
||||
uiSetButLock(wrld->id.lib!=0, "Can't edit library data");
|
||||
uiBlockSetCol(block, TH_AUTO);
|
||||
|
||||
uiDefButF(block, COL, B_COLHOR, "", 10,150,150,19, &wrld->horr, 0, 0, 0, 0, "");
|
||||
uiDefButF(block, NUMSLI,B_MATPRV,"HoR ", 10,130,150,19, &(wrld->horr), 0.0, 1.0, B_COLHOR,0, "The amount of red of the horizon colour");
|
||||
uiDefButF(block, NUMSLI,B_MATPRV,"HoG ", 10,110,150,19, &(wrld->horg), 0.0, 1.0, B_COLHOR,0, "The amount of green of the horizon colour");
|
||||
uiDefButF(block, NUMSLI,B_MATPRV,"HoB ", 10,90,150,19, &(wrld->horb), 0.0, 1.0, B_COLHOR,0, "The amount of blue of the horizon colour");
|
||||
uiDefButF(block, COL, B_COLHOR, "", 10,150,145,19, &wrld->horr, 0, 0, 0, 0, "");
|
||||
uiDefButF(block, COL, B_COLZEN, "", 160,150,145,19, &wrld->zenr, 0, 0, 0, 0, "");
|
||||
|
||||
uiDefButF(block, COL, B_COLZEN, "", 160,150,150,19, &wrld->zenr, 0, 0, 0, 0, "");
|
||||
uiDefButF(block, NUMSLI,B_MATPRV,"ZeR ", 160,130,150,19, &(wrld->zenr), 0.0, 1.0, B_COLZEN,0, "The amount of red of the zenith colour");
|
||||
uiDefButF(block, NUMSLI,B_MATPRV,"ZeG ", 160,110,150,19, &(wrld->zeng), 0.0, 1.0, B_COLZEN,0, "The amount of green of the zenith colour");
|
||||
uiDefButF(block, NUMSLI,B_MATPRV,"ZeB ", 160,90,150,19, &(wrld->zenb), 0.0, 1.0, B_COLZEN,0, "The amount of blue of the zenith colour");
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButF(block, NUMSLI,B_MATPRV,"HoR ", 10,130,145,19, &(wrld->horr), 0.0, 1.0, B_COLHOR,0, "The amount of red of the horizon colour");
|
||||
uiDefButF(block, NUMSLI,B_MATPRV,"HoG ", 10,110,145,19, &(wrld->horg), 0.0, 1.0, B_COLHOR,0, "The amount of green of the horizon colour");
|
||||
uiDefButF(block, NUMSLI,B_MATPRV,"HoB ", 10,90,145,19, &(wrld->horb), 0.0, 1.0, B_COLHOR,0, "The amount of blue of the horizon colour");
|
||||
|
||||
uiDefButF(block, NUMSLI,B_MATPRV,"AmbR ", 10,50,150,19, &(wrld->ambr), 0.0, 1.0 ,0,0, "The amount of red of the ambient colour");
|
||||
uiDefButF(block, NUMSLI,B_MATPRV,"AmbG ", 10,30,150,19, &(wrld->ambg), 0.0, 1.0 ,0,0, "The amount of red of the ambient colour");
|
||||
uiDefButF(block, NUMSLI,B_MATPRV,"AmbB ", 10,10,150,19, &(wrld->ambb), 0.0, 1.0 ,0,0, "The amount of red of the ambient colour");
|
||||
uiDefButF(block, NUMSLI,0, "Expos ", 160,10,155,19, &(wrld->exposure), 0.2, 5.0, 0, 0, "Set the lighting time, exposure");
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButF(block, NUMSLI,B_MATPRV,"ZeR ", 160,130,145,19, &(wrld->zenr), 0.0, 1.0, B_COLZEN,0, "The amount of red of the zenith colour");
|
||||
uiDefButF(block, NUMSLI,B_MATPRV,"ZeG ", 160,110,145,19, &(wrld->zeng), 0.0, 1.0, B_COLZEN,0, "The amount of green of the zenith colour");
|
||||
uiDefButF(block, NUMSLI,B_MATPRV,"ZeB ", 160,90,145,19, &(wrld->zenb), 0.0, 1.0, B_COLZEN,0, "The amount of blue of the zenith colour");
|
||||
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButF(block, NUMSLI,B_MATPRV,"AmbR ", 10,50,145,19, &(wrld->ambr), 0.0, 1.0 ,0,0, "The amount of red of the ambient colour");
|
||||
uiDefButF(block, NUMSLI,B_MATPRV,"AmbG ", 10,30,145,19, &(wrld->ambg), 0.0, 1.0 ,0,0, "The amount of red of the ambient colour");
|
||||
uiDefButF(block, NUMSLI,B_MATPRV,"AmbB ", 10,10,145,19, &(wrld->ambb), 0.0, 1.0 ,0,0, "The amount of red of the ambient colour");
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
uiDefButF(block, NUMSLI,0, "Expos ", 160,10,145,19, &(wrld->exposure), 0.2, 5.0, 0, 0, "Set the lighting time, exposure");
|
||||
|
||||
|
||||
}
|
||||
@@ -1573,10 +1599,11 @@ static void world_panel_preview(World *wrld)
|
||||
// label to force a boundbox for buttons not to be centered
|
||||
uiDefBut(block, LABEL, 0, " ", 20,20,10,10, 0, 0, 0, 0, 0, "");
|
||||
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButS(block, TOG|BIT|1,B_MATPRV,"Real", 200,175,80,25, &wrld->skytype, 0, 0, 0, 0, "Render background with real horizon");
|
||||
uiDefButS(block, TOG|BIT|0,B_MATPRV,"Blend",200,150,80,19, &wrld->skytype, 0, 0, 0, 0, "Render background with natural progression");
|
||||
uiDefButS(block, TOG|BIT|2,B_MATPRV,"Paper",200,125,80,19, &wrld->skytype, 0, 0, 0, 0, "Flatten blend or texture coordinates");
|
||||
|
||||
uiDefButS(block, TOG|BIT|0,B_MATPRV,"Blend",200,150,80,25, &wrld->skytype, 0, 0, 0, 0, "Render background with natural progression");
|
||||
uiDefButS(block, TOG|BIT|2,B_MATPRV,"Paper",200,125,80,25, &wrld->skytype, 0, 0, 0, 0, "Flatten blend or texture coordinates");
|
||||
uiBlockEndAlign(block);
|
||||
}
|
||||
|
||||
|
||||
@@ -1639,28 +1666,33 @@ static void lamp_panel_mapto(Object *ob, Lamp *la)
|
||||
}
|
||||
|
||||
/* TEXTURE OUTPUT */
|
||||
uiBlockBeginAlign(block, 'h');
|
||||
uiDefButS(block, TOG|BIT|1, B_MATPRV, "Stencil", 920,114,52,18, &(mtex->texflag), 0, 0, 0, 0, "Set the mapping to stencil mode");
|
||||
uiDefButS(block, TOG|BIT|2, B_MATPRV, "Neg", 974,114,38,18, &(mtex->texflag), 0, 0, 0, 0, "Apply the inverse of the texture");
|
||||
uiDefButS(block, TOG|BIT|0, B_MATPRV, "RGBtoInt", 1014,114,69,18, &(mtex->texflag), 0, 0, 0, 0, "Use an RGB texture as an intensity texture");
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
uiDefButF(block, COL, B_MTEXCOL, "", 920,100,163,12, &(mtex->r), 0, 0, 0, 0, "");
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "R ", 920,80,163,18, &(mtex->r), 0.0, 1.0, B_MTEXCOL, 0, "Set the red component of the intensity texture to blend with");
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "G ", 920,60,163,18, &(mtex->g), 0.0, 1.0, B_MTEXCOL, 0, "Set the green component of the intensity texture to blend with");
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "B ", 920,40,163,18, &(mtex->b), 0.0, 1.0, B_MTEXCOL, 0, "Set the blue component of the intensity texture to blend with");
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "DVar ", 920,10,163,18, &(mtex->def_var), 0.0, 1.0, 0, 0, "Set the value the texture blends with");
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
/* MAP TO */
|
||||
uiDefButS(block, TOG|BIT|0, B_MATPRV, "Col", 1107,166,81,18, &(mtex->mapto), 0, 0, 0, 0, "Let the texture affect the colour of the lamp");
|
||||
|
||||
uiBlockBeginAlign(block, 'h');
|
||||
uiDefButS(block, ROW, B_MATPRV, "Blend", 1087,114,48,18, &(mtex->blendtype), 9.0, (float)MTEX_BLEND, 0, 0, "Mix the values");
|
||||
uiDefButS(block, ROW, B_MATPRV, "Mul", 1136,114,44,18, &(mtex->blendtype), 9.0, (float)MTEX_MUL, 0, 0, "Multiply the values");
|
||||
uiDefButS(block, ROW, B_MATPRV, "Add", 1182,114,41,18, &(mtex->blendtype), 9.0, (float)MTEX_ADD, 0, 0, "Add the values");
|
||||
uiDefButS(block, ROW, B_MATPRV, "Sub", 1226,114,40,18, &(mtex->blendtype), 9.0, (float)MTEX_SUB, 0, 0, "Subtract the values");
|
||||
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "Col ", 1087,50,179,18, &(mtex->colfac), 0.0, 1.0, 0, 0, "Set the amount the texture affects the colour");
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "Nor ", 1087,30,179,18, &(mtex->norfac), 0.0, 1.0, 0, 0, "Set the amount the texture affects the normal");
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "Var ", 1087,10,179,18, &(mtex->varfac), 0.0, 1.0, 0, 0, "Set the amount the texture affects the value");
|
||||
|
||||
uiBlockEndAlign(block);
|
||||
}
|
||||
|
||||
|
||||
@@ -1679,6 +1711,7 @@ static void lamp_panel_texture(Object *ob, Lamp *la)
|
||||
|
||||
/* TEX CHANNELS */
|
||||
uiBlockSetCol(block, TH_BUT_NEUTRAL);
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
for(a= 0; a<6; a++) {
|
||||
mtex= la->mtex[a];
|
||||
if(mtex && mtex->tex) splitIDname(mtex->tex->id.name+2, str, &loos);
|
||||
@@ -1686,6 +1719,7 @@ static void lamp_panel_texture(Object *ob, Lamp *la)
|
||||
str[10]= 0;
|
||||
uiDefButS(block, ROW, B_REDR, str, 10, 140-20*a, 80, 20, &(la->texact), 3.0, (float)a, 0, 0, "");
|
||||
}
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
mtex= la->mtex[ la->texact ];
|
||||
if(mtex==0) {
|
||||
@@ -1720,18 +1754,22 @@ static void lamp_panel_texture(Object *ob, Lamp *la)
|
||||
|
||||
/* TEXCO */
|
||||
uiBlockSetCol(block, TH_AUTO);
|
||||
uiBlockBeginAlign(block, 'h');
|
||||
uiDefButS(block, ROW, B_MATPRV, "Glob", 100,110,60,20, &(mtex->texco), 4.0, (float)TEXCO_GLOB, 0, 0, "Generate texture coordinates from global coordinates");
|
||||
uiDefButS(block, ROW, B_MATPRV, "View", 160,110,70,20, &(mtex->texco), 4.0, (float)TEXCO_VIEW, 0, 0, "Generate texture coordinates from view coordinates");
|
||||
uiDefButS(block, ROW, B_MATPRV, "Object", 230,110,70,20, &(mtex->texco), 4.0, (float)TEXCO_OBJECT, 0, 0, "Use linked object's coordinates for texture coordinates");
|
||||
uiBlockEndAlign(block);
|
||||
uiDefIDPoinBut(block, test_obpoin_but, B_MATPRV, "", 100,90,200,20, &(mtex->object), "");
|
||||
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButF(block, NUM, B_MATPRV, "dX", 100,50,100,18, mtex->ofs, -20.0, 20.0, 10, 0, "Set the extra translation of the texture coordinate");
|
||||
uiDefButF(block, NUM, B_MATPRV, "dY", 100,30,100,18, mtex->ofs+1, -20.0, 20.0, 10, 0, "Set the extra translation of the texture coordinate");
|
||||
uiDefButF(block, NUM, B_MATPRV, "dZ", 100,10,100,18, mtex->ofs+2, -20.0, 20.0, 10, 0, "Set the extra translation of the texture coordinate");
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButF(block, NUM, B_MATPRV, "sizeX", 200,50,100,18, mtex->size, -10.0, 10.0, 10, 0, "Set the extra scaling of the texture coordinate");
|
||||
uiDefButF(block, NUM, B_MATPRV, "sizeY", 200,30,100,18, mtex->size+1, -10.0, 10.0, 10, 0, "Set the extra scaling of the texture coordinate");
|
||||
uiDefButF(block, NUM, B_MATPRV, "sizeZ", 200,10,100,18, mtex->size+2, -10.0, 10.0, 10, 0, "Set the extra scaling of the texture coordinate");
|
||||
|
||||
uiBlockEndAlign(block);
|
||||
}
|
||||
|
||||
static void lamp_panel_spot(Object *ob, Lamp *la)
|
||||
@@ -1754,15 +1792,19 @@ static void lamp_panel_spot(Object *ob, Lamp *la)
|
||||
uiDefButS(block, TOG|BIT|1, 0,"Halo", 10,50,80,19,&la->mode, 0, 0, 0, 0, "Render spotlights with a volumetric halo");
|
||||
|
||||
uiBlockSetCol(block, TH_AUTO);
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButF(block, NUMSLI,B_LAMPREDRAW,"SpotSi ", 100,180,200,19,&la->spotsize, 1.0, 180.0, 0, 0, "Set the angle of the spot beam in degrees");
|
||||
uiDefButF(block, NUMSLI,B_MATPRV,"SpotBl ", 100,160,200,19,&la->spotblend, 0.0, 1.0, 0, 0, "Set the softness of the spot edge");
|
||||
uiDefButF(block, NUMSLI,0,"HaloInt ", 100,130,200,19,&la->haint, 0.0, 5.0, 0, 0, "Set the intensity of the spot halo");
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
uiDefButF(block, NUMSLI,0,"HaloInt ", 100,135,200,19,&la->haint, 0.0, 5.0, 0, 0, "Set the intensity of the spot halo");
|
||||
|
||||
uiDefButS(block, NUM,B_SBUFF,"ShadowBufferSize:", 100,110,200,19, &la->bufsize,512,5120, 0, 0, "Set the size of the shadow buffer");
|
||||
|
||||
uiBlockBeginAlign(block, 'h');
|
||||
uiDefButF(block, NUM,REDRAWVIEW3D,"ClipSta:", 100,70,100,19, &la->clipsta, 0.1*grid,1000.0*grid, 10, 0, "Set the shadow map clip start");
|
||||
uiDefButF(block, NUM,REDRAWVIEW3D,"ClipEnd:", 200,70,100,19,&la->clipend, 1.0, 5000.0*grid, 100, 0, "Set the shadow map clip end");
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
uiDefButS(block, NUM,0,"Samples:", 100,30,100,19, &la->samp,1.0,16.0, 0, 0, "Number of shadow map samples");
|
||||
uiDefButS(block, NUM,0,"Halo step:", 200,30,100,19, &la->shadhalostep, 0.0, 12.0, 0, 0, "Volumetric halo sampling frequency");
|
||||
@@ -1795,7 +1837,7 @@ static void lamp_panel_lamp(Object *ob, Lamp *la)
|
||||
xco= std_libbuttons(block, 8, 180, 0, NULL, B_LAMPBROWSE, id, (ID *)ob, &(G.buts->menunr), B_LAMPALONE, B_LAMPLOCAL, 0, 0, 0);
|
||||
|
||||
uiBlockSetCol(block, TH_AUTO);
|
||||
uiDefButF(block, NUM,B_LAMPREDRAW,"Dist:",xco+10,180,104,20,&la->dist, 0.01, 5000.0, 100, 0, "Set the distance value");
|
||||
uiDefButF(block, NUM,B_LAMPREDRAW,"Dist:", xco+10,180,100,20,&la->dist, 0.01, 5000.0, 100, 0, "Set the distance value");
|
||||
|
||||
uiBlockSetCol(block, TH_BUT_SETTING1);
|
||||
uiDefButS(block, TOG|BIT|3, B_MATPRV,"Quad", 10,150,100,19,&la->mode, 0, 0, 0, 0, "Use inverse quadratic proportion");
|
||||
@@ -1809,14 +1851,18 @@ static void lamp_panel_lamp(Object *ob, Lamp *la)
|
||||
uiBlockSetCol(block, TH_AUTO);
|
||||
uiDefButF(block, NUMSLI,B_MATPRV,"Energy ", 120,150,180,20, &(la->energy), 0.0, 10.0, 0, 0, "Set the intensity of the light");
|
||||
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButF(block, NUMSLI,B_MATPRV,"R ", 120,120,180,20,&la->r, 0.0, 1.0, B_COLLAMP, 0, "Set the red component of the light");
|
||||
uiDefButF(block, NUMSLI,B_MATPRV,"G ", 120,100,180,20,&la->g, 0.0, 1.0, B_COLLAMP, 0, "Set the green component of the light");
|
||||
uiDefButF(block, NUMSLI,B_MATPRV,"B ", 120,80,180,20,&la->b, 0.0, 1.0, B_COLLAMP, 0, "Set the blue component of the light");
|
||||
uiDefButF(block, COL, B_COLLAMP, "", 120,55,180,24, &la->r, 0, 0, 0, 0, "");
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
uiDefButF(block, COL, B_COLLAMP, "", 120,52,180,24, &la->r, 0, 0, 0, 0, "");
|
||||
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButF(block, NUMSLI,B_MATPRV,"Quad1 ", 120,30,180,19,&la->att1, 0.0, 1.0, 0, 0, "Set the light intensity value 1 for a quad lamp");
|
||||
uiDefButF(block, NUMSLI,B_MATPRV,"Quad2 ", 120,10,180,19,&la->att2, 0.0, 1.0, 0, 0, "Set the light intensity value 2 for a quad lamp");
|
||||
|
||||
uiBlockEndAlign(block);
|
||||
}
|
||||
|
||||
|
||||
@@ -1834,12 +1880,12 @@ static void lamp_panel_preview(Object *ob, Lamp *la)
|
||||
|
||||
// label to force a boundbox for buttons not to be centered
|
||||
uiDefBut(block, LABEL, 0, " ", 20,20,10,10, 0, 0, 0, 0, 0, "");
|
||||
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButS(block, ROW,B_LAMPREDRAW,"Lamp", 200,175,80,25,&la->type,1.0,(float)LA_LOCAL, 0, 0, "Use a point light source");
|
||||
uiDefButS(block, ROW,B_LAMPREDRAW,"Spot", 200,150,80,25,&la->type,1.0,(float)LA_SPOT, 0, 0, "Restrict lamp to conical space");
|
||||
uiDefButS(block, ROW,B_LAMPREDRAW,"Sun", 200,125,80,25,&la->type,1.0,(float)LA_SUN, 0, 0, "Light shines from constant direction");
|
||||
uiDefButS(block, ROW,B_LAMPREDRAW,"Hemi", 200,100,80,25,&la->type,1.0,(float)LA_HEMI, 0, 0, "Light shines as half a sphere");
|
||||
|
||||
uiBlockEndAlign(block);
|
||||
}
|
||||
|
||||
|
||||
@@ -1932,12 +1978,15 @@ static void material_panel_map_to(Material *ma)
|
||||
}
|
||||
|
||||
/* TEXTURE OUTPUT */
|
||||
uiBlockBeginAlign(block, 'h');
|
||||
uiDefButS(block, TOG|BIT|1, B_MATPRV, "Stencil", 900,116,54,18, &(mtex->texflag), 0, 0, 0, 0, "Set the mapping to stencil mode");
|
||||
uiDefButS(block, TOG|BIT|2, B_MATPRV, "Neg", 956,116,39,18, &(mtex->texflag), 0, 0, 0, 0, "Reverse the effect of the texture");
|
||||
uiDefButS(block, TOG|BIT|0, B_MATPRV, "No RGB", 997,116,71,18, &(mtex->texflag), 0, 0, 0, 0, "Use an RGB texture as an intensity texture");
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
uiDefButF(block, COL, B_MTEXCOL, "", 900,100,168,12, &(mtex->r), 0, 0, 0, 0, "Browse datablocks");
|
||||
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
if(ma->colormodel==MA_HSV) {
|
||||
uiBlockSetCol(block, TH_BUT_SETTING1);
|
||||
uiDefButF(block, HSVSLI, B_MATPRV, "H ", 900,80,168,18, &(mtex->r), 0.0, 0.9999, B_MTEXCOL, 0, "");
|
||||
@@ -1950,31 +1999,33 @@ static void material_panel_map_to(Material *ma)
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "G ", 900,60,168,18, &(mtex->g), 0.0, 1.0, B_MTEXCOL, 0, "Set the amount of green the intensity texture blends with");
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "B ", 900,40,168,18, &(mtex->b), 0.0, 1.0, B_MTEXCOL, 0, "Set the amount of blue the intensity texture blends with");
|
||||
}
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "DVar ", 900,10,168,18, &(mtex->def_var), 0.0, 1.0, 0, 0, "Set the value the texture blends with the current value");
|
||||
|
||||
/* MAP TO */
|
||||
uiBlockBeginAlign(block, 'h');
|
||||
uiDefButS(block, TOG|BIT|0, B_MATPRV, "Col", 900,186,50,18, &(mtex->mapto), 0, 0, 0, 0, "Let the texture affect basic colour of the material");
|
||||
uiDefButS(block, TOG3|BIT|1, B_MATPRV, "Nor", 952,186,50,18, &(mtex->mapto), 0, 0, 0, 0, "Let the texture affect the rendered normal");
|
||||
uiDefButS(block, TOG|BIT|2, B_MATPRV, "Csp", 1004,186,50,18, &(mtex->mapto), 0, 0, 0, 0, "Let the texture affect the specularity colour");
|
||||
uiDefButS(block, TOG|BIT|3, B_MATPRV, "Cmir", 1056,186,50,18, &(mtex->mapto), 0, 0, 0, 0, "Let the texture affext the mirror colour");
|
||||
uiDefButS(block, TOG3|BIT|4, B_MATPRV, "Ref", 1108,186,50,18, &(mtex->mapto), 0, 0, 0, 0, "Let the texture affect the value of the materials reflectivity");
|
||||
uiBlockBeginAlign(block, 'h');
|
||||
uiDefButS(block, TOG3|BIT|5, B_MATPRV, "Spec", 900,166,50,18, &(mtex->mapto), 0, 0, 0, 0, "Let the texture affect the value of specularity");
|
||||
uiDefButS(block, TOG3|BIT|8, B_MATPRV, "Hard", 952,166,50,18, &(mtex->mapto), 0, 0, 0, 0, "Let the texture affect the hardness value");
|
||||
uiDefButS(block, TOG3|BIT|7, B_MATPRV, "Alpha", 1004,166,50,18, &(mtex->mapto), 0, 0, 0, 0, "Let the texture affect the alpha value");
|
||||
uiDefButS(block, TOG3|BIT|6, B_MATPRV, "Emit", 1056,166,50,18, &(mtex->mapto), 0, 0, 0, 0, "Let the texture affect the emit value");
|
||||
|
||||
/* uiDefButS(block, TOG|BIT|3, B_MATPRV, "Alpha Mix",1087,114,100,18, &(mtex->texflag), 0, 0, 0, 0); ,""*/
|
||||
|
||||
uiBlockBeginAlign(block, 'h');
|
||||
uiDefButS(block, ROW, B_MATPRV, "Mix", 1087,94,48,18, &(mtex->blendtype), 9.0, (float)MTEX_BLEND, 0, 0, "The texture blends the values or colour");
|
||||
uiDefButS(block, ROW, B_MATPRV, "Mul", 1136,94,44,18, &(mtex->blendtype), 9.0, (float)MTEX_MUL, 0, 0, "The texture multiplies the values or colour");
|
||||
uiDefButS(block, ROW, B_MATPRV, "Add", 1182,94,41,18, &(mtex->blendtype), 9.0, (float)MTEX_ADD, 0, 0, "The texture adds the values or colour");
|
||||
uiDefButS(block, ROW, B_MATPRV, "Sub", 1226,94,40,18, &(mtex->blendtype), 9.0, (float)MTEX_SUB, 0, 0, "The texture subtracts the values or colour");
|
||||
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "Col ", 1087,50,179,18, &(mtex->colfac), 0.0, 1.0, 0, 0, "Set the amount the texture affects colour");
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "Nor ", 1087,30,179,18, &(mtex->norfac), 0.0, 5.0, 0, 0, "Set the amount the texture affects the normal");
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "Var ", 1087,10,179,18, &(mtex->varfac), 0.0, 1.0, 0, 0, "Set the amount the texture affects a value");
|
||||
|
||||
uiBlockEndAlign(block);
|
||||
}
|
||||
|
||||
|
||||
@@ -1996,17 +2047,19 @@ static void material_panel_map_input(Material *ma)
|
||||
}
|
||||
|
||||
/* TEXCO */
|
||||
uiBlockBeginAlign(block, 'h');
|
||||
uiDefButS(block, ROW, B_MATPRV, "UV", 630,166,40,18, &(mtex->texco), 4.0, (float)TEXCO_UV, 0, 0, "Use UV coordinates for texture coordinates");
|
||||
uiDefButS(block, ROW, B_MATPRV, "Object", 670,166,75,18, &(mtex->texco), 4.0, (float)TEXCO_OBJECT, 0, 0, "Use linked object's coordinates for texture coordinates");
|
||||
uiDefIDPoinBut(block, test_obpoin_but, B_MATPRV, "",745,166,163,18, &(mtex->object), "");
|
||||
|
||||
uiBlockBeginAlign(block, 'h');
|
||||
uiDefButS(block, ROW, B_MATPRV, "Glob", 630,146,45,18, &(mtex->texco), 4.0, (float)TEXCO_GLOB, 0, 0, "Use global coordinates for the texture coordinates");
|
||||
uiDefButS(block, ROW, B_MATPRV, "Orco", 675,146,50,18, &(mtex->texco), 4.0, (float)TEXCO_ORCO, 0, 0, "Use the original coordinates of the mesh");
|
||||
uiDefButS(block, ROW, B_MATPRV, "Stick", 725,146,50,18, &(mtex->texco), 4.0, (float)TEXCO_STICKY, 0, 0, "Use mesh sticky coordaintes for the texture coordinates");
|
||||
uiDefButS(block, ROW, B_MATPRV, "Win", 775,146,45,18, &(mtex->texco), 4.0, (float)TEXCO_WINDOW, 0, 0, "Use screen coordinates as texture coordinates");
|
||||
uiDefButS(block, ROW, B_MATPRV, "Nor", 820,146,44,18, &(mtex->texco), 4.0, (float)TEXCO_NORM, 0, 0, "Use normal vector as texture coordinates");
|
||||
uiDefButS(block, ROW, B_MATPRV, "Refl", 864,146,44,18, &(mtex->texco), 4.0, (float)TEXCO_REFL, 0, 0, "Use reflection vector as texture coordinates");
|
||||
|
||||
uiBlockEndAlign(block);
|
||||
/* COORDS */
|
||||
uiDefButC(block, ROW, B_MATPRV, "Flat", 666,114,48,18, &(mtex->mapping), 5.0, (float)MTEX_FLAT, 0, 0, "Map X and Y coordinates directly");
|
||||
uiDefButC(block, ROW, B_MATPRV, "Cube", 717,114,50,18, &(mtex->mapping), 5.0, (float)MTEX_CUBE, 0, 0, "Map using the normal vector");
|
||||
@@ -2020,19 +2073,23 @@ static void material_panel_map_input(Material *ma)
|
||||
else if(a==2) strcpy(str, "Y");
|
||||
else strcpy(str, "Z");
|
||||
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButC(block, ROW, B_MATPRV, str, xco, 50, 24, 18, &(mtex->projx), 6.0, (float)a, 0, 0, "");
|
||||
uiDefButC(block, ROW, B_MATPRV, str, xco, 30, 24, 18, &(mtex->projy), 7.0, (float)a, 0, 0, "");
|
||||
uiDefButC(block, ROW, B_MATPRV, str, xco, 10, 24, 18, &(mtex->projz), 8.0, (float)a, 0, 0, "");
|
||||
uiBlockEndAlign(block);
|
||||
xco+= 26;
|
||||
}
|
||||
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButF(block, NUM, B_MATPRV, "ofsX", 778,114,130,18, mtex->ofs, -10.0, 10.0, 10, 0, "Fine tune X coordinate");
|
||||
uiDefButF(block, NUM, B_MATPRV, "ofsY", 778,94,130,18, mtex->ofs+1, -10.0, 10.0, 10, 0, "Fine tune Y coordinate");
|
||||
uiDefButF(block, NUM, B_MATPRV, "ofsZ", 778,74,130,18, mtex->ofs+2, -10.0, 10.0, 10, 0, "Fine tune Z coordinate");
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButF(block, NUM, B_MATPRV, "sizeX", 778,50,130,18, mtex->size, -100.0, 100.0, 10, 0, "Set an extra scaling for the texture coordinate");
|
||||
uiDefButF(block, NUM, B_MATPRV, "sizeY", 778,30,130,18, mtex->size+1, -100.0, 100.0, 10, 0, "Set an extra scaling for the texture coordinate");
|
||||
uiDefButF(block, NUM, B_MATPRV, "sizeZ", 778,10,130,18, mtex->size+2, -100.0, 100.0, 10, 0, "Set an extra scaling for the texture coordinate");
|
||||
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
}
|
||||
|
||||
@@ -2052,6 +2109,7 @@ static void material_panel_texture(Material *ma)
|
||||
/* TEX CHANNELS */
|
||||
uiBlockSetCol(block, TH_BUT_NEUTRAL);
|
||||
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
for(a= 0; a<8; a++) {
|
||||
mtex= ma->mtex[a];
|
||||
if(mtex && mtex->tex) splitIDname(mtex->tex->id.name+2, str, &loos);
|
||||
@@ -2059,6 +2117,7 @@ static void material_panel_texture(Material *ma)
|
||||
str[10]= 0;
|
||||
uiDefButC(block, ROW, B_MATPRV_DRAW, str, 10, 180-22*a, 70, 20, &(ma->texact), 3.0, (float)a, 0, 0, "");
|
||||
}
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
/* SEPTEX */
|
||||
uiBlockSetCol(block, TH_AUTO);
|
||||
@@ -2143,6 +2202,7 @@ static void material_panel_shading(Material *ma)
|
||||
}
|
||||
uiBlockSetCol(block, TH_BUT_SETTING1);
|
||||
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButI(block, TOG|BIT|15, B_MATPRV_DRAW, "Flare", 245,142,65,28, &(ma->mode), 0, 0, 0, 0, "Render halo as a lensflare");
|
||||
uiDefButI(block, TOG|BIT|8, B_MATPRV, "Rings", 245,123,65, 18, &(ma->mode), 0, 0, 0, 0, "Render rings over basic halo");
|
||||
uiDefButI(block, TOG|BIT|9, B_MATPRV, "Lines", 245,104,65, 18, &(ma->mode), 0, 0, 0, 0, "Render star shaped lines over the basic halo");
|
||||
@@ -2151,6 +2211,7 @@ static void material_panel_shading(Material *ma)
|
||||
uiDefButI(block, TOG|BIT|13, B_MATPRV, "HaloPuno", 245,47,65, 18, &(ma->mode), 0, 0, 0, 0, "Use the vertex normal to specify the dimension of the halo");
|
||||
uiDefButI(block, TOG|BIT|10, B_MATPRV, "X Alpha", 245,28,65, 18, &(ma->mode), 0, 0, 0, 0, "Use extreme alpha");
|
||||
uiDefButI(block, TOG|BIT|14, B_MATPRV, "Shaded", 245,9,65, 18, &(ma->mode), 0, 0, 0, 0, "Let halo receive light");
|
||||
uiBlockEndAlign(block);
|
||||
}
|
||||
else {
|
||||
char *str1= "Diffuse Shader%t|Lambert %x0|Oren-Nayar %x1|Toon %x2";
|
||||
@@ -2158,19 +2219,22 @@ static void material_panel_shading(Material *ma)
|
||||
|
||||
/* diff shader buttons */
|
||||
uiDefButS(block, MENU, B_MATPRV_DRAW, str1, 9, 155,78,19, &(ma->diff_shader), 0.0, 0.0, 0, 0, "Set a diffuse shader");
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "Ref ", 90,155,150,19, &(ma->ref), 0.0, 1.0, 0, 0, "Set the amount of reflection");
|
||||
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "Ref ", 90,155,150,19, &(ma->ref), 0.0, 1.0, 0, 0, "Set the amount of reflection");
|
||||
if(ma->diff_shader==MA_DIFF_ORENNAYAR)
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "Rough:",90,135, 150,19, &(ma->roughness), 0.0, 3.14, 0, 0, "Oren Nayar Roughness");
|
||||
else if(ma->diff_shader==MA_DIFF_TOON) {
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "Size:", 90, 135,150,19, &(ma->param[0]), 0.0, 3.14, 0, 0, "Size of diffuse toon area");
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "Smooth:",90,115,150,19, &(ma->param[1]), 0.0, 1.0, 0, 0, "Smoothness of diffuse toon area");
|
||||
}
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
/* spec shader buttons */
|
||||
uiDefButS(block, MENU, B_MATPRV_DRAW, str2, 9,95,77,19, &(ma->spec_shader), 0.0, 0.0, 0, 0, "Set a specular shader");
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "Spec ", 90,95,150,19, &(ma->spec), 0.0, 2.0, 0, 0, "Set the degree of specularity");
|
||||
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "Spec ", 90,95,150,19, &(ma->spec), 0.0, 2.0, 0, 0, "Set the degree of specularity");
|
||||
if ELEM3(ma->spec_shader, MA_SPEC_COOKTORR, MA_SPEC_PHONG, MA_SPEC_BLINN) {
|
||||
uiDefButS(block, NUMSLI, B_MATPRV, "Hard:", 90, 75, 150,19, &(ma->har), 1.0, 255, 0, 0, "Set the hardness of the specularity");
|
||||
}
|
||||
@@ -2180,6 +2244,7 @@ static void material_panel_shading(Material *ma)
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "Size:", 90, 75,150,19, &(ma->param[2]), 0.0, 1.53, 0, 0, "Size of specular toon area");
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "Smooth:",90, 55,150,19, &(ma->param[3]), 0.0, 1.0, 0, 0, "Smoothness of specular toon area");
|
||||
}
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
/* default shading variables */
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "Amb ", 9,30,117,19, &(ma->amb), 0.0, 1.0, 0, 0, "Set the amount of global ambient color");
|
||||
@@ -2188,7 +2253,7 @@ static void material_panel_shading(Material *ma)
|
||||
uiDefButF(block, NUM, 0, "Zoffs:", 133,10,110,19, &(ma->zoffs), 0.0, 10.0, 0, 0, "Give face an artificial offset");
|
||||
|
||||
uiBlockSetCol(block, TH_BUT_SETTING1);
|
||||
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButI(block, TOG|BIT|0, 0, "Traceable", 245,161,65,18, &(ma->mode), 0, 0, 0, 0, "Make material visible for shadow lamps");
|
||||
uiDefButI(block, TOG|BIT|1, 0, "Shadow", 245,142,65,18, &(ma->mode), 0, 0, 0, 0, "Enable material for shadows");
|
||||
uiDefButI(block, TOG|BIT|16, 0, "Radio", 245,123,65,18, &(ma->mode), 0, 0, 0, 0, "Enable radiosty render");
|
||||
@@ -2198,6 +2263,7 @@ static void material_panel_shading(Material *ma)
|
||||
uiDefButI(block, TOG|BIT|10, 0, "OnlyShadow", 245,47, 65,18, &(ma->mode), 0, 0, 0, 0, "Let alpha be determined on the degree of shadow");
|
||||
uiDefButI(block, TOG|BIT|14, 0, "No Mist", 245,28, 65,18, &(ma->mode), 0, 0, 0, 0, "Set the material insensitive to mist");
|
||||
uiDefButI(block, TOG|BIT|8, 0, "ZInvert", 245,9, 65,18, &(ma->mode), 0, 0, 0, 0, "Render with inverted Z Buffer");
|
||||
uiBlockEndAlign(block);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2228,6 +2294,14 @@ static void material_panel_material(Object *ob, Material *ma)
|
||||
if(ob->actcol==0) ob->actcol= 1; /* because of TOG|BIT button */
|
||||
|
||||
/* indicate which one is linking a material */
|
||||
uiBlockBeginAlign(block, 'h');
|
||||
uiSetButLock(id->lib!=0, "Can't edit library data");
|
||||
|
||||
strncpy(str, id->name, 2);
|
||||
str[2]= ':'; str[3]= 0;
|
||||
but= uiDefBut(block, TEX, B_IDNAME, str, 8,174,115,20, id->name+2, 0.0, 18.0, 0, 0, "Show the block the material is linked to");
|
||||
uiButSetFunc(but, test_idbutton_cb, id->name, NULL);
|
||||
|
||||
uiBlockSetCol(block, TH_BUT_ACTION);
|
||||
uiDefButS(block, TOG|BIT|(ob->actcol-1), B_MATFROM, "OB", 125,174,32,20, &ob->colbits, 0, 0, 0, 0, "Link material to object");
|
||||
idn= ob->data;
|
||||
@@ -2245,43 +2319,37 @@ static void material_panel_material(Object *ob, Material *ma)
|
||||
if(ob->totcol) min= 1.0; else min= 0.0;
|
||||
uiDefButC(block, NUM, B_ACTCOL, str, 191,174,114,20, &(ob->actcol), min, (float)ob->totcol, 0, 0, "Number of materials on object / Active material");
|
||||
|
||||
uiSetButLock(id->lib!=0, "Can't edit library data");
|
||||
|
||||
strncpy(str, id->name, 2);
|
||||
str[2]= ':'; str[3]= 0;
|
||||
but= uiDefBut(block, TEX, B_IDNAME, str, 8,174,115,20, id->name+2, 0.0, 18.0, 0, 0, "Show the block the material is linked to");
|
||||
uiButSetFunc(but, test_idbutton_cb, id->name, NULL);
|
||||
|
||||
if(ob->totcol==0) return;
|
||||
|
||||
ma= give_current_material(ob, ob->actcol);
|
||||
if(ma==0) return;
|
||||
|
||||
uiSetButLock(ma->id.lib!=0, "Can't edit library data");
|
||||
|
||||
|
||||
if(ma->dynamode & MA_DRAW_DYNABUTS) {
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButF(block, NUMSLI, 0, "Restitut ", 128,120,175,20, &ma->reflect, 0.0, 1.0, 0, 0, "Elasticity of collisions");
|
||||
uiDefButF(block, NUMSLI, 0, "Friction ", 128,98 ,175,20, &ma->friction, 0.0, 100.0, 0, 0, "Coulomb friction coefficient");
|
||||
uiDefButF(block, NUMSLI, 0, "Fh Force ", 128,76 ,175,20, &ma->fh, 0.0, 1.0, 0, 0, "Upward spring force within the Fh area");
|
||||
|
||||
uiBlockEndAlign(block);
|
||||
uiDefButF(block, NUM, 0, "Fh Damp ", 8,120,100,20, &ma->xyfrict, 0.0, 1.0, 10, 0, "Damping of the Fh spring force");
|
||||
uiDefButF(block, NUM, 0, "Fh Dist ", 8,98 ,100,20, &ma->fhdist, 0.0, 20.0, 10, 0, "Height of the Fh area");
|
||||
uiDefButS(block, TOG|BIT|1, 0, "Fh Norm", 8,76 ,100,20, &ma->dynamode, 0.0, 0.0, 0, 0, "Add a horizontal spring force on slopes");
|
||||
}
|
||||
else {
|
||||
if(!(ma->mode & MA_HALO)) {
|
||||
uiBlockBeginAlign(block, 'h');
|
||||
uiBlockSetCol(block, TH_BUT_SETTING1);
|
||||
uiDefButI(block, TOG|BIT|4, B_REDR, "VCol Light", 8,146,75,20, &(ma->mode), 0, 0, 0, 0, "Add vertex colours as extra light");
|
||||
uiDefButI(block, TOG|BIT|7, B_REDR, "VCol Paint", 85,146,72,20, &(ma->mode), 0, 0, 0, 0, "Replace basic colours with vertex colours");
|
||||
uiDefButI(block, TOG|BIT|11, B_REDR, "TexFace", 160,146,62,20, &(ma->mode), 0, 0, 0, 0, "UV-Editor assigned texture gives color and texture info for the faces");
|
||||
uiDefButI(block, TOG|BIT|2, B_MATPRV, "Shadeless", 223,146,80,20, &(ma->mode), 0, 0, 0, 0, "Make material insensitive to light or shadow");
|
||||
uiBlockEndAlign(block);
|
||||
}
|
||||
uiBlockSetCol(block, TH_AUTO);
|
||||
uiDefButF(block, COL, B_MATCOL, "", 8,115,72,24, &(ma->r), 0, 0, 0, 0, "");
|
||||
uiDefButF(block, COL, B_SPECCOL, "", 8,88,72,24, &(ma->specr), 0, 0, 0, 0, "");
|
||||
uiDefButF(block, COL, B_MIRCOL, "", 8,61,72,24, &(ma->mirr), 0, 0, 0, 0, "");
|
||||
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
if(ma->mode & MA_HALO) {
|
||||
uiDefButC(block, ROW, REDRAWBUTSSHADING, "Halo", 83,115,40,25, &(ma->rgbsel), 2.0, 0.0, 0, 0, "Mix the colour of the halo with the RGB sliders");
|
||||
uiDefButC(block, ROW, REDRAWBUTSSHADING, "Line", 83,88,40,25, &(ma->rgbsel), 2.0, 1.0, 0, 0, "Mix the colour of the lines with the RGB sliders");
|
||||
@@ -2300,25 +2368,28 @@ static void material_panel_material(Object *ob, Material *ma)
|
||||
if(ma->rgbsel==0 && (ma->mode & (MA_VERTEXCOLP|MA_FACETEXTURE) && !(ma->mode & MA_HALO)));
|
||||
else if(ma->colormodel==MA_HSV) {
|
||||
uiBlockSetCol(block, TH_BUT_SETTING1);
|
||||
uiDefButF(block, HSVSLI, B_MATPRV, "H ", 128,120,175,20, colpoin, 0.0, 0.9999, rgbsel, 0, "");
|
||||
uiDefButF(block, HSVSLI, B_MATPRV, "S ", 128,98,175,20, colpoin, 0.0001, 1.0, rgbsel, 0, "");
|
||||
uiDefButF(block, HSVSLI, B_MATPRV, "V ", 128,76,175,20, colpoin, 0.0001, 1.0, rgbsel, 0, "");
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButF(block, HSVSLI, B_MATPRV, "H ", 128,120,175,19, colpoin, 0.0, 0.9999, rgbsel, 0, "");
|
||||
uiDefButF(block, HSVSLI, B_MATPRV, "S ", 128,100,175,19, colpoin, 0.0001, 1.0, rgbsel, 0, "");
|
||||
uiDefButF(block, HSVSLI, B_MATPRV, "V ", 128,80,175,19, colpoin, 0.0001, 1.0, rgbsel, 0, "");
|
||||
uiBlockSetCol(block, TH_AUTO);
|
||||
}
|
||||
else {
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "R ", 128,120,175,20, colpoin, 0.0, 1.0, rgbsel, 0, "");
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "G ", 128,98,175,20, colpoin+1, 0.0, 1.0, rgbsel, 0, "");
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "B ", 128,76,175,20, colpoin+2, 0.0, 1.0, rgbsel, 0, "");
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "R ", 128,120,175,19, colpoin, 0.0, 1.0, rgbsel, 0, "");
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "G ", 128,100,175,19, colpoin+1, 0.0, 1.0, rgbsel, 0, "");
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "B ", 128,80,175,19, colpoin+2, 0.0, 1.0, rgbsel, 0, "");
|
||||
}
|
||||
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "Alpha ", 128,54,175,20, &(ma->alpha), 0.0, 1.0, 0, 0, "Set the amount of coverage, to make materials transparent");
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "SpecTra ", 128,32,175,20, &(ma->spectra), 0.0, 1.0, 0, 0, "Make specular areas opaque");
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "Alpha ", 128,52,175,19, &(ma->alpha), 0.0, 1.0, 0, 0, "Set the amount of coverage, to make materials transparent");
|
||||
uiDefButF(block, NUMSLI, B_MATPRV, "SpecTra ", 128,32,175,19, &(ma->spectra), 0.0, 1.0, 0, 0, "Make specular areas opaque");
|
||||
|
||||
}
|
||||
uiBlockBeginAlign(block, 'h');
|
||||
uiDefButS(block, ROW, REDRAWBUTSSHADING, "RGB", 8,32,35,20, &(ma->colormodel), 1.0, (float)MA_RGB, 0, 0, "Create colour by red, green and blue");
|
||||
uiDefButS(block, ROW, REDRAWBUTSSHADING, "HSV", 43,32,35,20, &(ma->colormodel), 1.0, (float)MA_HSV, 0, 0, "Mix colour with hue, saturation and value");
|
||||
uiDefButS(block, TOG|BIT|0, REDRAWBUTSSHADING, "DYN", 78,32,45,20, &(ma->dynamode), 0.0, 0.0, 0, 0, "Adjust parameters for dynamics options");
|
||||
|
||||
uiBlockEndAlign(block);
|
||||
}
|
||||
|
||||
static void material_panel_preview(Material *ma)
|
||||
|
||||
@@ -1072,6 +1072,7 @@ static void v3d_editvertex_buts(uiBlock *block, Object *ob, float lim)
|
||||
ve_median_tot= tot;
|
||||
VECCOPY(ve_median, median);
|
||||
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
if(ve_median_tot==1) {
|
||||
uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Vertex X:", 10, 140, 300, 19, &(ve_median[0]), -lim, lim, 10, 0, "");
|
||||
uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Vertex Y:", 10, 120, 300, 19, &(ve_median[1]), -lim, lim, 10, 0, "");
|
||||
@@ -1082,6 +1083,7 @@ static void v3d_editvertex_buts(uiBlock *block, Object *ob, float lim)
|
||||
uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Median Y:", 10, 120, 300, 19, &(ve_median[1]), -lim, lim, 10, 0, "");
|
||||
uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Median Z:", 10, 100, 300, 19, &(ve_median[2]), -lim, lim, 10, 0, "");
|
||||
}
|
||||
uiBlockEndAlign(block);
|
||||
}
|
||||
else { // apply
|
||||
|
||||
@@ -1159,20 +1161,21 @@ static void v3d_posearmature_buts(uiBlock *block, Object *ob, float lim)
|
||||
|
||||
if (!bone)
|
||||
return;
|
||||
|
||||
uiDefButF(block, NUM, B_ARMATUREPANEL2, "QuatX:", 10, 120, 145, 19, bone->quat, -100.0, 100.0, 10, 0, "");
|
||||
uiDefButF(block, NUM, B_ARMATUREPANEL2, "QuatY:", 160, 120, 145, 19, bone->quat+1, -100.0, 100.0, 10, 0, "");
|
||||
uiDefButF(block, NUM, B_ARMATUREPANEL2, "QuatZ:", 10, 100, 150, 19, bone->quat+2, -100.0, 100.0, 10, 0, "");
|
||||
uiDefButF(block, NUM, B_ARMATUREPANEL2, "QuatW:", 160, 100, 150, 19, bone->quat+3, -100.0, 100.0, 10, 0, "");
|
||||
|
||||
uiDefButF(block, NUM, B_ARMATUREPANEL2, "LocX:", 10, 70, 145, 19, bone->loc, -lim, lim, 100, 0, "");
|
||||
uiDefButF(block, NUM, B_ARMATUREPANEL2, "LocY:", 10, 50, 145, 19, bone->loc+1, -lim, lim, 100, 0, "");
|
||||
uiDefButF(block, NUM, B_ARMATUREPANEL2, "locZ:", 10, 30, 145, 19, bone->loc+2, -lim, lim, 100, 0, "");
|
||||
|
||||
uiDefButF(block, NUM, B_ARMATUREPANEL2, "SizeX:", 160, 70, 150, 19, bone->size, -lim, lim, 100, 0, "");
|
||||
uiDefButF(block, NUM, B_ARMATUREPANEL2, "SizeZ:", 160, 50, 150, 19, bone->size+1, -lim, lim, 100, 0, "");
|
||||
uiDefButF(block, NUM, B_ARMATUREPANEL2, "SizeZ:", 160, 30, 150, 19, bone->size+2, -lim, lim, 100, 0, "");
|
||||
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButF(block, NUM, B_ARMATUREPANEL2, "QuatX:", 10, 120, 140, 19, bone->quat, -100.0, 100.0, 10, 0, "");
|
||||
uiDefButF(block, NUM, B_ARMATUREPANEL2, "QuatZ:", 10, 100, 140, 19, bone->quat+2, -100.0, 100.0, 10, 0, "");
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButF(block, NUM, B_ARMATUREPANEL2, "QuatY:", 160, 120, 140, 19, bone->quat+1, -100.0, 100.0, 10, 0, "");
|
||||
uiDefButF(block, NUM, B_ARMATUREPANEL2, "QuatW:", 160, 100, 140, 19, bone->quat+3, -100.0, 100.0, 10, 0, "");
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButF(block, NUM, B_ARMATUREPANEL2, "LocX:", 10, 70, 140, 19, bone->loc, -lim, lim, 100, 0, "");
|
||||
uiDefButF(block, NUM, B_ARMATUREPANEL2, "LocY:", 10, 50, 140, 19, bone->loc+1, -lim, lim, 100, 0, "");
|
||||
uiDefButF(block, NUM, B_ARMATUREPANEL2, "locZ:", 10, 30, 140, 19, bone->loc+2, -lim, lim, 100, 0, "");
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButF(block, NUM, B_ARMATUREPANEL2, "SizeX:", 160, 70, 140, 19, bone->size, -lim, lim, 100, 0, "");
|
||||
uiDefButF(block, NUM, B_ARMATUREPANEL2, "SizeZ:", 160, 50, 140, 19, bone->size+1, -lim, lim, 100, 0, "");
|
||||
uiDefButF(block, NUM, B_ARMATUREPANEL2, "SizeZ:", 160, 30, 140, 19, bone->size+2, -lim, lim, 100, 0, "");
|
||||
uiBlockEndAlign(block);
|
||||
}
|
||||
|
||||
static void v3d_editarmature_buts(uiBlock *block, Object *ob, float lim)
|
||||
@@ -1188,17 +1191,17 @@ static void v3d_editarmature_buts(uiBlock *block, Object *ob, float lim)
|
||||
|
||||
if (!ebone)
|
||||
return;
|
||||
|
||||
uiDefButF(block, NUM, B_ARMATUREPANEL1, "RootX:", 10, 70, 145, 19, ebone->head, -lim, lim, 100, 0, "");
|
||||
uiDefButF(block, NUM, B_ARMATUREPANEL1, "RootY:", 10, 50, 145, 19, ebone->head+1, -lim, lim, 100, 0, "");
|
||||
uiDefButF(block, NUM, B_ARMATUREPANEL1, "RootZ:", 10, 30, 145, 19, ebone->head+2, -lim, lim, 100, 0, "");
|
||||
|
||||
uiDefButF(block, NUM, B_ARMATUREPANEL1, "TipX:", 160, 70, 150, 19, ebone->tail, -lim, lim, 100, 0, "");
|
||||
uiDefButF(block, NUM, B_ARMATUREPANEL1, "TipY:", 160, 50, 150, 19, ebone->tail+1, -lim, lim, 100, 0, "");
|
||||
uiDefButF(block, NUM, B_ARMATUREPANEL1, "TipZ:", 160, 30, 150, 19, ebone->tail+2, -lim, lim, 100, 0, "");
|
||||
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButF(block, NUM, B_ARMATUREPANEL1, "RootX:", 10, 70, 140, 19, ebone->head, -lim, lim, 100, 0, "");
|
||||
uiDefButF(block, NUM, B_ARMATUREPANEL1, "RootY:", 10, 50, 140, 19, ebone->head+1, -lim, lim, 100, 0, "");
|
||||
uiDefButF(block, NUM, B_ARMATUREPANEL1, "RootZ:", 10, 30, 140, 19, ebone->head+2, -lim, lim, 100, 0, "");
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButF(block, NUM, B_ARMATUREPANEL1, "TipX:", 160, 70, 140, 19, ebone->tail, -lim, lim, 100, 0, "");
|
||||
uiDefButF(block, NUM, B_ARMATUREPANEL1, "TipY:", 160, 50, 140, 19, ebone->tail+1, -lim, lim, 100, 0, "");
|
||||
uiDefButF(block, NUM, B_ARMATUREPANEL1, "TipZ:", 160, 30, 140, 19, ebone->tail+2, -lim, lim, 100, 0, "");
|
||||
uiBlockEndAlign(block);
|
||||
ob_eul[0]= 180.0*ebone->roll/M_PI;
|
||||
uiDefButF(block, NUM, B_ARMATUREPANEL1, "Roll:", 10, 100, 150, 19, ob_eul, -lim, lim, 100, 0, "");
|
||||
uiDefButF(block, NUM, B_ARMATUREPANEL1, "Roll:", 10, 100, 140, 19, ob_eul, -lim, lim, 100, 0, "");
|
||||
|
||||
}
|
||||
|
||||
@@ -1350,8 +1353,8 @@ static void view3d_panel_object(short cntrl) // VIEW3D_HANDLER_OBJECT
|
||||
uiSetPanelHandler(VIEW3D_HANDLER_OBJECT); // for close and esc
|
||||
if(uiNewPanel(curarea, block, "Transform Properties", "View3d", 10, 230, 318, 204)==0) return;
|
||||
|
||||
uiDefBut(block, TEX, B_IDNAME, "OB: ", 10,180,150,20, ob->id.name+2, 0.0, 18.0, 0, 0, "");
|
||||
uiDefIDPoinBut(block, test_obpoin_but, B_REDR, "Par:", 160, 180, 150, 20, &ob->parent, "Parent Object");
|
||||
uiDefBut(block, TEX, B_IDNAME, "OB: ", 10,180,140,20, ob->id.name+2, 0.0, 18.0, 0, 0, "");
|
||||
uiDefIDPoinBut(block, test_obpoin_but, B_REDR, "Par:", 160, 180, 140, 20, &ob->parent, "Parent Object");
|
||||
|
||||
lim= 1000.0*MAX2(1.0, G.vd->grid);
|
||||
|
||||
@@ -1363,21 +1366,24 @@ static void view3d_panel_object(short cntrl) // VIEW3D_HANDLER_OBJECT
|
||||
v3d_posearmature_buts(block, ob, lim);
|
||||
}
|
||||
else {
|
||||
uiDefButF(block, NUM, REDRAWVIEW3D, "LocX:", 10, 140, 150, 19, &(ob->loc[0]), -lim, lim, 100, 0, "");
|
||||
uiDefButF(block, NUM, REDRAWVIEW3D, "LocY:", 10, 120, 150, 19, &(ob->loc[1]), -lim, lim, 100, 0, "");
|
||||
uiDefButF(block, NUM, REDRAWVIEW3D, "LocZ:", 10, 100, 150, 19, &(ob->loc[2]), -lim, lim, 100, 0, "");
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButF(block, NUM, REDRAWVIEW3D, "LocX:", 10, 140, 140, 19, &(ob->loc[0]), -lim, lim, 100, 0, "");
|
||||
uiDefButF(block, NUM, REDRAWVIEW3D, "LocY:", 10, 120, 140, 19, &(ob->loc[1]), -lim, lim, 100, 0, "");
|
||||
uiDefButF(block, NUM, REDRAWVIEW3D, "LocZ:", 10, 100, 140, 19, &(ob->loc[2]), -lim, lim, 100, 0, "");
|
||||
|
||||
ob_eul[0]= 180.0*ob->rot[0]/M_PI;
|
||||
ob_eul[1]= 180.0*ob->rot[1]/M_PI;
|
||||
ob_eul[2]= 180.0*ob->rot[2]/M_PI;
|
||||
|
||||
uiDefButF(block, NUM, B_OBJECTPANELROT, "RotX:", 10, 70, 150, 19, &(ob_eul[0]), -lim, lim, 1000, 0, "");
|
||||
uiDefButF(block, NUM, B_OBJECTPANELROT, "RotY:", 10, 50, 150, 19, &(ob_eul[1]), -lim, lim, 1000, 0, "");
|
||||
uiDefButF(block, NUM, B_OBJECTPANELROT, "RotZ:", 10, 30, 150, 19, &(ob_eul[2]), -lim, lim, 1000, 0, "");
|
||||
|
||||
uiDefButF(block, NUM, REDRAWVIEW3D, "SizeX:", 160, 70, 150, 19, &(ob->size[0]), -lim, lim, 100, 0, "");
|
||||
uiDefButF(block, NUM, REDRAWVIEW3D, "SizeY:", 160, 50, 150, 19, &(ob->size[1]), -lim, lim, 100, 0, "");
|
||||
uiDefButF(block, NUM, REDRAWVIEW3D, "SizeZ:", 160, 30, 150, 19, &(ob->size[2]), -lim, lim, 100, 0, "");
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButF(block, NUM, B_OBJECTPANELROT, "RotX:", 10, 70, 140, 19, &(ob_eul[0]), -lim, lim, 1000, 0, "");
|
||||
uiDefButF(block, NUM, B_OBJECTPANELROT, "RotY:", 10, 50, 140, 19, &(ob_eul[1]), -lim, lim, 1000, 0, "");
|
||||
uiDefButF(block, NUM, B_OBJECTPANELROT, "RotZ:", 10, 30, 140, 19, &(ob_eul[2]), -lim, lim, 1000, 0, "");
|
||||
uiBlockBeginAlign(block, 'v');
|
||||
uiDefButF(block, NUM, REDRAWVIEW3D, "SizeX:", 160, 70, 140, 19, &(ob->size[0]), -lim, lim, 100, 0, "");
|
||||
uiDefButF(block, NUM, REDRAWVIEW3D, "SizeY:", 160, 50, 140, 19, &(ob->size[1]), -lim, lim, 100, 0, "");
|
||||
uiDefButF(block, NUM, REDRAWVIEW3D, "SizeZ:", 160, 30, 140, 19, &(ob->size[2]), -lim, lim, 100, 0, "");
|
||||
uiBlockEndAlign(block);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1421,8 +1427,8 @@ static void view3d_panel_background(cntrl) // VIEW3D_HANDLER_BACKGROUND
|
||||
uiDefBut(block, BUT, B_LOADBGPIC, "LOAD", 10,120,100,19, 0, 0, 0, 0, 0, "Specify the BackGroundPic");
|
||||
uiDefButF(block, NUMSLI, B_BLENDBGPIC, "Blend:", 120,120,190,19,&vd->bgpic->blend, 0.0,1.0, 0, 0, "Set the BackGroundPic transparency");
|
||||
|
||||
uiDefButF(block, NUM, B_DIFF, "Center X: ", 10,100,150,19,&vd->bgpic->xof, -20.0,20.0, 10, 2, "Set the BackGroundPic X Offset");
|
||||
uiDefButF(block, NUM, B_DIFF, "Center Y: ", 160,100,150,19,&vd->bgpic->yof, -20.0,20.0, 10, 2, "Set the BackGroundPic Y Offset");
|
||||
uiDefButF(block, NUM, B_DIFF, "Center X: ", 10,100,140,19,&vd->bgpic->xof, -20.0,20.0, 10, 2, "Set the BackGroundPic X Offset");
|
||||
uiDefButF(block, NUM, B_DIFF, "Center Y: ", 160,100,140,19,&vd->bgpic->yof, -20.0,20.0, 10, 2, "Set the BackGroundPic Y Offset");
|
||||
|
||||
/* There is a bug here ... (what bug? where? what is this? - zr) */
|
||||
/* (ton) the use of G.buts->texnr is hackish */
|
||||
@@ -1454,12 +1460,12 @@ static void view3d_panel_properties(cntrl) // VIEW3D_HANDLER_SETTINGS
|
||||
if(uiNewPanel(curarea, block, "3D Viewport properties", "View3d", 10, 10, 318, 204)==0) return;
|
||||
|
||||
|
||||
uiDefButF(block, NUM, REDRAWVIEW3D, "Grid:", 10, 50, 150, 19, &vd->grid, 0.001, 100.0, 10, 0, "Set the distance between gridlines");
|
||||
uiDefButS(block, NUM, REDRAWVIEW3D, "GridLines:", 160, 50, 150, 19, &vd->gridlines, 0.0, 100.0, 100, 0, "Set the number of gridlines");
|
||||
uiDefButF(block, NUM, REDRAWVIEW3D, "Lens:", 10, 30, 150, 19, &vd->lens, 10.0, 120.0, 100, 0, "Set the lens for the perspective view");
|
||||
uiDefButF(block, NUM, REDRAWVIEW3D, "Grid:", 10, 50, 140, 19, &vd->grid, 0.001, 100.0, 10, 0, "Set the distance between gridlines");
|
||||
uiDefButS(block, NUM, REDRAWVIEW3D, "GridLines:", 160, 50, 140, 19, &vd->gridlines, 0.0, 100.0, 100, 0, "Set the number of gridlines");
|
||||
uiDefButF(block, NUM, REDRAWVIEW3D, "Lens:", 10, 30, 140, 19, &vd->lens, 10.0, 120.0, 100, 0, "Set the lens for the perspective view");
|
||||
|
||||
uiDefButF(block, NUM, REDRAWVIEW3D, "ClipStart:", 10, 10, 150, 19, &vd->near, vd->grid/10.0, 100.0, 10, 0, "Set startvalue in perspective view mode");
|
||||
uiDefButF(block, NUM, REDRAWVIEW3D, "ClipEnd:", 160, 10, 150, 19, &vd->far, 1.0, 1000.0*vd->grid, 100, 0, "Set endvalue in perspective view mode");
|
||||
uiDefButF(block, NUM, REDRAWVIEW3D, "ClipStart:", 10, 10, 140, 19, &vd->near, vd->grid/10.0, 100.0, 10, 0, "Set startvalue in perspective view mode");
|
||||
uiDefButF(block, NUM, REDRAWVIEW3D, "ClipEnd:", 160, 10, 140, 19, &vd->far, 1.0, 1000.0*vd->grid, 100, 0, "Set endvalue in perspective view mode");
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -418,7 +418,7 @@ void buts_buttons(void)
|
||||
// uiButClearFlag(but, UI_ICON_RIGHT); // this type has both flags set, and draws icon right.. uhh
|
||||
// xco+= 90-XIC+10;
|
||||
//}
|
||||
|
||||
uiBlockBeginAlign(block, 'h');
|
||||
uiDefIconButS(block, ROW, B_REDR, ICON_GAME, xco+=XIC, 0, XIC, YIC, &(G.buts->mainb), 0.0, (float)CONTEXT_LOGIC, 0, 0, "Logic (F4) ");
|
||||
uiDefIconButS(block, ROW, B_REDR, ICON_SCRIPT, xco+=XIC, 0, XIC, YIC, &(G.buts->mainb), 0.0, (float)CONTEXT_SCRIPT, 0, 0, "Script ");
|
||||
uiDefIconButS(block, ROW, B_REDR, ICON_MATERIAL_DEHLT,xco+=XIC, 0, XIC, YIC, &(G.buts->mainb), 0.0, (float)CONTEXT_SHADING, 0, 0, "Shading (F5) ");
|
||||
@@ -433,6 +433,7 @@ void buts_buttons(void)
|
||||
uiBlockSetEmboss(block, UI_EMBOSS); // normal
|
||||
switch(G.buts->mainb) {
|
||||
case CONTEXT_SCENE:
|
||||
uiBlockBeginAlign(block, 'h');
|
||||
uiDefIconButC(block, ROW, B_REDR, ICON_SCENE, xco+=XIC, t_base, XIC, YIC, &(G.buts->tab[CONTEXT_SCENE]), 1.0, (float)TAB_SCENE_RENDER, 0, 0, "Render buttons ");
|
||||
uiDefIconButC(block, ROW, B_REDR, ICON_ANIM, xco+=XIC, t_base, XIC, YIC, &(G.buts->tab[CONTEXT_SCENE]), 1.0, (float)TAB_SCENE_ANIM, 0, 0, "Anim/playback buttons");
|
||||
uiDefIconButC(block, ROW, B_REDR, ICON_SOUND, xco+=XIC, t_base, XIC, YIC, &(G.buts->tab[CONTEXT_SCENE]), 1.0, (float)TAB_SCENE_SOUND, 0, 0, "Sound block buttons");
|
||||
@@ -442,6 +443,7 @@ void buts_buttons(void)
|
||||
|
||||
break;
|
||||
case CONTEXT_SHADING:
|
||||
uiBlockBeginAlign(block, 'h');
|
||||
uiDefIconButC(block, ROW, B_BUTSPREVIEW, ICON_LAMP, xco+=XIC, t_base, XIC, YIC, &(G.buts->tab[CONTEXT_SHADING]), 1.0, (float)TAB_SHADING_LAMP, 0, 0, "Lamp buttons");
|
||||
uiDefIconButC(block, ROW, B_BUTSPREVIEW, ICON_MATERIAL, xco+=XIC, t_base, XIC, YIC, &(G.buts->tab[CONTEXT_SHADING]), 1.0, (float)TAB_SHADING_MAT, 0, 0, "Material buttons");
|
||||
uiDefIconButC(block, ROW, B_BUTSPREVIEW, ICON_TEXTURE, xco+=XIC, t_base, XIC, YIC, &(G.buts->tab[CONTEXT_SHADING]), 1.0, (float)TAB_SHADING_TEX, 0, 0, "Texture buttons");
|
||||
@@ -460,6 +462,8 @@ void buts_buttons(void)
|
||||
break;
|
||||
}
|
||||
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
xco+=XIC;
|
||||
uiDefButS(block, NUM, B_NEWFRAME, "", (short)(xco+20),0,60,YIC, &(G.scene->r.cfra), 1.0, 18000.0, 0, 0, "Displays Current Frame of animation. Click to change.");
|
||||
xco+= 80;
|
||||
|
||||
@@ -245,6 +245,7 @@ int std_libbuttons(uiBlock *block, short xco, short yco,
|
||||
int len, idwasnul=0, idtype, oldcol, add_addbutton=0;
|
||||
char *str=NULL, str1[10];
|
||||
|
||||
uiBlockBeginAlign(block, 'h');
|
||||
oldcol= uiBlockGetCol(block);
|
||||
|
||||
if(id && pin) {
|
||||
@@ -474,6 +475,7 @@ int std_libbuttons(uiBlock *block, short xco, short yco,
|
||||
xco+=XIC;
|
||||
|
||||
uiBlockSetCol(block, oldcol);
|
||||
uiBlockEndAlign(block);
|
||||
|
||||
return xco;
|
||||
}
|
||||
|
||||
@@ -3460,6 +3460,32 @@ static int ui_auto_themecol(uiBut *but)
|
||||
}
|
||||
}
|
||||
|
||||
void uiBlockBeginAlign(uiBlock *block, char dir)
|
||||
{
|
||||
/* if other align was active, end it */
|
||||
if(block->flag & UI_BUT_ALIGN) uiBlockEndAlign(block);
|
||||
|
||||
if(dir=='h') block->flag |= UI_BUT_ALIGN_RIGHT;
|
||||
else block->flag |= UI_BUT_ALIGN_DOWN;
|
||||
|
||||
/* buttons declared after this call will get align flags updated */
|
||||
}
|
||||
|
||||
void uiBlockEndAlign(uiBlock *block)
|
||||
{
|
||||
uiBut *but;
|
||||
|
||||
/* correct last defined button */
|
||||
but= block->buttons.last;
|
||||
if(but) {
|
||||
if(block->flag & UI_BUT_ALIGN_DOWN)
|
||||
but->flag &= ~UI_BUT_ALIGN_DOWN;
|
||||
else
|
||||
but->flag &= ~UI_BUT_ALIGN_RIGHT;
|
||||
}
|
||||
block->flag &= ~UI_BUT_ALIGN; // all 4 flags
|
||||
}
|
||||
|
||||
static uiBut *ui_def_but(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip)
|
||||
{
|
||||
uiBut *but;
|
||||
@@ -3548,6 +3574,29 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, char *str, short
|
||||
but->flag |= UI_TEXT_LEFT;
|
||||
}
|
||||
|
||||
if(block->flag & UI_BUT_ALIGN) {
|
||||
but->flag |= (block->flag & UI_BUT_ALIGN);
|
||||
|
||||
/* merge edges of buttons to same location */
|
||||
if(but->flag & UI_BUT_ALIGN_LEFT) {
|
||||
uiBut *prev= but->prev;
|
||||
if(prev) {
|
||||
but->x1=prev->x2= (but->x1+prev->x2)/2.0;
|
||||
}
|
||||
}
|
||||
else if(but->flag & UI_BUT_ALIGN_TOP) {
|
||||
uiBut *prev= but->prev;
|
||||
if(prev) {
|
||||
but->y2=prev->y1= (but->y2+prev->y1)/2.0;
|
||||
}
|
||||
}
|
||||
|
||||
/* after first button, align is both sides */
|
||||
if(block->flag & UI_BUT_ALIGN_RIGHT) block->flag |= UI_BUT_ALIGN_LEFT;
|
||||
else if(block->flag & UI_BUT_ALIGN_DOWN) block->flag |= UI_BUT_ALIGN_TOP;
|
||||
|
||||
}
|
||||
|
||||
return but;
|
||||
}
|
||||
|
||||
|
||||
@@ -472,6 +472,35 @@ static void ui_default_text(int bc, float asp, float x1, float y1, float x2, flo
|
||||
/* END OUTER OUTLINE */
|
||||
}
|
||||
|
||||
|
||||
static void ui_default_num_arrows(float x1, float y1, float x2, float y2)
|
||||
{
|
||||
glEnable( GL_POLYGON_SMOOTH );
|
||||
glEnable( GL_BLEND );
|
||||
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
|
||||
|
||||
glShadeModel(GL_FLAT);
|
||||
glBegin(GL_TRIANGLES);
|
||||
|
||||
glVertex2f((short)x1+5,(short)(y2-(y2-y1)/2));
|
||||
glVertex2f((short)x1+10,(short)(y2-(y2-y1)/2)+4);
|
||||
glVertex2f((short)x1+10,(short)(y2-(y2-y1)/2)-4);
|
||||
glEnd();
|
||||
|
||||
/* right */
|
||||
glShadeModel(GL_FLAT);
|
||||
glBegin(GL_TRIANGLES);
|
||||
|
||||
glVertex2f((short)x2-5,(short)(y2-(y2-y1)/2));
|
||||
glVertex2f((short)x2-10,(short)(y2-(y2-y1)/2)-4);
|
||||
glVertex2f((short)x2-10,(short)(y2-(y2-y1)/2)+4);
|
||||
glEnd();
|
||||
|
||||
glDisable( GL_BLEND );
|
||||
glDisable( GL_POLYGON_SMOOTH );
|
||||
|
||||
}
|
||||
|
||||
static void ui_default_num(int bc, float asp, float x1, float y1, float x2, float y2, int flag)
|
||||
{
|
||||
|
||||
@@ -572,31 +601,31 @@ static void ui_default_num(int bc, float asp, float x1, float y1, float x2, floa
|
||||
else M_LGREY;
|
||||
}
|
||||
|
||||
ui_default_num_arrows(x1, y1, x2, y2);
|
||||
/* END SIDE ARROWS */
|
||||
}
|
||||
|
||||
static void ui_default_menu_arrows(float x1, float y1, float x2, float y2)
|
||||
{
|
||||
glEnable( GL_POLYGON_SMOOTH );
|
||||
glEnable( GL_BLEND );
|
||||
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
|
||||
|
||||
glShadeModel(GL_FLAT);
|
||||
glBegin(GL_TRIANGLES);
|
||||
|
||||
glVertex2f((short)x1+5,(short)(y2-(y2-y1)/2));
|
||||
glVertex2f((short)x1+10,(short)(y2-(y2-y1)/2)+4);
|
||||
glVertex2f((short)x1+10,(short)(y2-(y2-y1)/2)-4);
|
||||
glVertex2f((short)x2-4,(short)(y2-(y2-y1)/2)+1);
|
||||
glVertex2f((short)x2-12,(short)(y2-(y2-y1)/2)+1);
|
||||
glVertex2f((short)x2-8,(short)(y2-(y2-y1)/2)+4);
|
||||
glEnd();
|
||||
|
||||
/* right */
|
||||
glShadeModel(GL_FLAT);
|
||||
glBegin(GL_TRIANGLES);
|
||||
|
||||
glVertex2f((short)x2-5,(short)(y2-(y2-y1)/2));
|
||||
glVertex2f((short)x2-10,(short)(y2-(y2-y1)/2)-4);
|
||||
glVertex2f((short)x2-10,(short)(y2-(y2-y1)/2)+4);
|
||||
glVertex2f((short)x2-4,(short)(y2-(y2-y1)/2) -1);
|
||||
glVertex2f((short)x2-12,(short)(y2-(y2-y1)/2) -1);
|
||||
glVertex2f((short)x2-8,(short)(y2-(y2-y1)/2) -4);
|
||||
glEnd();
|
||||
|
||||
glDisable( GL_BLEND );
|
||||
glDisable( GL_POLYGON_SMOOTH );
|
||||
/* END SIDE ARROWS */
|
||||
|
||||
}
|
||||
|
||||
static void ui_default_menu(int bc, float asp, float x1, float y1, float x2, float y2, int flag)
|
||||
@@ -785,28 +814,32 @@ static void ui_default_menu(int bc, float asp, float x1, float y1, float x2, flo
|
||||
|
||||
/* set antialias line */
|
||||
M_DARK;
|
||||
ui_default_menu_arrows(x1, y1, x2, y2);
|
||||
/* MENU DOUBLE-ARROW */
|
||||
|
||||
}
|
||||
|
||||
static void ui_default_iconrow_arrows(float x1, float y1, float x2, float y2)
|
||||
{
|
||||
glEnable( GL_POLYGON_SMOOTH );
|
||||
glEnable( GL_BLEND );
|
||||
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
|
||||
|
||||
glShadeModel(GL_FLAT);
|
||||
glBegin(GL_TRIANGLES);
|
||||
glVertex2f((short)x2-4,(short)(y2-(y2-y1)/2)+1);
|
||||
glVertex2f((short)x2-12,(short)(y2-(y2-y1)/2)+1);
|
||||
glVertex2f((short)x2-8,(short)(y2-(y2-y1)/2)+4);
|
||||
glVertex2f((short)x2-2,(short)(y2-(y2-y1)/2)+1);
|
||||
glVertex2f((short)x2-6,(short)(y2-(y2-y1)/2)+1);
|
||||
glVertex2f((short)x2-4,(short)(y2-(y2-y1)/2)+4);
|
||||
glEnd();
|
||||
|
||||
glBegin(GL_TRIANGLES);
|
||||
glVertex2f((short)x2-4,(short)(y2-(y2-y1)/2) -1);
|
||||
glVertex2f((short)x2-12,(short)(y2-(y2-y1)/2) -1);
|
||||
glVertex2f((short)x2-8,(short)(y2-(y2-y1)/2) -4);
|
||||
glVertex2f((short)x2-2,(short)(y2-(y2-y1)/2) -1);
|
||||
glVertex2f((short)x2-6,(short)(y2-(y2-y1)/2) -1);
|
||||
glVertex2f((short)x2-4,(short)(y2-(y2-y1)/2) -4);
|
||||
glEnd();
|
||||
|
||||
glDisable( GL_BLEND );
|
||||
glDisable( GL_POLYGON_SMOOTH );
|
||||
/* MENU DOUBLE-ARROW */
|
||||
|
||||
}
|
||||
|
||||
static void ui_default_iconrow(int bc, float asp, float x1, float y1, float x2, float y2, int flag)
|
||||
@@ -993,29 +1026,10 @@ static void ui_default_iconrow(int bc, float asp, float x1, float y1, float x2,
|
||||
|
||||
/* MENU DOUBLE-ARROW */
|
||||
|
||||
/* set antialias line */
|
||||
M_DARK;
|
||||
ui_default_iconrow_arrows(x1, y1, x2, y2);
|
||||
|
||||
glEnable( GL_POLYGON_SMOOTH );
|
||||
glEnable( GL_BLEND );
|
||||
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
|
||||
|
||||
glShadeModel(GL_FLAT);
|
||||
glBegin(GL_TRIANGLES);
|
||||
glVertex2f((short)x2-2,(short)(y2-(y2-y1)/2)+1);
|
||||
glVertex2f((short)x2-6,(short)(y2-(y2-y1)/2)+1);
|
||||
glVertex2f((short)x2-4,(short)(y2-(y2-y1)/2)+4);
|
||||
glEnd();
|
||||
|
||||
glBegin(GL_TRIANGLES);
|
||||
glVertex2f((short)x2-2,(short)(y2-(y2-y1)/2) -1);
|
||||
glVertex2f((short)x2-6,(short)(y2-(y2-y1)/2) -1);
|
||||
glVertex2f((short)x2-4,(short)(y2-(y2-y1)/2) -4);
|
||||
glEnd();
|
||||
|
||||
glDisable( GL_BLEND );
|
||||
glDisable( GL_POLYGON_SMOOTH );
|
||||
/* MENU DOUBLE-ARROW */
|
||||
/* END MENU DOUBLE-ARROW */
|
||||
|
||||
}
|
||||
|
||||
@@ -1120,14 +1134,149 @@ static void ui_draw_default(int type, int colorid, float aspect, float x1, float
|
||||
|
||||
}
|
||||
|
||||
/* *************** MINIMAL THEME AND STANDARD PULLDOWN ***************** */
|
||||
|
||||
// theme can define an embosfunc and sliderfunc, text drawing is standard, no theme.
|
||||
/* *************** OLDSKOOL THEME ***************** */
|
||||
|
||||
static void ui_draw_outlineX(float x1, float y1, float x2, float y2, float asp1)
|
||||
{
|
||||
float vec[2];
|
||||
|
||||
glBegin(GL_LINE_LOOP);
|
||||
vec[0]= x1+asp1; vec[1]= y1-asp1;
|
||||
glVertex2fv(vec);
|
||||
vec[0]= x2-asp1;
|
||||
glVertex2fv(vec);
|
||||
vec[0]= x2+asp1; vec[1]= y1+asp1;
|
||||
glVertex2fv(vec);
|
||||
vec[1]= y2-asp1;
|
||||
glVertex2fv(vec);
|
||||
vec[0]= x2-asp1; vec[1]= y2+asp1;
|
||||
glVertex2fv(vec);
|
||||
vec[0]= x1+asp1;
|
||||
glVertex2fv(vec);
|
||||
vec[0]= x1-asp1; vec[1]= y2-asp1;
|
||||
glVertex2fv(vec);
|
||||
vec[1]= y1+asp1;
|
||||
glVertex2fv(vec);
|
||||
glEnd();
|
||||
|
||||
}
|
||||
|
||||
|
||||
static void ui_draw_oldskool(int type, int colorid, float asp, float x1, float y1, float x2, float y2, int flag)
|
||||
{
|
||||
/* paper */
|
||||
if(flag & UI_SELECT) {
|
||||
if(flag & UI_ACTIVE) BIF_ThemeColorShade(colorid, -40);
|
||||
else BIF_ThemeColorShade(colorid, -30);
|
||||
}
|
||||
else {
|
||||
if(flag & UI_ACTIVE) BIF_ThemeColorShade(colorid, +30);
|
||||
else BIF_ThemeColorShade(colorid, +20);
|
||||
}
|
||||
|
||||
glRectf(x1+1, y1+1, x2-1, y2-1);
|
||||
|
||||
x1+= asp;
|
||||
x2-= asp;
|
||||
y1+= asp;
|
||||
y2-= asp;
|
||||
|
||||
/* below */
|
||||
if(flag & UI_SELECT) BIF_ThemeColorShade(colorid, 0);
|
||||
else BIF_ThemeColorShade(colorid, -30);
|
||||
fdrawline(x1, y1, x2, y1);
|
||||
|
||||
/* right */
|
||||
fdrawline(x2, y1, x2, y2);
|
||||
|
||||
/* top */
|
||||
if(flag & UI_SELECT) BIF_ThemeColorShade(colorid, -30);
|
||||
else BIF_ThemeColorShade(colorid, 0);
|
||||
fdrawline(x1, y2, x2, y2);
|
||||
|
||||
/* left */
|
||||
fdrawline(x1, y1, x1, y2);
|
||||
|
||||
/* outline */
|
||||
glColor3ub(0,0,0);
|
||||
ui_draw_outlineX(x1, y1, x2, y2, asp);
|
||||
|
||||
|
||||
/* special type decorations */
|
||||
switch(type) {
|
||||
case NUM:
|
||||
if(flag & UI_SELECT) BIF_ThemeColorShade(colorid, -60);
|
||||
else BIF_ThemeColorShade(colorid, -30);
|
||||
ui_default_num_arrows(x1, y1, x2, y2);
|
||||
break;
|
||||
|
||||
case ICONROW:
|
||||
case ICONTEXTROW:
|
||||
if(flag & UI_ACTIVE) BIF_ThemeColorShade(colorid, 0);
|
||||
else BIF_ThemeColorShade(colorid, -10);
|
||||
glRectf(x2-9, y1+asp, x2-asp, y2-asp);
|
||||
|
||||
BIF_ThemeColorShade(colorid, -50);
|
||||
ui_default_iconrow_arrows(x1, y1, x2, y2);
|
||||
break;
|
||||
|
||||
case MENU:
|
||||
if(flag & UI_ACTIVE) BIF_ThemeColorShade(colorid, 0);
|
||||
else BIF_ThemeColorShade(colorid, -10);
|
||||
glRectf(x2-17, y1+asp, x2-asp, y2-asp);
|
||||
|
||||
BIF_ThemeColorShade(colorid, -50);
|
||||
ui_default_menu_arrows(x1, y1, x2, y2);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* *************** BASIC ROUNDED THEME ***************** */
|
||||
|
||||
static void round_button(float x1, float y1, float x2, float y2, float asp, int colorid)
|
||||
{
|
||||
float rad;
|
||||
|
||||
rad= (y2-y1)/2.0;
|
||||
if(rad>7.0) rad= 7.0;
|
||||
|
||||
glBegin(GL_POLYGON);
|
||||
gl_round_box(x1, y1, x2, y2, rad);
|
||||
glEnd();
|
||||
|
||||
BIF_ThemeColorShade(colorid, -70);
|
||||
|
||||
glBegin(GL_LINE_LOOP);
|
||||
gl_round_box(x1, y1, x2, y2, rad);
|
||||
glEnd();
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* button in midst of alignment row */
|
||||
static void round_button_mid(float x1, float y1, float x2, float y2, float asp, int colorid, int align)
|
||||
{
|
||||
glRectf(x1, y1, x2, y2);
|
||||
|
||||
BIF_ThemeColorShade(colorid, -70);
|
||||
// we draw full outline, its not AA, and it works better button mouse-over hilite
|
||||
|
||||
// left right
|
||||
fdrawline(x1, y1, x1, y2);
|
||||
fdrawline(x2, y1, x2, y2);
|
||||
|
||||
// top down
|
||||
fdrawline(x1, y2, x2, y2);
|
||||
fdrawline(x1, y1, x2, y1);
|
||||
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
/* super minimal button as used in logic menu */
|
||||
static void ui_draw_round(int type, int colorid, float asp, float x1, float y1, float x2, float y2, int flag)
|
||||
{
|
||||
int align= (flag & UI_BUT_ALIGN);
|
||||
|
||||
/* paper */
|
||||
if(flag & UI_SELECT) {
|
||||
@@ -1135,22 +1284,79 @@ static void ui_draw_round(int type, int colorid, float asp, float x1, float y1,
|
||||
else BIF_ThemeColorShade(colorid, -30);
|
||||
}
|
||||
else {
|
||||
if(flag & UI_ACTIVE) BIF_ThemeColorShade(colorid, +10);
|
||||
else BIF_ThemeColor(colorid);
|
||||
if(flag & UI_ACTIVE) BIF_ThemeColorShade(colorid, +30);
|
||||
else BIF_ThemeColorShade(colorid, +20);
|
||||
}
|
||||
|
||||
uiSetRoundBox(15);
|
||||
uiRoundBox(x1, y1, x2, y2, 6);
|
||||
|
||||
if(flag & UI_SELECT) {
|
||||
BIF_ThemeColor(TH_TEXT);
|
||||
uiRoundRect(x1, y1, x2, y2, 6);
|
||||
if(align) {
|
||||
if(align==UI_BUT_ALIGN_TOP) {
|
||||
uiSetRoundBox(12);
|
||||
round_button(x1, y1, x2, y2, asp, colorid);
|
||||
}
|
||||
else if(align==UI_BUT_ALIGN_DOWN) {
|
||||
uiSetRoundBox(3);
|
||||
round_button(x1, y1, x2, y2, asp, colorid);
|
||||
}
|
||||
else if(align==UI_BUT_ALIGN_LEFT) {
|
||||
uiSetRoundBox(6);
|
||||
round_button(x1, y1, x2, y2, asp, colorid);
|
||||
}
|
||||
else if(align==UI_BUT_ALIGN_RIGHT) {
|
||||
uiSetRoundBox(9);
|
||||
round_button(x1, y1, x2, y2, asp, colorid);
|
||||
}
|
||||
else {
|
||||
round_button_mid(x1, y1, x2, y2, asp, colorid, align);
|
||||
}
|
||||
}
|
||||
else {
|
||||
uiSetRoundBox(15);
|
||||
round_button(x1, y1, x2, y2, asp, colorid);
|
||||
}
|
||||
|
||||
/* special type decorations */
|
||||
switch(type) {
|
||||
case NUM:
|
||||
if(flag & UI_SELECT) BIF_ThemeColorShade(colorid, -60);
|
||||
else BIF_ThemeColorShade(colorid, -30);
|
||||
ui_default_num_arrows(x1, y1, x2, y2);
|
||||
break;
|
||||
|
||||
case ICONROW:
|
||||
case ICONTEXTROW:
|
||||
if(flag & UI_ACTIVE) BIF_ThemeColorShade(colorid, 0);
|
||||
else BIF_ThemeColorShade(colorid, -10);
|
||||
// assuming its not inside alignment...
|
||||
uiSetRoundBox(6);
|
||||
glBegin(GL_POLYGON);
|
||||
gl_round_box(x2-9, y1+asp, x2-asp, y2-asp, 7.0);
|
||||
glEnd();
|
||||
|
||||
BIF_ThemeColorShade(colorid, -60);
|
||||
ui_default_iconrow_arrows(x1, y1, x2, y2);
|
||||
break;
|
||||
|
||||
case MENU:
|
||||
if(flag & UI_ACTIVE) BIF_ThemeColorShade(colorid, 0);
|
||||
else BIF_ThemeColorShade(colorid, -10);
|
||||
// assuming its not inside alignment...
|
||||
if(x2-x1 > 24) {
|
||||
uiSetRoundBox(6);
|
||||
glBegin(GL_POLYGON);
|
||||
gl_round_box(x2-16, y1+asp, x2-asp, y2-asp, 7.0);
|
||||
glEnd();
|
||||
}
|
||||
BIF_ThemeColorShade(colorid, -60);
|
||||
ui_default_menu_arrows(x1, y1, x2, y2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
/* *************** MINIMAL THEME ***************** */
|
||||
|
||||
// theme can define an embosfunc and sliderfunc, text+icon drawing is standard, no theme.
|
||||
|
||||
|
||||
|
||||
/* super minimal button as used in logic menu */
|
||||
static void ui_draw_minimal(int type, int colorid, float asp, float x1, float y1, float x2, float y2, int flag)
|
||||
@@ -1167,20 +1373,20 @@ static void ui_draw_minimal(int type, int colorid, float asp, float x1, float y1
|
||||
else BIF_ThemeColorShade(colorid, -30);
|
||||
}
|
||||
else {
|
||||
if(flag & UI_ACTIVE) BIF_ThemeColorShade(colorid, +10);
|
||||
else BIF_ThemeColor(colorid);
|
||||
if(flag & UI_ACTIVE) BIF_ThemeColorShade(colorid, +20);
|
||||
else BIF_ThemeColorShade(colorid, +10);
|
||||
}
|
||||
|
||||
glRectf(x1, y1, x2, y2);
|
||||
|
||||
if(flag & UI_SELECT) {
|
||||
BIF_ThemeColorShade(colorid, -50);
|
||||
BIF_ThemeColorShade(colorid, -60);
|
||||
|
||||
/* top */
|
||||
fdrawline(x1, y2, x2, y2);
|
||||
/* left */
|
||||
fdrawline(x1, y1, x1, y2);
|
||||
BIF_ThemeColorShade(colorid, +50);
|
||||
BIF_ThemeColorShade(colorid, +40);
|
||||
|
||||
/* below */
|
||||
fdrawline(x1, y1, x2, y1);
|
||||
@@ -1188,19 +1394,49 @@ static void ui_draw_minimal(int type, int colorid, float asp, float x1, float y1
|
||||
fdrawline(x2, y1, x2, y2);
|
||||
}
|
||||
else {
|
||||
BIF_ThemeColorShade(colorid, +50);
|
||||
BIF_ThemeColorShade(colorid, +40);
|
||||
|
||||
/* top */
|
||||
fdrawline(x1, y2, x2, y2);
|
||||
/* left */
|
||||
fdrawline(x1, y1, x1, y2);
|
||||
|
||||
BIF_ThemeColorShade(colorid, -50);
|
||||
BIF_ThemeColorShade(colorid, -60);
|
||||
/* below */
|
||||
fdrawline(x1, y1, x2, y1);
|
||||
/* right */
|
||||
fdrawline(x2, y1, x2, y2);
|
||||
}
|
||||
|
||||
/* special type decorations */
|
||||
switch(type) {
|
||||
case NUM:
|
||||
if(flag & UI_SELECT) BIF_ThemeColorShade(colorid, -60);
|
||||
else BIF_ThemeColorShade(colorid, -30);
|
||||
ui_default_num_arrows(x1, y1, x2, y2);
|
||||
break;
|
||||
|
||||
case ICONROW:
|
||||
case ICONTEXTROW:
|
||||
if(flag & UI_ACTIVE) BIF_ThemeColorShade(colorid, 0);
|
||||
else BIF_ThemeColorShade(colorid, -10);
|
||||
glRectf(x2-9, y1+asp, x2-asp, y2-asp);
|
||||
|
||||
BIF_ThemeColorShade(colorid, -50);
|
||||
ui_default_iconrow_arrows(x1, y1, x2, y2);
|
||||
break;
|
||||
|
||||
case MENU:
|
||||
if(flag & UI_ACTIVE) BIF_ThemeColorShade(colorid, 0);
|
||||
else BIF_ThemeColorShade(colorid, -10);
|
||||
glRectf(x2-17, y1+asp, x2-asp, y2-asp);
|
||||
|
||||
BIF_ThemeColorShade(colorid, -50);
|
||||
ui_default_menu_arrows(x1, y1, x2, y2);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1419,14 +1655,6 @@ static void ui_draw_but_COL(uiBut *but)
|
||||
}
|
||||
|
||||
|
||||
/* ************** MAIN CALLBACK FUNCTION ************* */
|
||||
|
||||
/*
|
||||
void ui_set_embossfunc_old(uiBut *but, int drawtype)
|
||||
{
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
/* nothing! */
|
||||
static void ui_draw_nothing(int type, int colorid, float asp, float x1, float y1, float x2, float y2, int flag)
|
||||
@@ -1435,8 +1663,7 @@ static void ui_draw_nothing(int type, int colorid, float asp, float x1, float y1
|
||||
|
||||
|
||||
/* ************** EXTERN, called from interface.c ************* */
|
||||
|
||||
/* ************** the main drawingtype choice: ************* */
|
||||
/* ************** MAIN CALLBACK FUNCTION ************* */
|
||||
|
||||
void ui_set_embossfunc(uiBut *but, int drawtype)
|
||||
{
|
||||
@@ -1457,6 +1684,14 @@ void ui_set_embossfunc(uiBut *but, int drawtype)
|
||||
but->embossfunc= ui_draw_default;
|
||||
but->sliderfunc= ui_default_slider;
|
||||
}
|
||||
else if(theme==2) {
|
||||
but->embossfunc= ui_draw_round;
|
||||
but->sliderfunc= ui_default_slider;
|
||||
}
|
||||
else if(theme==3) {
|
||||
but->embossfunc= ui_draw_oldskool;
|
||||
but->sliderfunc= ui_default_slider; // should be oldskool.... later
|
||||
}
|
||||
else {
|
||||
but->embossfunc= ui_draw_minimal;
|
||||
}
|
||||
|
||||
@@ -1829,8 +1829,10 @@ void info_user_themebuts(uiBlock *block, short y1, short y2, short y3)
|
||||
uiDefButC(block, NUMSLI, B_UPDATE_THEME,"Vertex size ", 465,y3,200,20, col, 1.0, 10.0, 0, 0, "");
|
||||
}
|
||||
else if(th_curcol==TH_BUT_DRAWTYPE) {
|
||||
uiDefButC(block, ROW, B_UPDATE_THEME, "Minimal", 465,y3,200,20, col, 2.0, 0.0, 0, 0, "");
|
||||
uiDefButC(block, ROW, B_UPDATE_THEME, "Default", 465,y2,200,20, col, 2.0, 1.0, 0, 0, "");
|
||||
uiDefButC(block, ROW, B_UPDATE_THEME, "Minimal", 465,y3,100,20, col, 2.0, 0.0, 0, 0, "");
|
||||
uiDefButC(block, ROW, B_UPDATE_THEME, "Shaded", 565,y3,100,20, col, 2.0, 1.0, 0, 0, "");
|
||||
uiDefButC(block, ROW, B_UPDATE_THEME, "Rounded", 465,y2,100,20, col, 2.0, 2.0, 0, 0, "");
|
||||
uiDefButC(block, ROW, B_UPDATE_THEME, "OldSkool", 565,y2,100,20, col, 2.0, 3.0, 0, 0, "");
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user