From 91ea74c3391f1ac22aec7878e135c9a00d3a2538 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 28 May 2007 03:09:46 +0000 Subject: adding object.matrixParentInverse --- source/blender/python/api2_2x/Object.c | 11 +++++++++++ source/blender/python/api2_2x/doc/Object.py | 2 ++ 2 files changed, 13 insertions(+) (limited to 'source') 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}). @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 -- cgit v1.2.3