[Bf-blender-cvs] [1768bd2] master: Fix T37617: "Add plane" was adding a 2*2 grid

Bastien Montagne noreply at git.blender.org
Mon Nov 25 21:04:48 CET 2013


Commit: 1768bd2c3313fa2aef6434950c88aaa97fcb3792
Author: Bastien Montagne
Date:   Mon Nov 25 21:01:22 2013 +0100
http://developer.blender.org/rB1768bd2c3313fa2aef6434950c88aaa97fcb3792

Fix T37617: "Add plane" was adding a 2*2 grid

Was a regression from rBaa3c06b41ca9, hope this time all things are OK again (note the X/Y subdivision values still are different than before (-1 for same result), but imho they make more sense this way).

===================================================================

M	source/blender/bmesh/operators/bmo_primitive.c
M	source/blender/editors/mesh/editmesh_add.c

===================================================================

diff --git a/source/blender/bmesh/operators/bmo_primitive.c b/source/blender/bmesh/operators/bmo_primitive.c
index 505a6b1..32d33d9 100644
--- a/source/blender/bmesh/operators/bmo_primitive.c
+++ b/source/blender/bmesh/operators/bmo_primitive.c
@@ -231,8 +231,8 @@ void bmo_create_grid_exec(BMesh *bm, BMOperator *op)
 	BMOpSlot *slot_verts_out = BMO_slot_get(op->slots_out, "verts.out");
 
 	const float dia = BMO_slot_float_get(op->slots_in, "size");
-	const unsigned int xtot = max_ii(2, BMO_slot_int_get(op->slots_in, "x_segments")) + 1;
-	const unsigned int ytot = max_ii(2, BMO_slot_int_get(op->slots_in, "y_segments")) + 1;
+	const unsigned int xtot = max_ii(1, BMO_slot_int_get(op->slots_in, "x_segments")) + 1;
+	const unsigned int ytot = max_ii(1, BMO_slot_int_get(op->slots_in, "y_segments")) + 1;
 	float xtot_inv2 = 2.0f / (xtot - 1);
 	float ytot_inv2 = 2.0f / (ytot - 1);
 
diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c
index 47b9d5e..f81eef7 100644
--- a/source/blender/editors/mesh/editmesh_add.c
+++ b/source/blender/editors/mesh/editmesh_add.c
@@ -411,8 +411,8 @@ void MESH_OT_primitive_grid_add(wmOperatorType *ot)
 	ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
 	/* props */
-	RNA_def_int(ot->srna, "x_subdivisions", 10, 3, INT_MAX, "X Subdivisions", "", 3, 1000);
-	RNA_def_int(ot->srna, "y_subdivisions", 10, 3, INT_MAX, "Y Subdivisions", "", 3, 1000);
+	RNA_def_int(ot->srna, "x_subdivisions", 10, 2, INT_MAX, "X Subdivisions", "", 2, 1000);
+	RNA_def_int(ot->srna, "y_subdivisions", 10, 2, INT_MAX, "Y Subdivisions", "", 2, 1000);
 	ED_object_add_unit_props(ot);
 
 	ED_object_add_generic_props(ot, true);




More information about the Bf-blender-cvs mailing list