[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [10794] trunk/blender/source/blender/ python/api2_2x: adding object.matrixParentInverse

Campbell Barton cbarton at metavr.com
Mon May 28 05:09:48 CEST 2007


Revision: 10794
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bforge-svn&revision=10794
Author:   campbellbarton
Date:     2007-05-28 05:09:46 +0200 (Mon, 28 May 2007)

Log Message:
-----------
adding object.matrixParentInverse

Modified Paths:
--------------
    trunk/blender/source/blender/python/api2_2x/Object.c
    trunk/blender/source/blender/python/api2_2x/doc/Object.py

Modified: trunk/blender/source/blender/python/api2_2x/Object.c
===================================================================
--- trunk/blender/source/blender/python/api2_2x/Object.c	2007-05-28 01:34:22 UTC (rev 10793)
+++ trunk/blender/source/blender/python/api2_2x/Object.c	2007-05-28 03:09:46 UTC (rev 10794)
@@ -4391,6 +4391,13 @@
 	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 @@
 	 (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)",

Modified: trunk/blender/source/blender/python/api2_2x/doc/Object.py
===================================================================
--- trunk/blender/source/blender/python/api2_2x/doc/Object.py	2007-05-28 01:34:22 UTC (rev 10793)
+++ trunk/blender/source/blender/python/api2_2x/doc/Object.py	2007-05-28 03:09:46 UTC (rev 10794)
@@ -366,6 +366,8 @@
 	@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





More information about the Bf-blender-cvs mailing list