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
path: root/source
diff options
context:
space:
mode:
authorKen Hughes <khughes@pacific.edu>2007-05-19 20:13:20 +0400
committerKen Hughes <khughes@pacific.edu>2007-05-19 20:13:20 +0400
commit4d47e53903d80192144ead6f39d78332cc7ef542 (patch)
tree2c21cb1c14f3ce74fa774e0bf34820285e718431 /source
parent6e9ac0fe979009806eb9dc021169902d61e58b30 (diff)
Diffstat (limited to 'source')
-rw-r--r--source/blender/python/api2_2x/meshPrimitive.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/python/api2_2x/meshPrimitive.c b/source/blender/python/api2_2x/meshPrimitive.c
index 66dedcc09d7..614a44422b6 100644
--- a/source/blender/python/api2_2x/meshPrimitive.c
+++ b/source/blender/python/api2_2x/meshPrimitive.c
@@ -114,14 +114,16 @@ static PyObject *M_MeshPrim_Plane( PyObject *self_unused, PyObject *args )
static PyObject *M_MeshPrim_Cube( PyObject *self_unused, PyObject *args )
{
- float size = 2.0;
+ float height = 2.0;
+ float dia;
- if( !PyArg_ParseTuple( args, "|f", &size ) )
+ if( !PyArg_ParseTuple( args, "|f", &height ) )
return EXPP_ReturnPyObjError( PyExc_TypeError,
"expected optional float arg" );
- size *= (float)(sqrt(2.0)/2.0);
- return make_mesh( 1, "Cube", 4, 0, 0, size, -size, 1, 1 );
+ height /= 2.0;
+ dia = height * (float)sqrt(2.0);
+ return make_mesh( 1, "Cube", 4, 32, 2, dia, -height, 1, 1 );
}
static PyObject *M_MeshPrim_Circle( PyObject *self_unused, PyObject *args )