diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-04-11 18:22:27 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-04-11 18:22:27 +0400 |
commit | 67cfc427eefdefc003ba53db9ca7cf6f4633c252 (patch) | |
tree | 43c56a3f29f58ed97f7064b0619bb7d53cee8674 /source/blender/python/generic/mathutils_vector.c | |
parent | 4d2bc9f907d312ef86ad340abdee5ea1dadff94b (diff) |
PyAPI
- added new mathutils.Color() type, use with rna so we can do for eg:
material.diffuse_color.r = 1.0
# also has hsv access
material.diffuse_color.s = 0.6
- made Mathutils and Geometry module names lowercase.
Diffstat (limited to 'source/blender/python/generic/mathutils_vector.c')
-rw-r--r-- | source/blender/python/generic/mathutils_vector.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/source/blender/python/generic/mathutils_vector.c b/source/blender/python/generic/mathutils_vector.c index e4364865d25..e013a358393 100644 --- a/source/blender/python/generic/mathutils_vector.c +++ b/source/blender/python/generic/mathutils_vector.c @@ -41,7 +41,7 @@ static PyObject *row_vector_multiplication(VectorObject* vec, MatrixObject * mat); /* utility func */ -//----------------------------------Mathutils.Vector() ------------------ +//----------------------------------mathutils.Vector() ------------------ // Supports 2D, 3D, and 4D vector objects both int and float values // accepted. Mixed float and int values accepted. Ints are parsed to float static PyObject *Vector_new(PyTypeObject *type, PyObject *args, PyObject *kwds) @@ -57,7 +57,7 @@ static PyObject *Vector_new(PyTypeObject *type, PyObject *args, PyObject *kwds) if (PySequence_Check(listObject)) { size = PySequence_Length(listObject); } else { // Single argument was not a sequence - PyErr_SetString(PyExc_TypeError, "Mathutils.Vector(): 2-4 floats or ints expected (optionally in a sequence)\n"); + PyErr_SetString(PyExc_TypeError, "mathutils.Vector(): 2-4 floats or ints expected (optionally in a sequence)\n"); return NULL; } } else if (size == 0) { @@ -68,21 +68,21 @@ static PyObject *Vector_new(PyTypeObject *type, PyObject *args, PyObject *kwds) } if (size<2 || size>4) { // Invalid vector size - PyErr_SetString(PyExc_AttributeError, "Mathutils.Vector(): 2-4 floats or ints expected (optionally in a sequence)\n"); + PyErr_SetString(PyExc_AttributeError, "mathutils.Vector(): 2-4 floats or ints expected (optionally in a sequence)\n"); return NULL; } for (i=0; i<size; i++) { v=PySequence_GetItem(listObject, i); if (v==NULL) { // Failed to read sequence - PyErr_SetString(PyExc_RuntimeError, "Mathutils.Vector(): 2-4 floats or ints expected (optionally in a sequence)\n"); + PyErr_SetString(PyExc_RuntimeError, "mathutils.Vector(): 2-4 floats or ints expected (optionally in a sequence)\n"); return NULL; } f= PyFloat_AsDouble(v); if(f==-1 && PyErr_Occurred()) { // parsed item not a number Py_DECREF(v); - PyErr_SetString(PyExc_TypeError, "Mathutils.Vector(): 2-4 floats or ints expected (optionally in a sequence)\n"); + PyErr_SetString(PyExc_TypeError, "mathutils.Vector(): 2-4 floats or ints expected (optionally in a sequence)\n"); return NULL; } @@ -643,7 +643,6 @@ static PyObject *Vector_Project(VectorObject * self, VectorObject * value) return newVectorObject(vec, size, Py_NEW, NULL); } -//----------------------------------Mathutils.MidpointVecs() ------------- static char Vector_Lerp_doc[] = ".. function:: lerp(other, factor)\n" "\n" |