diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-05-16 14:43:18 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-05-16 14:43:18 +0400 |
commit | b214ea3aa402fe8d377de38276a068456a5c5223 (patch) | |
tree | f49f05b9fe46ad503baa15098ef70cf9f93e4035 /source/blender/freestyle/intern/python | |
parent | 66181332814f3128254622eada820a42a968c10b (diff) |
svn merge ^/trunk/blender -c56620 -c56639 -c56643 -c56647 -c56648 -c56650 -c56651 -c56653 -c56654 -c56661 -c56662 -c56663 -c56668 -c56670 -c56671 -c56672 -c56673 -c56674 -c56676 -c56678 -c56679 -c56680 -c56682 -c56688 -c56689 -c56698 -c56700 -c56707 -c56711 -c56735 -c56745 -c56747 -c56748 -c56749 -c56755 -c56756 -c56759 -c56760 -c56763 -c56766 -c56767 -c56773 -c56778 -c56783 -c56784 -c56785 -c56790 -c56791 -c56793 -c56800 -c56806 -c56807 -c56809 -c56815 -c56816 -c56820
Diffstat (limited to 'source/blender/freestyle/intern/python')
-rw-r--r-- | source/blender/freestyle/intern/python/BPy_Convert.cpp | 2 | ||||
-rw-r--r-- | source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/freestyle/intern/python/BPy_Convert.cpp b/source/blender/freestyle/intern/python/BPy_Convert.cpp index c684eaf483e..3b1232c51af 100644 --- a/source/blender/freestyle/intern/python/BPy_Convert.cpp +++ b/source/blender/freestyle/intern/python/BPy_Convert.cpp @@ -704,7 +704,7 @@ int float_array_from_PyObject(PyObject *obj, float *v, int n) return float_array_from_PyList(obj, v, n); } else if (PyTuple_Check(obj) && PyTuple_Size(obj) == n) { - return float_array_from_PyList(obj, v, n); + return float_array_from_PyTuple(obj, v, n); } return 0; } diff --git a/source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp b/source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp index c0372a10aef..e17f16a2fa7 100644 --- a/source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp +++ b/source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp @@ -526,12 +526,12 @@ static PyObject *StrokeAttribute_color_get(BPy_StrokeAttribute *self, void *UNUS static int StrokeAttribute_color_set(BPy_StrokeAttribute *self, PyObject *value, void *UNUSED(closure)) { - Vec3f *v = Vec3f_ptr_from_PyObject(value); - if (!v) { + float v[3]; + if (!float_array_from_PyObject(value, v, 3)) { PyErr_SetString(PyExc_ValueError, "value must be a 3-dimensional vector"); return -1; } - self->sa->setColor(v->x(), v->y(), v->z()); + self->sa->setColor(v[0], v[1], v[2]); return 0; } @@ -550,12 +550,12 @@ static PyObject *StrokeAttribute_thickness_get(BPy_StrokeAttribute *self, void * static int StrokeAttribute_thickness_set(BPy_StrokeAttribute *self, PyObject *value, void *UNUSED(closure)) { - Vec2f *v = Vec2f_ptr_from_PyObject(value); - if (!v) { + float v[2]; + if (!float_array_from_PyObject(value, v, 2)) { PyErr_SetString(PyExc_ValueError, "value must be a 2-dimensional vector"); return -1; } - self->sa->setThickness(v->x(), v->y()); + self->sa->setThickness(v[0], v[1]); return 0; } |