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:
authorJoseph Eagar <joeedh@gmail.com>2009-11-01 03:06:53 +0300
committerJoseph Eagar <joeedh@gmail.com>2009-11-01 03:06:53 +0300
commit2d0d4e7de4d31bd2f8485a9b7b4311bf8e254c3d (patch)
treea6f262fc2e8e7762599e12a0c9984fab02ce2bff /source/blender/editors/mesh/editmesh_add.c
parent672c8926d7801fcc4b45e9dff75022e1ff9d240b (diff)
commit before doing some hefty shapekey change, will break compilation
Diffstat (limited to 'source/blender/editors/mesh/editmesh_add.c')
-rw-r--r--source/blender/editors/mesh/editmesh_add.c39
1 files changed, 6 insertions, 33 deletions
diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c
index e6baa6d9db8..1be2cf85ef6 100644
--- a/source/blender/editors/mesh/editmesh_add.c
+++ b/source/blender/editors/mesh/editmesh_add.c
@@ -1208,7 +1208,7 @@ static void make_prim_ext(bContext *C, int type, int tot, int seg,
int subdiv, float dia, float depth, int ext, int fill)
{
Object *obedit= CTX_data_edit_object(C);
- int newob;
+ int newob = 0;
float mat[4][4];
if(obedit==NULL || obedit->type!=OB_MESH) {
@@ -1308,49 +1308,21 @@ void MESH_OT_primitive_circle_add(wmOperatorType *ot)
RNA_def_boolean(ot->srna, "fill", 0, "Fill", "");
}
-static int add_primitive_cylinder_exec(bContext *C, wmOperator *op)
-{
- make_prim_ext(C, PRIM_CYLINDER, RNA_int_get(op->ptr, "vertices"), 0, 0,
- RNA_float_get(op->ptr,"radius"),
- RNA_float_get(op->ptr, "depth"), 1, 1);
-
- return OPERATOR_FINISHED;
-}
-
-void MESH_OT_primitive_cylinder_add(wmOperatorType *ot)
-{
- /* identifiers */
- ot->name= "Add Cylinder";
- ot->description= "Construct a cylindrical mesh (ends filled).";
- ot->idname= "MESH_OT_primitive_cylinder_add";
-
- /* api callbacks */
- ot->exec= add_primitive_cylinder_exec;
- ot->poll= ED_operator_scene_editable;
-
- /* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
-
- /* props */
- RNA_def_int(ot->srna, "vertices", 32, INT_MIN, INT_MAX, "Vertices", "", 2, 500);
- RNA_def_float(ot->srna, "radius", 1.0f, 0.0, FLT_MAX, "Radius", "", 0.001, 100.00);
- RNA_def_float(ot->srna, "depth", 1.0f, 0.0, FLT_MAX, "Depth", "", 0.001, 100.00);
-}
-
static int add_primitive_tube_exec(bContext *C, wmOperator *op)
{
make_prim_ext(C, PRIM_CYLINDER, RNA_int_get(op->ptr, "vertices"), 0, 0,
RNA_float_get(op->ptr,"radius"),
- RNA_float_get(op->ptr, "depth"), 1, 0);
+ RNA_float_get(op->ptr, "depth"), 1,
+ RNA_boolean_get(op->ptr, "cap_ends"));
- return OPERATOR_FINISHED;
+ return OPERATOR_FINISHED;
}
void MESH_OT_primitive_tube_add(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Add Tube";
- ot->description= "Construct a cylindrical mesh (ends not filled).";
+ ot->description= "Construct a tube mesh.";
ot->idname= "MESH_OT_primitive_tube_add";
/* api callbacks */
@@ -1364,6 +1336,7 @@ void MESH_OT_primitive_tube_add(wmOperatorType *ot)
RNA_def_int(ot->srna, "vertices", 32, INT_MIN, INT_MAX, "Vertices", "", 2, 500);
RNA_def_float(ot->srna, "radius", 1.0f, 0.0, FLT_MAX, "Radius", "", 0.001, 100.00);
RNA_def_float(ot->srna, "depth", 1.0f, 0.0, FLT_MAX, "Depth", "", 0.001, 100.00);
+ RNA_def_boolean(ot->srna, "cap_ends", 1, "Cap Ends", "");
}
static int add_primitive_cone_exec(bContext *C, wmOperator *op)