diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2014-06-24 17:48:15 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2014-06-24 18:13:56 +0400 |
commit | 9563bde9a5457a3b04b61b8727d798da3ab689d3 (patch) | |
tree | 13d9205314245e57fc62db8af0d5a9457fd45ad6 /source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp | |
parent | 252eaed483ca8c0d89708b3d0a2a82076f944229 (diff) |
Freestyle: use mathutils_array_parse() instead of its own helper functions.
Patch contribution by flokkievids (Folkert de Vries). Thanks!
Diffstat (limited to 'source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp')
-rw-r--r-- | source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp b/source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp index 69d5312f9e5..22ffdedb3d9 100644 --- a/source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp +++ b/source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp @@ -525,8 +525,9 @@ static PyObject *StrokeAttribute_color_get(BPy_StrokeAttribute *self, void *UNUS static int StrokeAttribute_color_set(BPy_StrokeAttribute *self, PyObject *value, void *UNUSED(closure)) { float v[3]; - if (!float_array_from_PyObject(value, v, 3)) { - PyErr_SetString(PyExc_ValueError, "value must be a 3-dimensional vector"); + if (mathutils_array_parse(v, 3, 3, value, + "value must be a 3-dimensional vector") == -1) + { return -1; } self->sa->setColor(v[0], v[1], v[2]); @@ -549,8 +550,9 @@ static PyObject *StrokeAttribute_thickness_get(BPy_StrokeAttribute *self, void * static int StrokeAttribute_thickness_set(BPy_StrokeAttribute *self, PyObject *value, void *UNUSED(closure)) { float v[2]; - if (!float_array_from_PyObject(value, v, 2)) { - PyErr_SetString(PyExc_ValueError, "value must be a 2-dimensional vector"); + if (mathutils_array_parse(v, 2, 2, value, + "value must be a 2-dimensional vector") == -1) + { return -1; } self->sa->setThickness(v[0], v[1]); |