MCPcopy Create free account
hub / github.com/blender/blender / Vector_lerp

Function Vector_lerp

source/blender/python/mathutils/mathutils_Vector.cc:1382–1406  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1380 " :return: The interpolated vector.\n"
1381 " :rtype: :class:`Vector`\n");
1382static PyObject *Vector_lerp(VectorObject *self, PyObject *args)
1383{
1384 const int vec_num = self->vec_num;
1385 PyObject *value = nullptr;
1386 float fac;
1387 float *tvec;
1388
1389 if (!PyArg_ParseTuple(args, "Of:lerp", &value, &fac)) {
1390 return nullptr;
1391 }
1392
1393 if (BaseMath_ReadCallback(self) == -1) {
1394 return nullptr;
1395 }
1396
1397 if (mathutils_array_parse_alloc(
1398 &tvec, vec_num, value, "Vector.lerp(other), invalid 'other' arg") == -1)
1399 {
1400 return nullptr;
1401 }
1402
1403 interp_vn_vn(tvec, self->vec, 1.0f - fac, vec_num);
1404
1405 return Vector_CreatePyObject_alloc(tvec, vec_num, Py_TYPE(self));
1406}
1407
1408/** \} */
1409

Callers

nothing calls this directly

Calls 3

interp_vn_vnFunction · 0.85

Tested by

no test coverage detected