diff options
author | Johnny Matthews <johnny.matthews@gmail.com> | 2004-05-15 06:28:03 +0400 |
---|---|---|
committer | Johnny Matthews <johnny.matthews@gmail.com> | 2004-05-15 06:28:03 +0400 |
commit | 95c546bd9d9a644edd3dd3f5ca5fb7f6fd51f1de (patch) | |
tree | 93fcef71848757ba0eddf10402b0775f39804fc6 /source/blender | |
parent | dd2a4a0249a725779ab7aa0bbcd45e79a9b938d6 (diff) |
Adds a 'paint' floating panel to the image window to control brush settings for texture paint mode.
Also adds paint and properties to the view menu in image window.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/include/BIF_space.h | 1 | ||||
-rw-r--r-- | source/blender/src/drawimage.c | 33 | ||||
-rw-r--r-- | source/blender/src/header_image.c | 10 |
3 files changed, 43 insertions, 1 deletions
diff --git a/source/blender/include/BIF_space.h b/source/blender/include/BIF_space.h index 04cc7ad359a..8452745bbec 100644 --- a/source/blender/include/BIF_space.h +++ b/source/blender/include/BIF_space.h @@ -59,6 +59,7 @@ struct BWinEvent; /* image handler codes */ #define IMAGE_HANDLER_PROPERTIES 30 +#define IMAGE_HANDLER_PAINT 31 /* action handler codes */ #define ACTION_HANDLER_PROPERTIES 40 diff --git a/source/blender/src/drawimage.c b/source/blender/src/drawimage.c index 845e02bb8b3..ea86d44e7cc 100644 --- a/source/blender/src/drawimage.c +++ b/source/blender/src/drawimage.c @@ -66,6 +66,7 @@ #include "BDR_editobject.h" #include "BDR_drawmesh.h" + #include "BIF_gl.h" #include "BIF_space.h" #include "BIF_screen.h" @@ -75,6 +76,8 @@ #include "BIF_interface.h" #include "BIF_editsima.h" +#include "BSE_trans_types.h" + /* Modules used */ #include "mydevice.h" #include "blendef.h" @@ -762,6 +765,32 @@ static void image_panel_properties(short cntrl) // IMAGE_HANDLER_PROPERTIES image_editvertex_buts(block); } +static void image_panel_paint(short cntrl) // IMAGE_HANDLER_PROPERTIES +{ + extern VPaint Gvp; /* from vpaint - this was copied from the paint panel*/ + uiBlock *block; + + block= uiNewBlock(&curarea->uiblocks, "image_panel_paint", UI_EMBOSS, UI_HELV, curarea->win); + uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl); + uiSetPanelHandler(IMAGE_HANDLER_PAINT); // for close and esc + if(uiNewPanel(curarea, block, "Paint", "Image", 10, 230, 318, 204)==0) + return; + + /* Here we will define our stuff - this was copied from the paint panel*/ + + uiBlockBeginAlign(block); + uiDefButF(block, NUMSLI, 0, "R ", 979,160,194,19, &Gvp.r, 0.0, 1.0, B_VPCOLSLI, 0, "The amount of red used for painting"); + uiDefButF(block, NUMSLI, 0, "G ", 979,140,194,19, &Gvp.g, 0.0, 1.0, B_VPCOLSLI, 0, "The amount of green used for painting"); + uiDefButF(block, NUMSLI, 0, "B ", 979,120,194,19, &Gvp.b, 0.0, 1.0, B_VPCOLSLI, 0, "The amount of blue used for painting"); + uiBlockEndAlign(block); + + uiDefButF(block, NUMSLI, 0, "Opacity ", 979,100,194,19, &Gvp.a, 0.0, 1.0, 0, 0, "The amount of pressure on the brush"); + uiDefButF(block, NUMSLI, 0, "Size ", 979,80,194,19, &Gvp.size, 2.0, 64.0, 0, 0, "The size of the brush"); + + uiDefButF(block, COL, B_VPCOLSLI, "", 1176,100,28,80, &(Gvp.r), 0, 0, 0, 0, ""); +} + + static void image_blockhandlers(ScrArea *sa) { SpaceImage *sima= sa->spacedata.first; @@ -776,7 +805,9 @@ static void image_blockhandlers(ScrArea *sa) case IMAGE_HANDLER_PROPERTIES: image_panel_properties(sima->blockhandler[a+1]); break; - + case IMAGE_HANDLER_PAINT: + image_panel_paint(sima->blockhandler[a+1]); + break; } /* clear action value for event */ sima->blockhandler[a+1]= 0; diff --git a/source/blender/src/header_image.c b/source/blender/src/header_image.c index 033c6d4c6f6..7a45fc2d961 100644 --- a/source/blender/src/header_image.c +++ b/source/blender/src/header_image.c @@ -381,6 +381,12 @@ static void do_image_viewmenu(void *arg, int event) G.f |= G_DRAWFACES; allqueue(REDRAWIMAGE, 0); break; + case 7: /* Properties Panel */ + add_blockhandler(curarea, IMAGE_HANDLER_PROPERTIES, UI_PNL_UNSTOW); + break; + case 8: /* Paint Panel... */ + add_blockhandler(curarea, IMAGE_HANDLER_PAINT, UI_PNL_UNSTOW); + break; } allqueue(REDRAWVIEW3D, 0); } @@ -393,6 +399,10 @@ static uiBlock *image_viewmenu(void *arg_unused) block= uiNewBlock(&curarea->uiblocks, "image_viewmenu", UI_EMBOSSP, UI_HELV, curarea->headwin); uiBlockSetButmFunc(block, do_image_viewmenu, NULL); + + uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "View Properties...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, ""); + uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "View Paint Tool...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, ""); + if(G.f & G_DRAWFACES) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Draw Faces", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Draw Faces|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); |