forked from bartvdbraak/blender
Modified sculpt/multires UI:
* Changed multires panel's width to the default * Removed floating multires panel * Made multires panel always visible (in EditButtons) * Moved Make/Delete [multires] button into the multires panel * Moved the two sculpt panels into tabs of the multires panel * Removed two extra sculptmode buttons from view header
This commit is contained in:
parent
2e93510a6b
commit
30b9de3a65
@ -698,17 +698,6 @@ static void editing_panel_mesh_type(Object *ob, Mesh *me)
|
|||||||
uiBlockBeginAlign(block);
|
uiBlockBeginAlign(block);
|
||||||
uiBlockSetCol(block, TH_AUTO);
|
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;
|
if(me->mcol) val= 1.0; else val= 0.0;
|
||||||
uiDefBut(block, LABEL, 0, "VertCol", 10,50,70,20, 0, val, 0, 0, 0, "");
|
uiDefBut(block, LABEL, 0, "VertCol", 10,50,70,20, 0, val, 0, 0, 0, "");
|
||||||
if(me->mcol==NULL) {
|
if(me->mcol==NULL) {
|
||||||
@ -3989,7 +3978,7 @@ static void editing_panel_links(Object *ob)
|
|||||||
void editing_panel_sculpting_tools()
|
void editing_panel_sculpting_tools()
|
||||||
{
|
{
|
||||||
uiBlock *block= uiNewBlock(&curarea->uiblocks, "editing_panel_sculpting_tools", UI_EMBOSS, UI_HELV, curarea->win);
|
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);
|
sculptmode_draw_interface_tools(block,0,200);
|
||||||
}
|
}
|
||||||
@ -3997,7 +3986,7 @@ void editing_panel_sculpting_tools()
|
|||||||
void editing_panel_sculpting_textures()
|
void editing_panel_sculpting_textures()
|
||||||
{
|
{
|
||||||
uiBlock *block= uiNewBlock(&curarea->uiblocks, "editing_panel_sculpting_textures", UI_EMBOSS, UI_HELV, curarea->win);
|
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);
|
sculptmode_draw_interface_textures(block,0,200);
|
||||||
}
|
}
|
||||||
@ -4014,6 +4003,10 @@ void sculptmode_draw_interface_tools(uiBlock *block, unsigned short cx, unsigned
|
|||||||
|
|
||||||
uiDefBut(block,LABEL,B_NOP,"Brush",cx,cy,90,19,NULL,0,0,0,0,"");
|
uiDefBut(block,LABEL,B_NOP,"Brush",cx,cy,90,19,NULL,0,0,0,0,"");
|
||||||
cy-= 20;
|
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);
|
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,"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,"Smooth",cx+67,cy,67,19,&sd->brush_type,14.0,SMOOTH_BRUSH,0,0,"Interactively smooth areas of the model");
|
||||||
@ -4690,22 +4683,21 @@ static void editing_panel_mesh_uvautocalculation(void)
|
|||||||
void editing_panel_mesh_multires()
|
void editing_panel_mesh_multires()
|
||||||
{
|
{
|
||||||
uiBlock *block;
|
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;
|
uiBut *but;
|
||||||
Object *ob= OBACT;
|
Object *ob= OBACT;
|
||||||
Mesh *me= get_mesh(ob);
|
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;
|
||||||
|
|
||||||
|
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);
|
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");
|
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");
|
||||||
@ -4737,9 +4729,7 @@ void multires_draw_interface(uiBlock *block, unsigned short cx, unsigned short c
|
|||||||
|
|
||||||
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");
|
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;
|
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uiBlockEndAlign(block);
|
uiBlockEndAlign(block);
|
||||||
@ -4766,16 +4756,16 @@ void editing_panels()
|
|||||||
editing_panel_mesh_type(ob, ob->data);
|
editing_panel_mesh_type(ob, ob->data);
|
||||||
editing_panel_modifiers(ob);
|
editing_panel_modifiers(ob);
|
||||||
editing_panel_shapes(ob);
|
editing_panel_shapes(ob);
|
||||||
/* modes */
|
|
||||||
if(get_mesh(ob)->mr)
|
|
||||||
editing_panel_mesh_multires();
|
editing_panel_mesh_multires();
|
||||||
|
/* modes */
|
||||||
if(G.obedit) {
|
if(G.obedit) {
|
||||||
editing_panel_mesh_tools(ob, ob->data);
|
editing_panel_mesh_tools(ob, ob->data);
|
||||||
editing_panel_mesh_tools1(ob, ob->data);
|
editing_panel_mesh_tools1(ob, ob->data);
|
||||||
}
|
}
|
||||||
else if(G.f & G_SCULPTMODE) {
|
else if(G.f & G_SCULPTMODE) {
|
||||||
|
uiNewPanelTabbed("Multires", "Editing");
|
||||||
editing_panel_sculpting_tools();
|
editing_panel_sculpting_tools();
|
||||||
uiNewPanelTabbed("Sculpting Tools", "Editing");
|
uiNewPanelTabbed("Multires", "Editing");
|
||||||
editing_panel_sculpting_textures();
|
editing_panel_sculpting_textures();
|
||||||
} else {
|
} else {
|
||||||
if(G.f & G_FACESELECT) {
|
if(G.f & G_FACESELECT) {
|
||||||
|
@ -2345,32 +2345,6 @@ static void view3d_panel_object(short cntrl) // VIEW3D_HANDLER_OBJECT
|
|||||||
uiClearButLock();
|
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
|
static void view3d_panel_background(short cntrl) // VIEW3D_HANDLER_BACKGROUND
|
||||||
{
|
{
|
||||||
uiBlock *block;
|
uiBlock *block;
|
||||||
@ -2574,10 +2548,6 @@ static void view3d_blockhandlers(ScrArea *sa)
|
|||||||
case VIEW3D_HANDLER_PREVIEW:
|
case VIEW3D_HANDLER_PREVIEW:
|
||||||
view3d_panel_preview(sa, v3d->blockhandler[a+1]);
|
view3d_panel_preview(sa, v3d->blockhandler[a+1]);
|
||||||
break;
|
break;
|
||||||
case VIEW3D_HANDLER_MULTIRES:
|
|
||||||
view3d_panel_multires(v3d->blockhandler[a+1]);
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
/* clear action value for event */
|
/* clear action value for event */
|
||||||
v3d->blockhandler[a+1]= 0;
|
v3d->blockhandler[a+1]= 0;
|
||||||
|
@ -2200,9 +2200,6 @@ static void do_view3d_edit_objectmenu(void *arg, int event)
|
|||||||
case 17: /* Transform snap to grid */
|
case 17: /* Transform snap to grid */
|
||||||
G.vd->flag2 ^= V3D_TRANSFORM_SNAP;
|
G.vd->flag2 ^= V3D_TRANSFORM_SNAP;
|
||||||
break;
|
break;
|
||||||
case 18:
|
|
||||||
add_blockhandler(curarea, VIEW3D_HANDLER_MULTIRES, 0);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
allqueue(REDRAWVIEW3D, 0);
|
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, "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_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, "");
|
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);
|
if(session) b_verse_push_object(session, G.obedit);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case 14:
|
|
||||||
add_blockhandler(curarea, VIEW3D_HANDLER_MULTIRES, 0);
|
|
||||||
break;
|
|
||||||
case 17: /* Transform snap to grid */
|
case 17: /* Transform snap to grid */
|
||||||
G.vd->flag2 ^= V3D_TRANSFORM_SNAP;
|
G.vd->flag2 ^= V3D_TRANSFORM_SNAP;
|
||||||
break;
|
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_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, "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_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_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, "");
|
uiDefIconTextBlockBut(block, view3d_edit_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, "");
|
||||||
@ -4782,14 +4774,6 @@ void view3d_buttons(void)
|
|||||||
/* around */
|
/* around */
|
||||||
xco+= XIC+18;
|
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);
|
uiBlockBeginAlign(block);
|
||||||
|
|
||||||
if(retopo_mesh_paint_check()) {
|
if(retopo_mesh_paint_check()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user