diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-11-24 08:45:36 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-11-24 08:45:36 +0400 |
commit | 3b9b6051d93122a27da57908c987670e9f831e7f (patch) | |
tree | b620d0cdde60247df6585058af36bcc89c0e2bb6 /source/blender/python/mathutils/mathutils_geometry.c | |
parent | c62d33c540830188207bc32d5e3fc5a2134f5ab1 (diff) |
rename mathutils constructors to match other parts of the bpy/api (no functional changes)
Diffstat (limited to 'source/blender/python/mathutils/mathutils_geometry.c')
-rw-r--r-- | source/blender/python/mathutils/mathutils_geometry.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/source/blender/python/mathutils/mathutils_geometry.c b/source/blender/python/mathutils/mathutils_geometry.c index 2f79dfd9914..c5e0d2ab95d 100644 --- a/source/blender/python/mathutils/mathutils_geometry.c +++ b/source/blender/python/mathutils/mathutils_geometry.c @@ -158,7 +158,7 @@ static PyObject *M_Geometry_intersect_ray_tri(PyObject *UNUSED(self), PyObject* mul_v3_fl(dir, t); add_v3_v3v3(pvec, orig, dir); - return newVectorObject(pvec, 3, Py_NEW, NULL); + return Vector_CreatePyObject(pvec, 3, Py_NEW, NULL); } /* Line-Line intersection using algorithm from mathworld.wolfram.com */ @@ -242,8 +242,8 @@ static PyObject *M_Geometry_intersect_line_line(PyObject *UNUSED(self), PyObject } else { tuple= PyTuple_New(2); - PyTuple_SET_ITEM(tuple, 0, newVectorObject(i1, vec1->size, Py_NEW, NULL)); - PyTuple_SET_ITEM(tuple, 1, newVectorObject(i2, vec1->size, Py_NEW, NULL)); + PyTuple_SET_ITEM(tuple, 0, Vector_CreatePyObject(i1, vec1->size, Py_NEW, NULL)); + PyTuple_SET_ITEM(tuple, 1, Vector_CreatePyObject(i2, vec1->size, Py_NEW, NULL)); return tuple; } } @@ -338,7 +338,7 @@ static PyObject *M_Geometry_normal(PyObject *UNUSED(self), PyObject* args) normal_quad_v3(n, vec1->vec, vec2->vec, vec3->vec, vec4->vec); } - return newVectorObject(n, 3, Py_NEW, NULL); + return Vector_CreatePyObject(n, 3, Py_NEW, NULL); } //--------------------------------- AREA FUNCTIONS-------------------- @@ -433,7 +433,7 @@ static PyObject *M_Geometry_intersect_line_line_2d(PyObject *UNUSED(self), PyObj } if (isect_seg_seg_v2_point(line_a1->vec, line_a2->vec, line_b1->vec, line_b2->vec, vi) == 1) { - return newVectorObject(vi, 2, Py_NEW, NULL); + return Vector_CreatePyObject(vi, 2, Py_NEW, NULL); } else { Py_RETURN_NONE; @@ -490,7 +490,7 @@ static PyObject *M_Geometry_intersect_line_plane(PyObject *UNUSED(self), PyObjec } if (isect_line_plane_v3(isect, line_a->vec, line_b->vec, plane_co->vec, plane_no->vec, no_flip) == 1) { - return newVectorObject(isect, 3, Py_NEW, NULL); + return Vector_CreatePyObject(isect, 3, Py_NEW, NULL); } else { Py_RETURN_NONE; @@ -552,8 +552,8 @@ static PyObject *M_Geometry_intersect_plane_plane(PyObject *UNUSED(self), PyObje normalize_v3(isect_no); ret= PyTuple_New(2); - PyTuple_SET_ITEM(ret, 0, newVectorObject(isect_co, 3, Py_NEW, NULL)); - PyTuple_SET_ITEM(ret, 1, newVectorObject(isect_no, 3, Py_NEW, NULL)); + PyTuple_SET_ITEM(ret, 0, Vector_CreatePyObject(isect_co, 3, Py_NEW, NULL)); + PyTuple_SET_ITEM(ret, 1, Vector_CreatePyObject(isect_no, 3, Py_NEW, NULL)); return ret; } @@ -626,10 +626,10 @@ static PyObject *M_Geometry_intersect_line_sphere(PyObject *UNUSED(self), PyObje use_b= FALSE; } - if (use_a) { PyTuple_SET_ITEM(ret, 0, newVectorObject(isect_a, 3, Py_NEW, NULL)); } + if (use_a) { PyTuple_SET_ITEM(ret, 0, Vector_CreatePyObject(isect_a, 3, Py_NEW, NULL)); } else { PyTuple_SET_ITEM(ret, 0, Py_None); Py_INCREF(Py_None); } - if (use_b) { PyTuple_SET_ITEM(ret, 1, newVectorObject(isect_b, 3, Py_NEW, NULL)); } + if (use_b) { PyTuple_SET_ITEM(ret, 1, Vector_CreatePyObject(isect_b, 3, Py_NEW, NULL)); } else { PyTuple_SET_ITEM(ret, 1, Py_None); Py_INCREF(Py_None); } return ret; @@ -699,10 +699,10 @@ static PyObject *M_Geometry_intersect_line_sphere_2d(PyObject *UNUSED(self), PyO use_b= FALSE; } - if (use_a) { PyTuple_SET_ITEM(ret, 0, newVectorObject(isect_a, 2, Py_NEW, NULL)); } + if (use_a) { PyTuple_SET_ITEM(ret, 0, Vector_CreatePyObject(isect_a, 2, Py_NEW, NULL)); } else { PyTuple_SET_ITEM(ret, 0, Py_None); Py_INCREF(Py_None); } - if (use_b) { PyTuple_SET_ITEM(ret, 1, newVectorObject(isect_b, 2, Py_NEW, NULL)); } + if (use_b) { PyTuple_SET_ITEM(ret, 1, Vector_CreatePyObject(isect_b, 2, Py_NEW, NULL)); } else { PyTuple_SET_ITEM(ret, 1, Py_None); Py_INCREF(Py_None); } return ret; @@ -758,7 +758,7 @@ static PyObject *M_Geometry_intersect_point_line(PyObject *UNUSED(self), PyObjec lambda= closest_to_line_v3(pt_out, pt_in, l1, l2); ret= PyTuple_New(2); - PyTuple_SET_ITEM(ret, 0, newVectorObject(pt_out, 3, Py_NEW, NULL)); + PyTuple_SET_ITEM(ret, 0, Vector_CreatePyObject(pt_out, 3, Py_NEW, NULL)); PyTuple_SET_ITEM(ret, 1, PyFloat_FromDouble(lambda)); return ret; } @@ -939,7 +939,7 @@ static PyObject *M_Geometry_barycentric_transform(PyObject *UNUSED(self), PyObje vec_t1_tar->vec, vec_t2_tar->vec, vec_t3_tar->vec, vec_t1_src->vec, vec_t2_src->vec, vec_t3_src->vec); - return newVectorObject(vec, 3, Py_NEW, NULL); + return Vector_CreatePyObject(vec, 3, Py_NEW, NULL); } #ifndef MATH_STANDALONE @@ -1015,7 +1015,7 @@ static PyObject *M_Geometry_interpolate_bezier(PyObject *UNUSED(self), PyObject* list= PyList_New(resolu); fp= coord_array; for (i=0; i<resolu; i++, fp= fp+dims) { - PyList_SET_ITEM(list, i, newVectorObject(fp, dims, Py_NEW, NULL)); + PyList_SET_ITEM(list, i, Vector_CreatePyObject(fp, dims, Py_NEW, NULL)); } MEM_freeN(coord_array); return list; |