Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Ebb <matt@mke3.net>2010-04-05 08:58:17 +0400
committerMatt Ebb <matt@mke3.net>2010-04-05 08:58:17 +0400
commitf8c2df7ce781a068b21dd7661b5dd93aa84d7658 (patch)
treef6c2468ced96ab60daaef5c9a89c8e9d5955d758 /source/blender/editors/mesh/editmesh_tools.c
parent76e483edef060de768a55dc3ded93458deb23240 (diff)
Fix [#21912] knife and subdivide tools do not split edges properly
Added back the 'corner cut pattern' as an operator property for subdivide operator. Not added for knife yet, since operator redo doesn't seem to be working at all - already logged in the tracker.
Diffstat (limited to 'source/blender/editors/mesh/editmesh_tools.c')
-rw-r--r--source/blender/editors/mesh/editmesh_tools.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index d5678590d53..35fc5c1e3bc 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -90,6 +90,15 @@ static void waitcursor(int val) {}
/* XXX */
+/* RNA corner cut enum property - used in multiple files for tools
+ * that need this property for esubdivideflag() */
+EnumPropertyItem corner_type_items[] = {
+ {SUBDIV_CORNER_PATH, "PATH", 0, "Path", ""},
+ {SUBDIV_CORNER_INNERVERT, "INNER_VERTEX", 0, "Inner Vertex", ""},
+ {SUBDIV_CORNER_FAN, "FAN", 0, "Fan", ""},
+ {0, NULL, 0, NULL, NULL}};
+
+
/* local prototypes ---------------*/
static void free_tagged_edges_faces(EditMesh *em, EditEdge *eed, EditFace *efa);
int EdgeLoopDelete(EditMesh *em, wmOperator *op);
@@ -2586,7 +2595,7 @@ static EditVert *subdivideedgenum(EditMesh *em, EditEdge *edge, int curpoint, in
return ev;
}
-void esubdivideflag(Object *obedit, EditMesh *em, int flag, float smooth, float fractal, int beauty, int numcuts, int seltype)
+void esubdivideflag(Object *obedit, EditMesh *em, int flag, float smooth, float fractal, int beauty, int numcuts, int corner_pattern, int seltype)
{
EditFace *ef;
EditEdge *eed, *cedge, *sort[4];
@@ -2830,7 +2839,7 @@ void esubdivideflag(Object *obedit, EditMesh *em, int flag, float smooth, float
(ef->e2->f & flag && ef->e4->f & flag)) {
fill_quad_double_op(em, ef, gh, numcuts);
}else{
- switch(0) { // XXX scene->toolsettings->cornertype) {
+ switch(corner_pattern) {
case 0: fill_quad_double_adj_path(em, ef, gh, numcuts); break;
case 1: fill_quad_double_adj_inner(em, ef, gh, numcuts); break;
case 2: fill_quad_double_adj_fan(em, ef, gh, numcuts); break;
@@ -6727,6 +6736,7 @@ static int subdivide_exec(bContext *C, wmOperator *op)
int cuts= RNA_int_get(op->ptr,"number_cuts");
float smooth= 0.292f*RNA_float_get(op->ptr, "smoothness");
float fractal= RNA_float_get(op->ptr, "fractal")/100;
+ int corner_cut_pattern= RNA_enum_get(op->ptr,"corner_cut_pattern");
int flag= 0;
if(smooth != 0.0f)
@@ -6734,7 +6744,7 @@ static int subdivide_exec(bContext *C, wmOperator *op)
if(fractal != 0.0f)
flag |= B_FRACTAL;
- esubdivideflag(obedit, em, 1, smooth, fractal, ts->editbutflag|flag, cuts, 0);
+ esubdivideflag(obedit, em, 1, smooth, fractal, ts->editbutflag|flag, cuts, corner_cut_pattern, 0);
DAG_id_flush_update(obedit->data, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data);
@@ -6743,7 +6753,7 @@ static int subdivide_exec(bContext *C, wmOperator *op)
}
void MESH_OT_subdivide(wmOperatorType *ot)
-{
+{
/* identifiers */
ot->name= "Subdivide";
ot->description= "Subdivide selected edges";
@@ -6760,6 +6770,7 @@ void MESH_OT_subdivide(wmOperatorType *ot)
RNA_def_int(ot->srna, "number_cuts", 1, 1, INT_MAX, "Number of Cuts", "", 1, 10);
RNA_def_float(ot->srna, "smoothness", 0.0f, 0.0f, FLT_MAX, "Smoothness", "Smoothness factor.", 0.0f, 1000.0f);
RNA_def_float(ot->srna, "fractal", 0.0, 0.0f, FLT_MAX, "Fractal", "Fractal randomness factor.", 0.0f, 1000.0f);
+ RNA_def_enum(ot->srna, "corner_cut_pattern", corner_type_items, SUBDIV_CORNER_INNERVERT, "Corner Cut Pattern", "Topology pattern to use to fill a face after cutting across its corner");
}
/********************** Fill Operators *************************/