Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Chaves <laurelkeys>2020-02-20 05:57:32 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-02-20 05:58:46 +0300
commitbc86eb1780a8793e5c511073eb20d5f6e7fd2e0b (patch)
tree2fa91ed1a8adea8a4066c36f5ba7d602026202f8 /source/blender/python/mathutils/mathutils_Matrix.c
parent0115568ca6537260b2f177bf59edd55d07904099 (diff)
mathutils: support Vector.rotate for 2D vectors
Diffstat (limited to 'source/blender/python/mathutils/mathutils_Matrix.c')
-rw-r--r--source/blender/python/mathutils/mathutils_Matrix.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/python/mathutils/mathutils_Matrix.c b/source/blender/python/mathutils/mathutils_Matrix.c
index 32921ae0ca9..b31e069651b 100644
--- a/source/blender/python/mathutils/mathutils_Matrix.c
+++ b/source/blender/python/mathutils/mathutils_Matrix.c
@@ -3306,6 +3306,23 @@ int Matrix_ParseAny(PyObject *o, void *p)
return 1;
}
+int Matrix_Parse2x2(PyObject *o, void *p)
+{
+ MatrixObject **pymat_p = p;
+ MatrixObject *pymat = (MatrixObject *)o;
+
+ if (!Matrix_ParseCheck(pymat)) {
+ return 0;
+ }
+ if ((pymat->num_col != 2) || (pymat->num_row != 2)) {
+ PyErr_SetString(PyExc_ValueError, "matrix must be 2x2");
+ return 0;
+ }
+
+ *pymat_p = pymat;
+ return 1;
+}
+
int Matrix_Parse3x3(PyObject *o, void *p)
{
MatrixObject **pymat_p = p;