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_Convert.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_Convert.cpp')
-rw-r--r-- | source/blender/freestyle/intern/python/BPy_Convert.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/source/blender/freestyle/intern/python/BPy_Convert.cpp b/source/blender/freestyle/intern/python/BPy_Convert.cpp index dfa81a062b6..78c3599b7cd 100644 --- a/source/blender/freestyle/intern/python/BPy_Convert.cpp +++ b/source/blender/freestyle/intern/python/BPy_Convert.cpp @@ -718,7 +718,7 @@ bool Vec3r_ptr_from_PyTuple(PyObject *obj, Vec3r &vec) return true; } -// helper for argument parsing +// helpers for argument parsing bool float_array_from_PyObject(PyObject *obj, float *v, int n) { @@ -745,6 +745,22 @@ bool float_array_from_PyObject(PyObject *obj, float *v, int n) return 0; } +int convert_v4(PyObject *obj, void *v) +{ + return mathutils_array_parse((float *)v, 4, 4, obj, "Error parsing 4D vector"); +} + +int convert_v3(PyObject *obj, void *v) +{ + return mathutils_array_parse((float *)v, 3, 3, obj, "Error parsing 3D vector"); +} + +int convert_v2(PyObject *obj, void *v) +{ + return mathutils_array_parse((float *)v, 2, 2, obj, "Error parsing 2D vector"); +} + + /////////////////////////////////////////////////////////////////////////////////////////// #ifdef __cplusplus |