diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index 23e66924509..3910c9dcdcd 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -698,17 +698,6 @@ static void editing_panel_mesh_type(Object *ob, Mesh *me) uiBlockBeginAlign(block); uiBlockSetCol(block, TH_AUTO); - val= me->mr ? 1.0 : 0.0; - uiDefBut(block, LABEL, 0, "Multires",10,70,70,20,0,val,0,0,0,""); - if(me->mr) { - but= uiDefBut(block,BUT,B_NOP,"Delete", 80,70,84,19,0,0,0,0,0,""); - uiButSetFunc(but,multires_delete,ob,me); - } - else { - but= uiDefBut(block,BUT,B_NOP,"Make", 80,70,84,19,0,0,0,0,0,""); - uiButSetFunc(but,multires_make,ob,me); - } - if(me->mcol) val= 1.0; else val= 0.0; uiDefBut(block, LABEL, 0, "VertCol", 10,50,70,20, 0, val, 0, 0, 0, ""); if(me->mcol==NULL) { @@ -3989,7 +3978,7 @@ static void editing_panel_links(Object *ob) void editing_panel_sculpting_tools() { uiBlock *block= uiNewBlock(&curarea->uiblocks, "editing_panel_sculpting_tools", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Sculpting Tools", "Editing", 300, 0, 318, 204)==0) return; + if(uiNewPanel(curarea, block, "Sculpt", "Editing", 300, 0, 318, 204)==0) return; sculptmode_draw_interface_tools(block,0,200); } @@ -3997,7 +3986,7 @@ void editing_panel_sculpting_tools() void editing_panel_sculpting_textures() { uiBlock *block= uiNewBlock(&curarea->uiblocks, "editing_panel_sculpting_textures", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Brush Textures", "Editing", 300, 0, 318, 204)==0) return; + if(uiNewPanel(curarea, block, "Brush", "Editing", 300, 0, 318, 204)==0) return; sculptmode_draw_interface_textures(block,0,200); } @@ -4009,12 +3998,16 @@ void sculptmode_draw_interface_tools(uiBlock *block, unsigned short cx, unsigned if(!G.scene) return; sd= &G.scene->sculptdata; - + uiBlockBeginAlign(block); uiDefBut(block,LABEL,B_NOP,"Brush",cx,cy,90,19,NULL,0,0,0,0,""); cy-= 20; + uiBlockBeginAlign(block); + uiDefButC(block, TOG, B_NOP, "PvRot", cx+206,cy,50,20, &G.vd->pivot_last, 0,0,0,0, "Rotate around the center of the last brush action"); + + uiBlockBeginAlign(block); uiDefButS(block,ROW,REDRAWBUTSEDIT,"Draw",cx,cy,67,19,&sd->brush_type,14.0,DRAW_BRUSH,0,0,"Draw lines on the model"); uiDefButS(block,ROW,REDRAWBUTSEDIT,"Smooth",cx+67,cy,67,19,&sd->brush_type,14.0,SMOOTH_BRUSH,0,0,"Interactively smooth areas of the model"); uiDefButS(block,ROW,REDRAWBUTSEDIT,"Pinch",cx+134,cy,66,19,&sd->brush_type,14.0,PINCH_BRUSH,0,0,"Interactively pinch areas of the model"); @@ -4690,56 +4683,53 @@ static void editing_panel_mesh_uvautocalculation(void) void editing_panel_mesh_multires() { uiBlock *block; - Object *ob= OBACT; - Mesh *me= get_mesh(ob); - - if(!me->mr) return; - - block= uiNewBlock(&curarea->uiblocks, "editing_panel_mesh_multires", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Multires", "Editing", 500, 0, 220, 204)==0) return; - - multires_draw_interface(block,100,0); -} - -void multires_draw_interface(uiBlock *block, unsigned short cx, unsigned short cy) -{ uiBut *but; Object *ob= OBACT; Mesh *me= get_mesh(ob); + int cx= 100, cy= 0; + + block= uiNewBlock(&curarea->uiblocks, "editing_panel_mesh_multires", UI_EMBOSS, UI_HELV, curarea->win); + if(uiNewPanel(curarea, block, "Multires", "Editing", 500, 0, 318, 204)==0) return; - uiBlockBeginAlign(block); - but= uiDefBut(block,BUT,B_NOP,"Add Level", cx,cy,200,19,0,0,0,0,0,"Add a new level of subdivision at the end of the chain"); - uiButSetFunc(but,multires_add_level,ob,me); - cy-= 20; - - if(me->mr->level_count>1) { - but= uiDefButC(block,NUM,B_NOP,"Level: ",cx,cy,200,19,&me->mr->newlvl,1.0,me->mr->level_count,0,0,""); - uiButSetFunc(but,multires_set_level,ob,me); - cy-= 20; - - but= uiDefBut(block,BUT,B_NOP,"Del Lower", cx,cy,100,19,0,0,0,0,0,"Remove all levels of subdivision below the current one"); - uiButSetFunc(but,multires_del_lower,ob,me); - but= uiDefBut(block,BUT,B_NOP,"Del Higher", cx+100,cy,100,19,0,0,0,0,0,"Remove all levels of subdivision above the current one"); - uiButSetFunc(but,multires_del_higher,ob,me); - cy-= 20; - - but= uiDefButC(block,NUM,B_NOP,"Edges: ",cx,cy,200,19,&me->mr->edgelvl,1.0,me->mr->level_count,0,0,"Set level of edges to display"); - uiButSetFunc(but,multires_edge_level_update,ob,me); - cy-= 20; + if(!me->mr) { + but= uiDefBut(block,BUT,B_NOP,"Add Multires", cx,cy,120,19,0,0,0,0,0,""); + uiButSetFunc(but,multires_make,ob,me); + } else { + but= uiDefBut(block,BUT,B_NOP,"Delete Multires", cx,cy,120,19,0,0,0,0,0,""); + uiButSetFunc(but,multires_delete,ob,me); + cy-= 24; uiBlockBeginAlign(block); - cy-= 5; - uiDefBut(block,LABEL,B_NOP,"Rendering",cx,cy,100,19,0,0,0,0,0,""); + but= uiDefBut(block,BUT,B_NOP,"Add Level", cx,cy,200,19,0,0,0,0,0,"Add a new level of subdivision at the end of the chain"); + uiButSetFunc(but,multires_add_level,ob,me); cy-= 20; - uiDefButC(block,NUM,B_NOP,"Pin: ",cx,cy,200,19,&me->mr->pinlvl,1.0,me->mr->level_count,0,0,"Set level to apply modifiers to during render"); - cy-= 20; + if(me->mr->level_count>1) { + but= uiDefButC(block,NUM,B_NOP,"Level: ",cx,cy,200,19,&me->mr->newlvl,1.0,me->mr->level_count,0,0,""); + uiButSetFunc(but,multires_set_level,ob,me); + cy-= 20; - uiDefButC(block,NUM,B_NOP,"Render: ",cx,cy,200,19,&me->mr->renderlvl,1.0,me->mr->level_count,0,0,"Set level to render"); - cy-= 20; + but= uiDefBut(block,BUT,B_NOP,"Del Lower", cx,cy,100,19,0,0,0,0,0,"Remove all levels of subdivision below the current one"); + uiButSetFunc(but,multires_del_lower,ob,me); + but= uiDefBut(block,BUT,B_NOP,"Del Higher", cx+100,cy,100,19,0,0,0,0,0,"Remove all levels of subdivision above the current one"); + uiButSetFunc(but,multires_del_higher,ob,me); + cy-= 20; - //but= uiDefBut(block,BUT,B_NOP,"Displacement Map", cx,cy,200,19,0,0,0,0,0,""); - //uiButSetFunc(but,multires_disp_map,me,0); + but= uiDefButC(block,NUM,B_NOP,"Edges: ",cx,cy,200,19,&me->mr->edgelvl,1.0,me->mr->level_count,0,0,"Set level of edges to display"); + uiButSetFunc(but,multires_edge_level_update,ob,me); + cy-= 20; + + uiBlockBeginAlign(block); + cy-= 5; + uiDefBut(block,LABEL,B_NOP,"Rendering",cx,cy,100,19,0,0,0,0,0,""); + cy-= 20; + + uiDefButC(block,NUM,B_NOP,"Pin: ",cx,cy,200,19,&me->mr->pinlvl,1.0,me->mr->level_count,0,0,"Set level to apply modifiers to during render"); + cy-= 20; + + uiDefButC(block,NUM,B_NOP,"Render: ",cx,cy,200,19,&me->mr->renderlvl,1.0,me->mr->level_count,0,0,"Set level to render"); + cy-= 20; + } } uiBlockEndAlign(block); @@ -4766,16 +4756,16 @@ void editing_panels() editing_panel_mesh_type(ob, ob->data); editing_panel_modifiers(ob); editing_panel_shapes(ob); + editing_panel_mesh_multires(); /* modes */ - if(get_mesh(ob)->mr) - editing_panel_mesh_multires(); if(G.obedit) { editing_panel_mesh_tools(ob, ob->data); editing_panel_mesh_tools1(ob, ob->data); } else if(G.f & G_SCULPTMODE) { + uiNewPanelTabbed("Multires", "Editing"); editing_panel_sculpting_tools(); - uiNewPanelTabbed("Sculpting Tools", "Editing"); + uiNewPanelTabbed("Multires", "Editing"); editing_panel_sculpting_textures(); } else { if(G.f & G_FACESELECT) { diff --git a/source/blender/src/drawview.c b/source/blender/src/drawview.c index 84a33bd225f..804e9987468 100644 --- a/source/blender/src/drawview.c +++ b/source/blender/src/drawview.c @@ -2345,32 +2345,6 @@ static void view3d_panel_object(short cntrl) // VIEW3D_HANDLER_OBJECT uiClearButLock(); } -static void view3d_panel_multires(short cntrl) // VIEW3D_HANDLER_MULTIRES -{ - uiBlock *block; - uiBut *but; - Object *ob= OBACT; - - if(!ob || ob->type!=OB_MESH) return; - - block= uiNewBlock(&curarea->uiblocks, "view3d_panel_multires", UI_EMBOSS, UI_HELV, curarea->win); - uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl); - uiSetPanelHandler(VIEW3D_HANDLER_MULTIRES); // for close and esc - - if(!uiNewPanel(curarea, block, "Multires Properties", "View3d", 10, 230, 220, 200)) return; - - if(ob->id.lib) uiSetButLock(1, "Can't edit library data"); - - if(get_mesh(ob)->mr) - multires_draw_interface(block, 5,100); - else { - but= uiDefBut(block,BUT,B_NOP,"Make Multires", 5,100,120,19,0,0,0,0,0,"Adds multires data to mesh"); - uiButSetFunc(but,multires_make,ob,get_mesh(ob)); - } - - uiClearButLock(); -} - static void view3d_panel_background(short cntrl) // VIEW3D_HANDLER_BACKGROUND { uiBlock *block; @@ -2573,11 +2547,7 @@ static void view3d_blockhandlers(ScrArea *sa) break; case VIEW3D_HANDLER_PREVIEW: view3d_panel_preview(sa, v3d->blockhandler[a+1]); - break; - case VIEW3D_HANDLER_MULTIRES: - view3d_panel_multires(v3d->blockhandler[a+1]); - break; - + break; } /* clear action value for event */ v3d->blockhandler[a+1]= 0; diff --git a/source/blender/src/header_view3d.c b/source/blender/src/header_view3d.c index d3710c9058a..a7032aefea6 100644 --- a/source/blender/src/header_view3d.c +++ b/source/blender/src/header_view3d.c @@ -2200,9 +2200,6 @@ static void do_view3d_edit_objectmenu(void *arg, int event) case 17: /* Transform snap to grid */ G.vd->flag2 ^= V3D_TRANSFORM_SNAP; break; - case 18: - add_blockhandler(curarea, VIEW3D_HANDLER_MULTIRES, 0); - break; } allqueue(REDRAWVIEW3D, 0); } @@ -2235,7 +2232,6 @@ static uiBlock *view3d_edit_objectmenu(void *arg_unused) uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Properties|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 15, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Multires Properties", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 18, ""); uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, ""); uiDefIconTextBlockBut(block, view3d_object_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, menuwidth, 19, ""); @@ -2770,9 +2766,6 @@ static void do_view3d_edit_meshmenu(void *arg, int event) if(session) b_verse_push_object(session, G.obedit); break; #endif - case 14: - add_blockhandler(curarea, VIEW3D_HANDLER_MULTIRES, 0); - break; case 17: /* Transform snap to grid */ G.vd->flag2 ^= V3D_TRANSFORM_SNAP; break; @@ -2809,7 +2802,6 @@ static uiBlock *view3d_edit_meshmenu(void *arg_unused) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Transform Snap", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, ""); uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Properties...|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Multires Properties...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, ""); uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, ""); uiDefIconTextBlockBut(block, view3d_edit_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, 120, 19, ""); uiDefIconTextBlockBut(block, view3d_edit_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, ""); @@ -4782,14 +4774,6 @@ void view3d_buttons(void) /* around */ xco+= XIC+18; - /* Show wireframe for sculptmode */ - if(!G.obedit && G.f & G_SCULPTMODE && ob) { - uiDefButBitC(block, TOG, OB_DRAWWIRE, REDRAWVIEW3D, "Wire", xco,0,30,20, &ob->dtx, 0,0,0,0, "Adds the active object's wireframe over solid drawing"); - xco+= 35; - uiDefButC(block, TOG, B_NOP, "PvRot", xco,0,40,20,&G.vd->pivot_last, 0,0,0,0, "Rotate around the center of the last brush action"); - xco+= 40; - } - uiBlockBeginAlign(block); if(retopo_mesh_paint_check()) {