Matrix().roate(matrix) didn't work

I don’t know why this won’t work

>>> s
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, 1.0, 1.0)))

>>> mc
Matrix(((0.7071067690849304, 0.0, -0.7071067690849304),
        (0.0, 1.0, 0.0),
        (0.7071067690849304, 0.0, 0.7071067690849304)))

>>> s.rotate(mc)
Traceback (most recent call last):
  File "<blender_console>", line 1, in <module>
TypeError: Matrix.rotate(): must have 3x3 dimensions

if this won’t work, how can I rotate a matrix, I didn’t mean to change the rotation value, I mean change the whole matrix with translations

>>> s.rotate(Euler((0,math.radians(90),0),‘XYZ’))
Traceback (most recent call last):
File “<blender_console>”, line 1, in <module>
TypeError: Matrix.rotate(): must have 3x3 dimensions

this won’t work too

>>> s[3].rotate(Euler((0,math.radians(90),0),‘XYZ’))
>>> s[3]
Vector((1.0, 0.0, -4.371138828673793e-08, 1.0))

this worked

s must be 3x3
eventually make it later again 4x4 :wink: (after rotation)

I think a rotation as matrix is ‘always’ a 3x3 matrix,
because rotations form a group (mathematics) with matrix multiplication as group operation :wink:

thanks for the explaination. I’ve been mislead by actionscript’s matrix.roate, in which allow a rotate using matrix4x4. I now guess it’s a shortcut for two steps :slight_smile: