from mathutils import Matrix
Matrix_a = Matrix([1,0,0,0,],[0,1,0,0,],[0,0,1,0],[0,0,1/1.2,0])
Matrix_b = Matrix([1],[1],[1],[1])
Matrix_c = Matrix_a*Matrix_b
print(Matrix_c)
Not right?
from mathutils import Matrix
Matrix_a = Matrix([1,0,0,0,],[0,1,0,0,],[0,0,1,0],[0,0,1/1.2,0])
Matrix_b = Matrix([1],[1],[1],[1])
Matrix_c = Matrix_a*Matrix_b
print(Matrix_c)
Not right?
Matrix_b is not a matrix in your code, it’s a vector.
from mathutils import Matrix
from mathutils import Vector
a = Matrix([1,0,0,0,],[0,1,0,0,],[0,0,1,0],[0,0,1/1.2,0])
b = Vector([1,1,1,1])
c = a*b
print(c)
Hope this helps…
Update, cause the blender-python-api changed it:
a Vector-Matrix multiplication is only possible
as
Vector * Matrix
and not the commuted like: Matrix * Vector
since ?2.55 rev.338xx?
But in blender 2.49 there’s no mathutils lib…use Math instead?
use
from Blender.Mathutils import Matrix
from Blender.Mathutils import Vector
in blender 2.49