Cleanup: use "num" as a suffix in: source/blender/python

See T85728
This commit is contained in:
2022-03-28 11:06:01 +11:00
parent 77155ae1c0
commit 83c274ccfc
15 changed files with 547 additions and 540 deletions

View File

@@ -158,24 +158,30 @@ static PyObject *M_Geometry_intersect_line_line(PyObject *UNUSED(self), PyObject
PyObject *tuple;
PyObject *py_lines[4];
float lines[4][3], i1[3], i2[3];
int len;
int ix_vec_num;
int result;
if (!PyArg_ParseTuple(args, "OOOO:intersect_line_line", UNPACK4_EX(&, py_lines, ))) {
return NULL;
}
if ((((len = mathutils_array_parse(
if ((((ix_vec_num = mathutils_array_parse(
lines[0], 2, 3 | MU_ARRAY_SPILL | MU_ARRAY_ZERO, py_lines[0], error_prefix)) != -1) &&
(mathutils_array_parse(
lines[1], len, len | MU_ARRAY_SPILL | MU_ARRAY_ZERO, py_lines[1], error_prefix) !=
-1) &&
(mathutils_array_parse(
lines[2], len, len | MU_ARRAY_SPILL | MU_ARRAY_ZERO, py_lines[2], error_prefix) !=
-1) &&
(mathutils_array_parse(
lines[3], len, len | MU_ARRAY_SPILL | MU_ARRAY_ZERO, py_lines[3], error_prefix) !=
-1)) == 0) {
(mathutils_array_parse(lines[1],
ix_vec_num,
ix_vec_num | MU_ARRAY_SPILL | MU_ARRAY_ZERO,
py_lines[1],
error_prefix) != -1) &&
(mathutils_array_parse(lines[2],
ix_vec_num,
ix_vec_num | MU_ARRAY_SPILL | MU_ARRAY_ZERO,
py_lines[2],
error_prefix) != -1) &&
(mathutils_array_parse(lines[3],
ix_vec_num,
ix_vec_num | MU_ARRAY_SPILL | MU_ARRAY_ZERO,
py_lines[3],
error_prefix) != -1)) == 0) {
return NULL;
}
@@ -192,8 +198,9 @@ static PyObject *M_Geometry_intersect_line_line(PyObject *UNUSED(self), PyObject
}
tuple = PyTuple_New(2);
PyTuple_SET_ITEMS(
tuple, Vector_CreatePyObject(i1, len, NULL), Vector_CreatePyObject(i2, len, NULL));
PyTuple_SET_ITEMS(tuple,
Vector_CreatePyObject(i1, ix_vec_num, NULL),
Vector_CreatePyObject(i2, ix_vec_num, NULL));
return tuple;
}
@@ -764,14 +771,14 @@ static PyObject *M_Geometry_intersect_point_line(PyObject *UNUSED(self), PyObjec
float pt[3], pt_out[3], line_a[3], line_b[3];
float lambda;
PyObject *ret;
int size = 2;
int pt_num = 2;
if (!PyArg_ParseTuple(args, "OOO:intersect_point_line", &py_pt, &py_line_a, &py_line_b)) {
return NULL;
}
/* accept 2d verts */
if ((((size = mathutils_array_parse(
if ((((pt_num = mathutils_array_parse(
pt, 2, 3 | MU_ARRAY_SPILL | MU_ARRAY_ZERO, py_pt, error_prefix)) != -1) &&
(mathutils_array_parse(
line_a, 2, 3 | MU_ARRAY_SPILL | MU_ARRAY_ZERO, py_line_a, error_prefix) != -1) &&
@@ -784,7 +791,7 @@ static PyObject *M_Geometry_intersect_point_line(PyObject *UNUSED(self), PyObjec
lambda = closest_to_line_v3(pt_out, pt, line_a, line_b);
ret = PyTuple_New(2);
PyTuple_SET_ITEMS(ret, Vector_CreatePyObject(pt_out, size, NULL), PyFloat_FromDouble(lambda));
PyTuple_SET_ITEMS(ret, Vector_CreatePyObject(pt_out, pt_num, NULL), PyFloat_FromDouble(lambda));
return ret;
}