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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2007-05-28 07:09:46 +0400
committerCampbell Barton <ideasman42@gmail.com>2007-05-28 07:09:46 +0400
commit91ea74c3391f1ac22aec7878e135c9a00d3a2538 (patch)
treea777800ee5b670c5a37ba90698aa890aa812a5d4 /source
parentbcc314311969959df482dd5525703533d875d023 (diff)
adding object.matrixParentInverse
Diffstat (limited to 'source')
-rw-r--r--source/blender/python/api2_2x/Object.c11
-rw-r--r--source/blender/python/api2_2x/doc/Object.py2
2 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/Object.c b/source/blender/python/api2_2x/Object.c
index 8cd872e9988..9be64fc72a6 100644
--- a/source/blender/python/api2_2x/Object.c
+++ b/source/blender/python/api2_2x/Object.c
@@ -4391,6 +4391,13 @@ static PyObject *Object_getMatrixWorld( BPy_Object * self )
return newMatrixObject((float*)self->object->obmat,4,4,Py_WRAP);
}
+/* Parent Inverse matrix */
+
+static PyObject *Object_getMatrixParentInverse( BPy_Object * self )
+{
+ return newMatrixObject((float*)self->object->parentinv,4,4,Py_WRAP);
+}
+
/*
* Old behavior, prior to Blender 2.34, where eventual changes made by the
* script itself were not taken into account until a redraw happened, either
@@ -4761,6 +4768,10 @@ static PyGetSetDef BPy_Object_getseters[] = {
(getter)Object_getMatrixLocal, (setter)Object_setMatrix,
"localspace matrix: relative to the object's parent",
NULL},
+ {"matrixParentInverse",
+ (getter)Object_getMatrixParentInverse, (setter)NULL,
+ "parents inverse matrix: parents localspace inverted matrix",
+ NULL},
{"matrixOldWorld",
(getter)Object_getMatrixOldWorld, (setter)NULL,
"old-type worldspace matrix (prior to Blender 2.34)",
diff --git a/source/blender/python/api2_2x/doc/Object.py b/source/blender/python/api2_2x/doc/Object.py
index 34c06c5a4d8..34cdd4b7821 100644
--- a/source/blender/python/api2_2x/doc/Object.py
+++ b/source/blender/python/api2_2x/doc/Object.py
@@ -366,6 +366,8 @@ class Object:
@ivar matrixLocal: The matrix of the object relative to its parent; if there is no parent,
returns the world matrix (L{matrixWorld<Object.Object.matrixWorld>}).
@type matrixLocal: Matrix
+ @ivar matrixParentInverse: The inverse if the parents local matrix, set when the objects parent is set (wrapped).
+ @type matrixParentInverse: Matrix
@ivar matrixOldWorld: Old-type worldspace matrix (prior to Blender 2.34).
Read-only.
@type matrixOldWorld: Matrix