Object ignores Rotation from Matrix and more[Solved]

2.80 Cheat Sheet for updating add-ons - Coding / Python Support - Blender Artists Community

Python API - Blender Developer Documentation

Matrix Multiplication

Matrix multiplication previously used *, scripts should now use @ for multiplication (per PEP 465). This applies to:

  • Vector * Vector
  • Quaternion * Vector
  • Matrix * Vector
  • Vector * Matrix
  • Matrix * Matrix

Note: In the future * will be used for element-wise multiplication

2.7x:

mat = Matrix()
vec = Vector()
result = mat * vec

2.8x:

mat = Matrix()
vec = Vector()
result = mat @ vec

Using the 2.7x syntax in 2.80 or later will result in this error:

TypeError: Element-wise multiplication: not supported between 'xxx' and 'yyy' types

In Place Matrix Multiplication

Note that mat_a *= mat_b did not change the original matrix, now in 2.8 it does (matching other types - Vector and Python lists for example).

Noting this since it could be a breaking change for scripts that relied on it creating a new matrix, especially if in cases where a matrix is passed as a function argument and changed to it aren’t expected.

1 Like