6
$\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$
1

1 Answer 1

8
$\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$
3
  • 9
    $\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, 2016 at 21:21
  • 1
    $\begingroup$ ^ This part should really be in the documentation $\endgroup$ Sep 13, 2018 at 14:32
  • 4
    $\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, 2019 at 20:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .