diff --git a/source/blender/include/blendef.h b/source/blender/include/blendef.h index 61e0bae1668..e4999da8edd 100644 --- a/source/blender/include/blendef.h +++ b/source/blender/include/blendef.h @@ -377,6 +377,7 @@ #define B_BEAUTY 4 #define B_SMOOTH 8 #define B_BEAUTY_SHORT 16 +#define B_AUTOFGON 32 #define B_KNIFE 0x80 #define B_PERCENTSUBD 0x40 diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index 45cf8b814d2..b25a5a248fa 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -2612,8 +2612,9 @@ static void editing_panel_mesh_tools(Object *ob, Mesh *me) if(uiNewPanel(curarea, block, "Mesh Tools", "Editing", 640, 0, 318, 204)==0) return; uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, B_BEAUTY, 0, "Beauty", 10,195,40,19, &G.scene->toolsettings->editbutflag, 0, 0, 0, 0, "Causes 'Subdivide' to split faces in halves instead of quarters using Long Edges Unless short is selected"); - uiDefButBitS(block, TOG, B_BEAUTY_SHORT, 0, "Short", 50,195,40,19, &G.scene->toolsettings->editbutflag, 0, 0, 0, 0, "Causes 'Subdivide' to split faces in halves instead of quarters using Short Edges"); + uiDefButBitS(block, TOG, B_AUTOFGON, 0, "FGon", 10,195,30,19, &G.scene->toolsettings->editbutflag, 0, 0, 0, 0, "Causes 'Subdivide' To create FGon on inner edges where possible"); + uiDefButBitS(block, TOG, B_BEAUTY, 0, "Bty", 30,195,30,19, &G.scene->toolsettings->editbutflag, 0, 0, 0, 0, "Causes 'Subdivide' to split faces in halves instead of quarters using Long Edges Unless short is selected"); + uiDefButBitS(block, TOG, B_BEAUTY_SHORT, 0, "Shrt", 60,195,30,19, &G.scene->toolsettings->editbutflag, 0, 0, 0, 0, "Causes 'Subdivide' to split faces in halves instead of quarters using Short Edges"); uiDefBut(block, BUT,B_SUBDIV,"Subdivide", 90,195,80,19, 0, 0, 0, 0, 0, "Splits selected faces into halves or quarters"); diff --git a/source/blender/src/editmesh_tools.c b/source/blender/src/editmesh_tools.c index 7e7d3b8624b..069afa27ec9 100644 --- a/source/blender/src/editmesh_tools.c +++ b/source/blender/src/editmesh_tools.c @@ -1440,7 +1440,7 @@ static void fill_quad_single(EditFace *efa, struct GHash *gh, int numcuts, int s hold->e3->f2 |= EDGEINNER; } } - } + } } static void fill_tri_single(EditFace *efa, struct GHash *gh, int numcuts, int seltype) @@ -1634,13 +1634,18 @@ static void fill_quad_double_adj_path(EditFace *efa, struct GHash *gh, int numcu hold = addfacelist(verts[0][0],verts[1][vertsize-1],v[(start2+2)%4],NULL,NULL,NULL); hold->e1->f2 |= EDGEINNER; facecopy(efa,hold); + if(G.scene->toolsettings->editbutflag & B_AUTOFGON){ + hold->e1->h |= EM_FGON; + } // Make side faces for(i=0;ie2->f2 |= EDGEINNER; facecopy(efa,hold); - } + } + EM_fgon_flags(); + } static void fill_quad_double_adj_fan(EditFace *efa, struct GHash *gh, int numcuts) { @@ -1783,6 +1788,10 @@ static void fill_quad_double_adj_inner(EditFace *efa, struct GHash *gh, int numc hold = addfacelist(op,inner[numcuts-1],verts[1][numcuts],verts[1][numcuts+1],NULL,NULL); hold->e2->f2 |= EDGEINNER; facecopy(efa,hold); + + if(G.scene->toolsettings->editbutflag & B_AUTOFGON){ + hold->e1->h |= EM_FGON; + } // Add Fill Quads (if # cuts > 1) for(i=0;ie2->f2 |= EDGEINNER; hold->e4->f2 |= EDGEINNER; - facecopy(efa,hold); + facecopy(efa,hold); + + if(G.scene->toolsettings->editbutflag & B_AUTOFGON){ + hold->e1->h |= EM_FGON; + } } - + + EM_fgon_flags(); MEM_freeN(inner); } @@ -2001,12 +2015,18 @@ static void fill_quad_triple(EditFace *efa, struct GHash *gh, int numcuts) // Also Make inner quad hold = addfacelist(verts[1][numcuts/2],verts[1][(numcuts/2)+1],verts[2][numcuts/2],verts[0][(numcuts/2)+1],NULL,NULL); hold->e3->f2 |= EDGEINNER; + if(G.scene->toolsettings->editbutflag & B_AUTOFGON){ + hold->e3->h |= EM_FGON; + } facecopy(efa,hold); repeats = (numcuts / 2) -1; } else { // Make inner tri hold = addfacelist(verts[1][(numcuts/2)+1],verts[2][(numcuts/2)+1],verts[0][(numcuts/2)+1],NULL,NULL,NULL); hold->e2->f2 |= EDGEINNER; + if(G.scene->toolsettings->editbutflag & B_AUTOFGON){ + hold->e2->h |= EM_FGON; + } facecopy(efa,hold); repeats = ((numcuts+1) / 2)-1; } @@ -2032,6 +2052,7 @@ static void fill_quad_triple(EditFace *efa, struct GHash *gh, int numcuts) hold->e2->f2 |= EDGEINNER; facecopy(efa,hold); } + EM_fgon_flags(); } static void fill_quad_quadruple(EditFace *efa, struct GHash *gh, int numcuts,float rad,int beauty)