4
$\begingroup$

I'm trying to use Blender as my GUI content creator, and I'm writing plugins for it.

I have a brief look on the API document and noticed that Objects have three matrices: world, local and basis. It is pretty easy to understand world and local matrix, and they work as I expected. However, I don't get the concept of basis matrix, and it can be disturbed by Alt-O hotkey.

Although it seems local and world matrix is enough for me, I am still curious about the meaning of the basis matrix. So what does basis matrix stands for?

$\endgroup$
5
$\begingroup$

From the documentation it states:

Matrix access to location, rotation and scale (including deltas), before constraints and parenting are applied

The key is that it is the matrix before constraints are applied, as some constraints can alter the local matrix.

API docs - bpy.types.Object

$\endgroup$
  • 7
    $\begingroup$ It's also worth mentioning it's role in other matrices: matrix_local = matrix_parent_inverse * matrix_basis, and matrix_world = parent.matrix_world * matrix_local. $\endgroup$ – misnomer Dec 10 '16 at 21:21
  • 1
    $\begingroup$ ^ This part should really be in the documentation $\endgroup$ – Justin Helps Sep 13 '18 at 14:32
  • 2
    $\begingroup$ Just a note for posterity: in blender 2.8 you use the @ operator to multiply matrices, so matrix_local = matrix_parent_inverse @ matrix_basis and matrix_world = parent.matrix_world @ matrix_local $\endgroup$ – BoteRock Mar 21 at 20:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.