TypeError: Element-wise multiplication: not supported between 'Matrix' and 'Vector'
Blender 2.8+ Matrix multiplication

The question code method was in place for Blender &lt;=2.79.9. Blender has since adjusted its mathutils module, replacing the asterisk * with the at symbol @, aka the PEP 465 binary operator, for multiplying matrices with vectors.

&gt;&gt;&gt; M = Matrix()
&gt;&gt;&gt; v = Vector()
&gt;&gt;&gt; M @ v
Vector((0.0, 0.0, 0.0))

&gt;&gt;&gt; v @ v
0.0

&gt;&gt;&gt; M @ M
Matrix(((1.0, 0.0, 0.0, 0.0),
        (0.0, 1.0, 0.0, 0.0),
        (0.0, 0.0, 1.0, 0.0),
        (0.0, 0.0, 0.0, 1.0)))


Note using @ will throw the "same type of error"  in &lt;= 2.79.9 Replace with * as in question code.

&gt;&gt;&gt; M = Matrix()
&gt;&gt;&gt; M @ M
Traceback (most recent call last):
  File "&lt;blender_console&gt;", line 1, in &lt;module&gt;
TypeError: unsupported operand type(s) for @: 'Matrix' and 'Matrix'